Merge "UserNotificationGatewayTest: Mock User objects"

This commit is contained in:
jenkins-bot 2020-10-07 19:50:41 +00:00 committed by Gerrit Code Review
commit e76c0b23a9

View file

@ -10,7 +10,7 @@ class EchoUserNotificationGatewayTest extends MediaWikiUnitTestCase {
public function testMarkRead() { public function testMarkRead() {
// no event ids to mark // no event ids to mark
$gateway = new EchoUserNotificationGateway( $gateway = new EchoUserNotificationGateway(
User::newFromId( 1 ), $this->mockUser(),
$this->mockMWEchoDbFactory(), $this->mockMWEchoDbFactory(),
$this->mockConfig() $this->mockConfig()
); );
@ -18,7 +18,7 @@ class EchoUserNotificationGatewayTest extends MediaWikiUnitTestCase {
// successful update // successful update
$gateway = new EchoUserNotificationGateway( $gateway = new EchoUserNotificationGateway(
User::newFromId( 1 ), $this->mockUser(),
$this->mockMWEchoDbFactory( [ 'update' => true ] ), $this->mockMWEchoDbFactory( [ 'update' => true ] ),
$this->mockConfig() $this->mockConfig()
); );
@ -26,7 +26,7 @@ class EchoUserNotificationGatewayTest extends MediaWikiUnitTestCase {
// unsuccessful update // unsuccessful update
$gateway = new EchoUserNotificationGateway( $gateway = new EchoUserNotificationGateway(
User::newFromId( 1 ), $this->mockUser(),
$this->mockMWEchoDbFactory( [ 'update' => false ] ), $this->mockMWEchoDbFactory( [ 'update' => false ] ),
$this->mockConfig() $this->mockConfig()
); );
@ -36,7 +36,7 @@ class EchoUserNotificationGatewayTest extends MediaWikiUnitTestCase {
public function testMarkAllRead() { public function testMarkAllRead() {
// successful update // successful update
$gateway = new EchoUserNotificationGateway( $gateway = new EchoUserNotificationGateway(
User::newFromId( 1 ), $this->mockUser(),
$this->mockMWEchoDbFactory( [ 'update' => true ] ), $this->mockMWEchoDbFactory( [ 'update' => true ] ),
$this->mockConfig() $this->mockConfig()
); );
@ -44,7 +44,7 @@ class EchoUserNotificationGatewayTest extends MediaWikiUnitTestCase {
// null update // null update
$gateway = new EchoUserNotificationGateway( $gateway = new EchoUserNotificationGateway(
User::newFromId( 1 ), $this->mockUser(),
$this->mockMWEchoDbFactory( [ 'update' => false ] ), $this->mockMWEchoDbFactory( [ 'update' => false ] ),
$this->mockConfig() $this->mockConfig()
); );