Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/88434
Change subject: Expand integration test to use DefinitionReader ...................................................................... Expand integration test to use DefinitionReader The previous TableCreationAndDeletion test now also uses a TableDefinitionReader in its execution making sure the defintion that is read is equal to that that was initially created Change-Id: I10808c074a39a28a906f668a4260ca9abbafa25b --- R tests/integration/Schema/TableCreateReadDeleteTest.php 1 file changed, 24 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseDatabase refs/changes/34/88434/1 diff --git a/tests/integration/Schema/TableCreationAndDeletionTest.php b/tests/integration/Schema/TableCreateReadDeleteTest.php similarity index 80% rename from tests/integration/Schema/TableCreationAndDeletionTest.php rename to tests/integration/Schema/TableCreateReadDeleteTest.php index 5fc3a1f..af75ba7 100644 --- a/tests/integration/Schema/TableCreationAndDeletionTest.php +++ b/tests/integration/Schema/TableCreateReadDeleteTest.php @@ -2,25 +2,25 @@ namespace Wikibase\Database\Tests; +use Wikibase\Database\MediaWiki\MediaWikiQueryInterface; use Wikibase\Database\MediaWiki\MWTableBuilderBuilder; +use Wikibase\Database\MediaWiki\MWTableDefinitionReaderBuilder; use Wikibase\Database\Schema\Definitions\FieldDefinition; use Wikibase\Database\Schema\Definitions\IndexDefinition; use Wikibase\Database\LazyDBConnectionProvider; use Wikibase\Database\Schema\Definitions\TableDefinition; /** - * @file * @since 0.1 - * - * @ingroup WikibaseDatabaseTest * * @group Wikibase * @group WikibaseDatabase * * @licence GNU GPL v2+ * @author Jeroen De Dauw < jeroended...@gmail.com > + * @author Adam Shorland */ -class TableCreationAndDeletionTest extends \PHPUnit_Framework_TestCase { +class TableCreateReadDeleteTest extends \PHPUnit_Framework_TestCase { protected function tearDown() { parent::tearDown(); @@ -43,6 +43,19 @@ $tbBuilder = new MWTableBuilderBuilder(); return $tbBuilder->setConnection( $connectionProvider )->getTableBuilder(); + } + + protected function newTableReader() { + $connectionProvider = new LazyDBConnectionProvider( DB_MASTER ); + + $trBuilder = new MWTableDefinitionReaderBuilder(); + return $trBuilder->setConnection( $connectionProvider )->getTableDefinitionReader( $this->newQueryInterface() ); + } + + protected function newQueryInterface() { + $connectionProvider = new LazyDBConnectionProvider( DB_MASTER ); + + return new MediaWikiQueryInterface( $connectionProvider ); } public function tableProvider() { @@ -106,6 +119,13 @@ 'Table "' . $table->getName() . '" exists after creation' ); + $tableReader = $this->newTableReader(); + + $this->assertEquals( + $table, + $tableReader->readDefinition( $table->getName() ) + ); + $tableBuilder->dropTable( $table->getName() ); $this->assertFalse( -- To view, visit https://gerrit.wikimedia.org/r/88434 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10808c074a39a28a906f668a4260ca9abbafa25b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseDatabase Gerrit-Branch: master Gerrit-Owner: Addshore <addshorew...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits