Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/149239
Change subject: Remove dead code ...................................................................... Remove dead code Change-Id: Iaeba1c3b90127de7b9b1a468e2252be6a212cf3f --- M lib/tests/phpunit/entity/EntityFactoryTest.php D lib/tests/phpunit/entity/EntityTestCase.php M lib/tests/phpunit/store/EntityContentDataCodecTest.php 3 files changed, 2 insertions(+), 55 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/39/149239/1 diff --git a/lib/tests/phpunit/entity/EntityFactoryTest.php b/lib/tests/phpunit/entity/EntityFactoryTest.php index 86dbb56..2586872 100644 --- a/lib/tests/phpunit/entity/EntityFactoryTest.php +++ b/lib/tests/phpunit/entity/EntityFactoryTest.php @@ -17,7 +17,7 @@ * @author Jeroen De Dauw < [email protected] > * @author Daniel Kinzler */ -class EntityFactoryTest extends EntityTestCase { +class EntityFactoryTest extends \MediaWikiTestCase { public function testGetEntityTypes() { $types = EntityFactory::singleton()->getEntityTypes(); diff --git a/lib/tests/phpunit/entity/EntityTestCase.php b/lib/tests/phpunit/entity/EntityTestCase.php deleted file mode 100644 index 87d7618..0000000 --- a/lib/tests/phpunit/entity/EntityTestCase.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Wikibase\Test; - -use Wikibase\DataModel\Entity\Entity; - -/** - * Base class for tests that have to inspect entity structures. - * - * @since 0.3 - * - * @licence GNU GPL v2+ - * @author Daniel Kinzler - */ -abstract class EntityTestCase extends \MediaWikiTestCase { - - /** - * @param Entity|array $expected - * @param Entity|array $actual - * @param String|null $message - */ - protected function assertEntityStructureEquals( $expected, $actual, $message = null ) { - if ( $expected instanceof Entity ) { - $expected = $expected->toArray(); - } - - if ( $actual instanceof Entity ) { - $actual = $actual->toArray(); - } - - $keys = array_unique( array_merge( - array_keys( $expected ), - array_keys( $actual ) ) ); - - foreach ( $keys as $k ) { - if ( empty( $expected[ $k ] ) ) { - if ( !empty( $actual[ $k ] ) ) { - $this->fail( "$k should be empty; $message" ); - } - } else { - if ( empty( $actual[ $k ] ) ) { - $this->fail( "$k should not be empty; $message" ); - } - - if ( is_array( $expected[ $k ] ) && is_array( $actual[ $k ] ) ) { - $this->assertArrayEquals( $expected[ $k ], $actual[ $k ], false, true ); - } else { - $this->assertEquals( $expected[ $k ], $actual[ $k ], "field $k" ); - } - } - } - } -} diff --git a/lib/tests/phpunit/store/EntityContentDataCodecTest.php b/lib/tests/phpunit/store/EntityContentDataCodecTest.php index f799976..7c1b6dd 100644 --- a/lib/tests/phpunit/store/EntityContentDataCodecTest.php +++ b/lib/tests/phpunit/store/EntityContentDataCodecTest.php @@ -24,7 +24,7 @@ * @licence GNU GPL v2+ * @author Daniel Kinzler */ -class EntityContentDataCodecTest extends EntityTestCase { +class EntityContentDataCodecTest extends \MediaWikiTestCase { /** * @var EntityContentDataCodec -- To view, visit https://gerrit.wikimedia.org/r/149239 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaeba1c3b90127de7b9b1a468e2252be6a212cf3f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
