Daniel Werner has submitted this change and it was merged. Change subject: refactor testCanStore method down ......................................................................
refactor testCanStore method down Change-Id: I43f9b693d314ee63d2130da50053cfe80ffa2dbc --- M QueryEngine/tests/phpunit/SQLStore/SnakStore/NoValueSnakStoreTest.php M QueryEngine/tests/phpunit/SQLStore/SnakStore/PropertyValueSnakStoreTest.php M QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakStoreTest.php M QueryEngine/tests/phpunit/SQLStore/SnakStore/SomeValueSnakStoreTest.php 4 files changed, 9 insertions(+), 24 deletions(-) Approvals: Daniel Werner: Verified; Looks good to me, approved diff --git a/QueryEngine/tests/phpunit/SQLStore/SnakStore/NoValueSnakStoreTest.php b/QueryEngine/tests/phpunit/SQLStore/SnakStore/NoValueSnakStoreTest.php index 159d35b..c41a328 100644 --- a/QueryEngine/tests/phpunit/SQLStore/SnakStore/NoValueSnakStoreTest.php +++ b/QueryEngine/tests/phpunit/SQLStore/SnakStore/NoValueSnakStoreTest.php @@ -7,7 +7,6 @@ use Wikibase\PropertySomeValueSnak; use Wikibase\PropertyValueSnak; use Wikibase\QueryEngine\SQLStore\SnakStore\NoValueSnakStore; -use Wikibase\Snak; /** * Unit tests for the Wikibase\QueryEngine\SQLStore\SnakStore\NoValueSnakStore class. @@ -56,13 +55,6 @@ $argLists[] = array( false, new PropertySomeValueSnak( 720101 ) ); return $argLists; - } - - /** - * @dataProvider canStoreProvider - */ - public function testCanStore( $canStore, Snak $snak ) { - $this->assertEquals( $canStore, $this->getInstance()->canStore( $snak ) ); } } diff --git a/QueryEngine/tests/phpunit/SQLStore/SnakStore/PropertyValueSnakStoreTest.php b/QueryEngine/tests/phpunit/SQLStore/SnakStore/PropertyValueSnakStoreTest.php index a7eb187..a7a5f29 100644 --- a/QueryEngine/tests/phpunit/SQLStore/SnakStore/PropertyValueSnakStoreTest.php +++ b/QueryEngine/tests/phpunit/SQLStore/SnakStore/PropertyValueSnakStoreTest.php @@ -7,7 +7,6 @@ use Wikibase\PropertySomeValueSnak; use Wikibase\PropertyValueSnak; use Wikibase\QueryEngine\SQLStore\SnakStore\PropertyValueSnakStore; -use Wikibase\Snak; /** * Unit tests for the Wikibase\QueryEngine\SQLStore\SnakStore\PropertyValueSnakStore class. @@ -56,13 +55,6 @@ $argLists[] = array( false, new PropertySomeValueSnak( 720101 ) ); return $argLists; - } - - /** - * @dataProvider canStoreProvider - */ - public function testCanStore( $canStore, Snak $snak ) { - $this->assertEquals( $canStore, $this->getInstance()->canStore( $snak ) ); } } diff --git a/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakStoreTest.php b/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakStoreTest.php index 43d557b..7715972 100644 --- a/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakStoreTest.php +++ b/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakStoreTest.php @@ -42,6 +42,8 @@ */ protected abstract function getInstance(); + protected abstract function canStoreProvider(); + public function differentSnaksProvider() { $argLists = array(); @@ -65,4 +67,11 @@ $this->assertInternalType( 'boolean', $canStore ); } + /** + * @dataProvider canStoreProvider + */ + public function testCanStore( $canStore, Snak $snak ) { + $this->assertEquals( $canStore, $this->getInstance()->canStore( $snak ) ); + } + } diff --git a/QueryEngine/tests/phpunit/SQLStore/SnakStore/SomeValueSnakStoreTest.php b/QueryEngine/tests/phpunit/SQLStore/SnakStore/SomeValueSnakStoreTest.php index 3a9b36b..d2c287c 100644 --- a/QueryEngine/tests/phpunit/SQLStore/SnakStore/SomeValueSnakStoreTest.php +++ b/QueryEngine/tests/phpunit/SQLStore/SnakStore/SomeValueSnakStoreTest.php @@ -7,7 +7,6 @@ use Wikibase\PropertySomeValueSnak; use Wikibase\PropertyValueSnak; use Wikibase\QueryEngine\SQLStore\SnakStore\SomeValueSnakStore; -use Wikibase\Snak; /** * Unit tests for the Wikibase\QueryEngine\SQLStore\SnakStore\SomeValueSnakStore class. @@ -56,13 +55,6 @@ $argLists[] = array( true, new PropertySomeValueSnak( 720101 ) ); return $argLists; - } - - /** - * @dataProvider canStoreProvider - */ - public function testCanStore( $canStore, Snak $snak ) { - $this->assertEquals( $canStore, $this->getInstance()->canStore( $snak ) ); } } -- To view, visit https://gerrit.wikimedia.org/r/58703 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43f9b693d314ee63d2130da50053cfe80ffa2dbc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Daniel Werner <daniel.wer...@wikimedia.de> Gerrit-Reviewer: John Erling Blad <jeb...@gmail.com> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits