This uses some reflection to identify if the data provider is static or not. If it isn't, a deprecation notice is emitted. This doesn't fail the tests, but is still printed in the output. To facilitate this, the relevant abstract method has been uncommented, as PHP does not like it when function signatures do not match up. This approach means that tests in extensions or skins do not immediately break when making data providers static. Instead, they can do so at their own pace. Bug: T332865 Change-Id: I5ff35ad0e894f0a27beae00257dc1fc599ad518d
30 lines
656 B
PHP
30 lines
656 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Auth;
|
|
|
|
/**
|
|
* @group AuthManager
|
|
* @covers \MediaWiki\Auth\CreatedAccountAuthenticationRequest
|
|
*/
|
|
class CreatedAccountAuthenticationRequestTest extends AuthenticationRequestTestCase {
|
|
|
|
protected function getInstance( array $args = [] ) {
|
|
return new CreatedAccountAuthenticationRequest( 42, 'Test' );
|
|
}
|
|
|
|
public function testConstructor() {
|
|
$ret = new CreatedAccountAuthenticationRequest( 42, 'Test' );
|
|
$this->assertSame( 42, $ret->id );
|
|
$this->assertSame( 'Test', $ret->username );
|
|
}
|
|
|
|
public static function provideLoadFromSubmission() {
|
|
return [
|
|
'Empty request' => [
|
|
[],
|
|
[],
|
|
false
|
|
],
|
|
];
|
|
}
|
|
}
|