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 | /** |
||
63 | * This method is called before the first test of this test class is run. |
||
64 | */ |
||
65 | public static function setUpBeforeClass() |
||
69 | |||
70 | /** |
||
71 | * Tests if two arrays equal in their keys and values |
||
72 | * |
||
73 | * @param array $expected Expected result |
||
74 | * @param array $actual Actual result |
||
75 | * @param string $message Message |
||
76 | */ |
||
77 | public function assertArrayEquals(array $expected, array $actual, $message = '') |
||
85 | |||
86 | /** |
||
87 | * Recursively sort an array for comparison with another array |
||
88 | * |
||
89 | * @param array $array Array |
||
90 | * @return array Sorted array |
||
91 | */ |
||
92 | protected function sortArrayForComparison(array $array) |
||
136 | |||
137 | /** |
||
138 | * Recursively sort an array for comparison |
||
139 | * |
||
140 | * @param array $array Original array |
||
141 | * @return array Sorted array |
||
142 | */ |
||
143 | protected function sortArrayRecursive(array $array) |
||
156 | |||
157 | /** |
||
158 | * Tears down the fixture |
||
159 | */ |
||
160 | protected function tearDown() |
||
169 | |||
170 | /** |
||
171 | * Scan a temporary directory and register all files and subdirectories (recursively) |
||
172 | * |
||
173 | * @param string $directory Directory |
||
174 | */ |
||
175 | protected function scanTemporaryDirectory($directory) |
||
187 | |||
188 | /** |
||
189 | * Prepare and register a temporary file name |
||
190 | * |
||
191 | * @return string Temporary file name |
||
192 | */ |
||
193 | protected function createTemporaryFileName() |
||
199 | |||
200 | /** |
||
201 | * Prepare and register a temporary file |
||
202 | * |
||
203 | * @return string Temporary file name |
||
204 | */ |
||
205 | protected function createTemporaryFile() |
||
209 | |||
210 | /** |
||
211 | * Register a temporary directory that needs to be deleted recursively on shutdown |
||
212 | * |
||
213 | * @param string $directory Directory |
||
214 | * @return string Directory |
||
215 | */ |
||
216 | protected function registerTemporaryDirectory($directory) |
||
220 | |||
221 | /** |
||
222 | * Normalize HTML contents |
||
223 | * |
||
224 | * @param string $html Original HTML |
||
225 | * @return string Normalized HTML |
||
226 | */ |
||
227 | protected function normalizeHtml($html) |
||
235 | } |
||
236 |