if ( !$this->hasValidType( $value ) ) {
throw new InvalidArgumentException(
'Can only add ' . $this->getObjectType() . ' implementing objects to '
- . get_called_class() . '.'
+ . static::class . '.'
);
}
// Complain if self::setUp() was called, but not self::tearDown()
// $this->called['setUp'] will be checked by self::testMediaWikiTestCaseParentSetupCalled()
if ( isset( $this->called['setUp'] ) && !isset( $this->called['tearDown'] ) ) {
- throw new MWException( get_called_class() . "::tearDown() must call parent::tearDown()" );
+ throw new MWException( static::class . "::tearDown() must call parent::tearDown()" );
}
}
*/
final public function testMediaWikiTestCaseParentSetupCalled() {
$this->assertArrayHasKey( 'setUp', $this->called,
- get_called_class() . "::setUp() must call parent::setUp()"
+ static::class . '::setUp() must call parent::setUp()'
);
}
class DummyAction extends Action {
public function getName() {
- return get_called_class();
+ return static::class;
}
public function show() {
*/
protected function setUp() {
parent::setUp();
- $found = preg_match( '/Language(.+)Test/', get_called_class(), $m );
+ $found = preg_match( '/Language(.+)Test/', static::class, $m );
if ( $found ) {
# Normalize language code since classes uses underscores
$m[1] = strtolower( str_replace( '_', '-', $m[1] ) );
# Fallback to english language
$m[1] = 'en';
wfDebug(
- __METHOD__ . " could not extract a language name "
- . "out of " . get_called_class() . " failling back to 'en'\n"
+ __METHOD__ . ' could not extract a language name '
+ . 'out of ' . static::class . " failling back to 'en'\n"
);
}
// @todo validate $m[1] which should be a valid language code