MediaWiki
REL1_34
HooksTest.php
Go to the documentation of this file.
1
<?php
2
3
class
ScribuntoHooksTest
extends
PHPUnit\Framework\TestCase {
4
use MediaWikiCoversValidator;
5
use PHPUnit4And6Compat;
6
7
public
function
provideContentHandlerDefaultModelFor
() {
8
return
[
9
[
'Module:Foo'
, CONTENT_MODEL_SCRIBUNTO,
true
],
10
[
'Module:Foo/doc'
,
null
,
true
],
11
[
'Module:Foo/styles.css'
,
'sanitized-css'
,
true
,
'sanitized-css'
],
12
[
'Main Page'
,
null
,
true
],
13
];
14
}
15
20
public
function
testContentHandlerDefaultModelFor
( $name, $expected,
21
$retVal, $before =
null
22
) {
23
$title
= Title::newFromText( $name );
24
$model = $before;
25
$ret =
ScribuntoHooks::contentHandlerDefaultModelFor
(
$title
, $model );
26
$this->assertSame( $retVal, $ret );
27
$this->assertSame( $expected, $model );
28
}
29
}
ScribuntoHooksTest
Definition
HooksTest.php:3
ScribuntoHooksTest\testContentHandlerDefaultModelFor
testContentHandlerDefaultModelFor( $name, $expected, $retVal, $before=null)
@covers ScribuntoHooks::contentHandlerDefaultModelFor @dataProvider provideContentHandlerDefaultModel...
Definition
HooksTest.php:20
ScribuntoHooksTest\provideContentHandlerDefaultModelFor
provideContentHandlerDefaultModelFor()
Definition
HooksTest.php:7
ScribuntoHooks\contentHandlerDefaultModelFor
static contentHandlerDefaultModelFor(Title $title, &$model)
Set the Scribunto content handler for modules.
Definition
Hooks.php:263
true
return true
Definition
router.php:94
$title
$title
Definition
testCompression.php:34
extensions
Scribunto
tests
phpunit
common
HooksTest.php
Generated on Mon Nov 25 2024 16:04:43 for MediaWiki by
1.10.0