Conditions | 1 |
Paths | 1 |
Total Lines | 33 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | public function testExecuteForFalseUseData() { |
||
47 | |||
48 | $instance = new UserFieldsCreateTemplate(); |
||
49 | |||
50 | $instance->set( 'link', 'http:://example.org' ); |
||
51 | $instance->set( 'header', 'Foo' ); |
||
52 | $instance->set( 'usedomain', false ); |
||
53 | $instance->set( 'useemail', false ); |
||
54 | $instance->set( 'userealname', false ); |
||
55 | |||
56 | // MW developers are marvellous creatures |
||
57 | // QuickTemplate::msgWiki is calling `global $wgOut;` |
||
58 | |||
59 | $outputPage = $this->getMockBuilder( '\OutputPage' ) |
||
60 | ->disableOriginalConstructor() |
||
61 | ->getMock(); |
||
62 | |||
63 | $GLOBALS['wgOut'] = $outputPage; |
||
64 | |||
65 | ob_start(); |
||
66 | $instance->execute(); |
||
67 | $text = ob_get_clean(); |
||
68 | |||
69 | $this->assertInternalType( |
||
70 | 'string', |
||
71 | $text |
||
72 | ); |
||
73 | |||
74 | $this->assertContains( |
||
75 | 'http:://example.org', |
||
76 | $text |
||
77 | ); |
||
78 | } |
||
79 | |||
81 |