1 | <?php |
||
47 | abstract class AbstractTest extends \PHPUnit_Framework_TestCase |
||
48 | { |
||
49 | /** |
||
50 | * Temporary files |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $tmpFiles = []; |
||
55 | /** |
||
56 | * Temporary directories |
||
57 | * |
||
58 | * @var array |
||
59 | */ |
||
60 | protected $tmpDirectories = []; |
||
61 | /** |
||
62 | * This method is called before the first test of this test class is run. |
||
63 | */ |
||
64 | public static function setUpBeforeClass() |
||
68 | |||
69 | /** |
||
70 | * Tests if two arrays equal in their keys and values |
||
71 | * |
||
72 | * @param array $expected Expected result |
||
73 | * @param array $actual Actual result |
||
74 | * @param string $message Message |
||
75 | */ |
||
76 | public function assertArrayEquals(array $expected, array $actual, $message = '') |
||
84 | |||
85 | /** |
||
86 | * Recursively sort an array for comparison with another array |
||
87 | * |
||
88 | * @param array $array Array |
||
89 | * @return array Sorted array |
||
90 | */ |
||
91 | protected function sortArrayForComparison(array $array) |
||
135 | |||
136 | /** |
||
137 | * Recursively sort an array for comparison |
||
138 | * |
||
139 | * @param array $array Original array |
||
140 | * @return array Sorted array |
||
141 | */ |
||
142 | protected function sortArrayRecursive(array $array) |
||
155 | |||
156 | /** |
||
157 | * Tears down the fixture |
||
158 | */ |
||
159 | protected function tearDown() |
||
168 | |||
169 | /** |
||
170 | * Prepare and register a temporary file name |
||
171 | * |
||
172 | * @return string Temporary file name |
||
173 | */ |
||
174 | protected function createTemporaryFileName() |
||
180 | |||
181 | /** |
||
182 | * Prepare and register a temporary file |
||
183 | * |
||
184 | * @return string Temporary file name |
||
185 | */ |
||
186 | protected function createTemporaryFile() |
||
190 | |||
191 | /** |
||
192 | * Register a temporary directory that needs to be deleted recursively on shutdown |
||
193 | * |
||
194 | * @param string $directory Directory |
||
195 | * @return string Directory |
||
196 | */ |
||
197 | protected function registerTemporaryDirectory($directory) |
||
201 | |||
202 | /** |
||
203 | * Scan a temporary directory and register all files and subdirectories (recursively) |
||
204 | * |
||
205 | * @param string $directory Directory |
||
206 | */ |
||
207 | protected function scanTemporaryDirectory($directory) |
||
219 | |||
220 | /** |
||
221 | * Normalize HTML contents |
||
222 | * |
||
223 | * @param string $html Original HTML |
||
224 | * @return string Normalized HTML |
||
225 | */ |
||
226 | protected function normalizeHtml($html) |
||
234 | } |
||
235 |