Daniel Werner has submitted this change and it was merged. Change subject: Use PHPUnit mocking support ......................................................................
Use PHPUnit mocking support Change-Id: Ie45f9b71bbb7b6ff9c3b21484c7be89f015696da --- M Database/tests/phpunit/TableBuilderTest.php 1 file changed, 4 insertions(+), 12 deletions(-) Approvals: Daniel Werner: Verified; Looks good to me, approved diff --git a/Database/tests/phpunit/TableBuilderTest.php b/Database/tests/phpunit/TableBuilderTest.php index c8b0a73..348135e 100644 --- a/Database/tests/phpunit/TableBuilderTest.php +++ b/Database/tests/phpunit/TableBuilderTest.php @@ -63,23 +63,15 @@ $reporter = new NullMessageReporter(); - $queryInterface = new ObservableQueryInterface(); + $queryInterface = $this->getMock( 'Wikibase\Database\QueryInterface' ); - $assertEquals = array( $this, 'assertEquals' ); - $callCount = 0; - - $queryInterface->registerCallback( - 'tableExists', - function( $tableName ) use ( $table, &$callCount, $assertEquals ) { - call_user_func( $assertEquals, $table->getName(), $tableName ); - $callCount += 1; - } - ); + $queryInterface->expects( $this->once() ) + ->method( 'tableExists' ) + ->with( $table->getName() ); $builder = new TableBuilder( $queryInterface, $reporter ); $builder->createTable( $table ); - $this->assertEquals( 1, $callCount ); } } -- To view, visit https://gerrit.wikimedia.org/r/58531 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie45f9b71bbb7b6ff9c3b21484c7be89f015696da 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> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits