X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flogging%2FNewUsersLogFormatterTest.php;h=8317e91bb2c03236a5413f36c9b30ec90d5e5265;hp=c4b52f0d983c95b2b22749dbc0247d0c17088537;hb=c368a4313b4183af56b0d566e1f7529ba997a110;hpb=8eac2feedb7ee093d2c48504e1eb2b8a9dbc8452 diff --git a/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php b/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php index c4b52f0d98..8317e91bb2 100644 --- a/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php +++ b/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php @@ -1,6 +1,7 @@ 0, 'user_text' => 'User', 'namespace' => NS_USER, - 'title' => 'UTSysop', - 'params' => [ - '4::userid' => 1, - ], + 'title' => 'UTSysop' ], [ - 'text' => 'User account UTSysop was created by User', - 'api' => [ - 'userid' => 1, - ], + 'text' => 'User account UTSysop was created by User' ], ], ]; @@ -126,6 +121,10 @@ class NewUsersLogFormatterTest extends LogFormatterTestCase { * @dataProvider provideCreate2LogDatabaseRows */ public function testCreate2LogDatabaseRows( $row, $extra ) { + // Make UTSysop user and use its user_id (sequence does not reset to 1 for postgres) + $user = static::getTestSysop()->getUser(); + $row['params']['4::userid'] = $user->getId(); + $extra['api']['userid'] = $user->getId(); $this->doTestLogFormatter( $row, $extra ); } @@ -145,16 +144,10 @@ class NewUsersLogFormatterTest extends LogFormatterTestCase { 'user' => 0, 'user_text' => 'Sysop', 'namespace' => NS_USER, - 'title' => 'UTSysop', - 'params' => [ - '4::userid' => 1, - ], + 'title' => 'UTSysop' ], [ - 'text' => 'User account UTSysop was created by Sysop and password was sent by email', - 'api' => [ - 'userid' => 1, - ], + 'text' => 'User account UTSysop was created by Sysop and password was sent by email' ], ], ]; @@ -164,6 +157,10 @@ class NewUsersLogFormatterTest extends LogFormatterTestCase { * @dataProvider provideByemailLogDatabaseRows */ public function testByemailLogDatabaseRows( $row, $extra ) { + // Make UTSysop user and use its user_id (sequence does not reset to 1 for postgres) + $user = static::getTestSysop()->getUser(); + $row['params']['4::userid'] = $user->getId(); + $extra['api']['userid'] = $user->getId(); $this->doTestLogFormatter( $row, $extra ); }