mediawiki-extensions-Scribunto/tests/phpunit/common/HooksTest.php
Amir Sarabadani 167e4cb60f Clean up most of b/c for phpunit4
We don't support phpunit4 anymore:
https://w.wiki/9UT

Change-Id: I13a4a09e21a13c8f1e29b9e0ca29f05d1eac997d
2019-10-06 00:11:37 +02:00

29 lines
815 B
PHP

<?php
class ScribuntoHooksTest extends PHPUnit\Framework\TestCase {
use MediaWikiCoversValidator;
public function provideContentHandlerDefaultModelFor() {
return [
[ 'Module:Foo', CONTENT_MODEL_SCRIBUNTO, true ],
[ 'Module:Foo/doc', null, true ],
[ 'Module:Foo/styles.css', 'sanitized-css', true, 'sanitized-css' ],
[ 'Main Page', null, true ],
];
}
/**
* @covers ScribuntoHooks::contentHandlerDefaultModelFor
* @dataProvider provideContentHandlerDefaultModelFor
*/
public function testContentHandlerDefaultModelFor( $name, $expected,
$retVal, $before = null
) {
$title = Title::newFromText( $name );
$model = $before;
$ret = ScribuntoHooks::contentHandlerDefaultModelFor( $title, $model );
$this->assertSame( $retVal, $ret );
$this->assertSame( $expected, $model );
}
}