Drop old PHPUnit rudiments

Change-Id: I0a69ee7826227ee195415e43dc688f76602ed02b
This commit is contained in:
Max Semenik 2019-10-04 20:54:45 -07:00
parent 1901505cc3
commit 031e6d37bf
4 changed files with 14 additions and 6 deletions

View file

@ -1,5 +1,7 @@
<?php
use Wikimedia\Rdbms\IDatabase;
/**
* @group Database
* @covers EchoEventMapper
@ -102,7 +104,7 @@ class EchoEventMapperTest extends MediaWikiTestCase {
}
/**
* @return \Wikimedia\Rdbms\IDatabase
* @return IDatabase
*/
protected function mockDb( array $dbResult ) {
$dbResult += [
@ -111,7 +113,7 @@ class EchoEventMapperTest extends MediaWikiTestCase {
'select' => '',
'selectRow' => ''
];
$db = $this->getMock( IDatabase::class );
$db = $this->createMock( IDatabase::class );
$db->expects( $this->any() )
->method( 'insert' )
->will( $this->returnValue( $dbResult['insert'] ) );

View file

@ -1,5 +1,7 @@
<?php
use Wikimedia\Rdbms\IDatabase;
/**
* @covers EchoNotificationMapper
*/
@ -128,7 +130,7 @@ class EchoNotificationMapperTest extends MediaWikiTestCase {
public function testDeleteByUserEventOffset() {
$this->setMwGlobals( [ 'wgUpdateRowsPerQuery' => 4 ] );
$mockDb = $this->getMock( IDatabase::class );
$mockDb = $this->createMock( IDatabase::class );
$makeResultRows = function ( $eventIds ) {
return new ArrayIterator( array_map( function ( $eventId ) {
return (object)[ 'notification_event' => $eventId ];
@ -256,7 +258,7 @@ class EchoNotificationMapperTest extends MediaWikiTestCase {
'delete' => ''
];
$db = $this->getMock( IDatabase::class );
$db = $this->createMock( IDatabase::class );
$db->expects( $this->any() )
->method( 'insert' )
->will( $this->returnValue( $dbResult['insert'] ) );

View file

@ -1,5 +1,7 @@
<?php
use Wikimedia\Rdbms\IDatabase;
/**
* @covers EchoUserNotificationGateway
*/
@ -156,7 +158,7 @@ class EchoUserNotificationGatewayTest extends MediaWikiUnitTestCase {
'selectRow' => '',
'selectRowCount' => '',
];
$db = $this->getMock( IDatabase::class );
$db = $this->createMock( IDatabase::class );
$db->expects( $this->any() )
->method( 'update' )
->will( $this->returnValue( $dbResult['update'] ) );

View file

@ -1,5 +1,7 @@
<?php
use Wikimedia\Rdbms\IDatabase;
/**
* @covers EchoTargetPageMapper
*/
@ -74,7 +76,7 @@ class EchoTargetPageMapperTest extends MediaWikiUnitTestCase {
'select' => '',
'delete' => ''
];
$db = $this->getMock( IDatabase::class );
$db = $this->createMock( IDatabase::class );
$db->expects( $this->any() )
->method( 'insert' )
->will( $this->returnValue( $dbResult['insert'] ) );