mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Drop old PHPUnit rudiments
Change-Id: I0a69ee7826227ee195415e43dc688f76602ed02b
This commit is contained in:
parent
1901505cc3
commit
031e6d37bf
|
@ -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'] ) );
|
||||
|
|
|
@ -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'] ) );
|
||||
|
|
|
@ -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'] ) );
|
||||
|
|
|
@ -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'] ) );
|
||||
|
|
Loading…
Reference in a new issue