-
Notifications
You must be signed in to change notification settings - Fork 12
/
XTestCase.php
104 lines (96 loc) · 2.93 KB
/
XTestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
namespace Yoast\PHPUnitPolyfills\TestCases;
use PHPUnit\Framework\TestCase as PHPUnit_TestCase;
use Yoast\PHPUnitPolyfills\Helpers\AssertAttributeHelper;
use Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource;
use Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations;
use Yoast\PHPUnitPolyfills\Polyfills\AssertFileDirectory;
use Yoast\PHPUnitPolyfills\Polyfills\AssertFileEqualsSpecializations;
use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames;
use Yoast\PHPUnitPolyfills\Polyfills\AssertIsType;
use Yoast\PHPUnitPolyfills\Polyfills\AssertNumericType;
use Yoast\PHPUnitPolyfills\Polyfills\AssertObjectEquals;
use Yoast\PHPUnitPolyfills\Polyfills\AssertObjectProperty;
use Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains;
use Yoast\PHPUnitPolyfills\Polyfills\EqualToSpecializations;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionMessageMatches;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionObject;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectPHPException;
/**
* Basic test case for use with PHPUnit cross-version.
*
* This test case uses renamed methods for the `setUpBeforeClass()`, `setUp()`, `tearDown()`
* and `tearDownAfterClass()` methods to get round the signature change in PHPUnit 8.
*
* When using this TestCase, overloaded fixture methods need to use the `@beforeClass`, `@before`,
* `@after` and `@afterClass` annotations.
* The naming of the overloaded methods is open as long as the method names don't conflict with
* the PHPUnit native method names.
*/
abstract class XTestCase extends PHPUnit_TestCase {
use AssertAttributeHelper;
use AssertClosedResource;
use AssertEqualsSpecializations;
use AssertFileDirectory;
use AssertFileEqualsSpecializations;
use AssertionRenames;
use AssertIsType;
use AssertNumericType;
use AssertObjectEquals;
use AssertObjectProperty;
use AssertStringContains;
use EqualToSpecializations;
use ExpectException;
use ExpectExceptionMessageMatches;
use ExpectExceptionObject;
use ExpectPHPException;
/**
* This method is called before the first test of this test class is run.
*
* @beforeClass
*
* @codeCoverageIgnore
*
* @return void
*/
public static function setUpFixturesBeforeClass() {
parent::setUpBeforeClass();
}
/**
* Sets up the fixture, for example, open a network connection.
*
* This method is called before each test.
*
* @before
*
* @return void
*/
protected function setUpFixtures() {
parent::setUp();
}
/**
* Tears down the fixture, for example, close a network connection.
*
* This method is called after each test.
*
* @after
*
* @return void
*/
protected function tearDownFixtures() {
parent::tearDown();
}
/**
* This method is called after the last test of this test class is run.
*
* @afterClass
*
* @codeCoverageIgnore
*
* @return void
*/
public static function tearDownFixturesAfterClass() {
parent::tearDownAfterClass();
}
}