MediaWiki
REL1_31
ParserIntegrationTest.php
Go to the documentation of this file.
1
<?php
2
use Wikimedia\ScopedCallback;
3
30
class
ParserIntegrationTest
extends
PHPUnit\Framework\TestCase {
31
32
use MediaWikiCoversValidator;
33
35
private
$ptTest
;
36
38
private
$ptRunner
;
39
41
private
$ptTeardownScope
;
42
43
public
function
__construct
( $runner, $fileName, $test ) {
44
parent::__construct(
'testParse'
, [
'[details omitted]'
],
45
basename( $fileName ) .
': '
. $test[
'desc'
] );
46
$this->ptTest = $test;
47
$this->ptRunner = $runner;
48
}
49
50
public
function
testParse
() {
51
$this->ptRunner->getRecorder()->setTestCase( $this );
52
$result = $this->ptRunner->runTest( $this->ptTest );
53
$this->assertEquals( $result->expected, $result->actual );
54
}
55
56
public
function
setUp
() {
57
$this->ptTeardownScope = $this->ptRunner->staticSetup();
58
}
59
60
public
function
tearDown
() {
61
if
( $this->ptTeardownScope ) {
62
ScopedCallback::consume( $this->ptTeardownScope );
63
}
64
}
65
}
ParserIntegrationTest
This is the TestCase subclass for running a single parser test via the ParserTestRunner integration t...
Definition
ParserIntegrationTest.php:30
ParserIntegrationTest\setUp
setUp()
Definition
ParserIntegrationTest.php:56
ParserIntegrationTest\$ptRunner
ParserTestRunner $ptRunner
Definition
ParserIntegrationTest.php:38
ParserIntegrationTest\testParse
testParse()
Definition
ParserIntegrationTest.php:50
ParserIntegrationTest\__construct
__construct( $runner, $fileName, $test)
Definition
ParserIntegrationTest.php:43
ParserIntegrationTest\tearDown
tearDown()
Definition
ParserIntegrationTest.php:60
ParserIntegrationTest\$ptTest
array $ptTest
Definition
ParserIntegrationTest.php:35
ParserIntegrationTest\$ptTeardownScope
ScopedCallback $ptTeardownScope
Definition
ParserIntegrationTest.php:41
ParserTestRunner
Definition
ParserTestRunner.php:36
tests
phpunit
includes
parser
ParserIntegrationTest.php
Generated on Mon Nov 25 2024 15:36:30 for MediaWiki by
1.10.0