| Línea 70... |
Línea 70... |
| 70 |
* @dataProvider profiling_string_matches_provider
|
70 |
* @dataProvider profiling_string_matches_provider
|
| 71 |
* @param string $string
|
71 |
* @param string $string
|
| 72 |
* @param string $patterns
|
72 |
* @param string $patterns
|
| 73 |
* @param bool $expected
|
73 |
* @param bool $expected
|
| 74 |
*/
|
74 |
*/
|
| 75 |
public function test_profiling_string_matches($string, $patterns, $expected) {
|
75 |
public function test_profiling_string_matches($string, $patterns, $expected): void {
|
| 76 |
$result = profiling_string_matches($string, $patterns);
|
76 |
$result = profiling_string_matches($string, $patterns);
|
| 77 |
$this->assertSame($result, $expected);
|
77 |
$this->assertSame($result, $expected);
|
| 78 |
}
|
78 |
}
|
| Línea 79... |
Línea 79... |
| 79 |
|
79 |
|
| Línea 171... |
Línea 171... |
| 171 |
* @dataProvider run_data_provider
|
171 |
* @dataProvider run_data_provider
|
| 172 |
*
|
172 |
*
|
| 173 |
* @param array $rundata The run data to be sorted.
|
173 |
* @param array $rundata The run data to be sorted.
|
| 174 |
* @param array $expectations The expected results.
|
174 |
* @param array $expectations The expected results.
|
| 175 |
*/
|
175 |
*/
|
| 176 |
public function test_xhprof_topo_sort(array $rundata, array $expectations) {
|
176 |
public function test_xhprof_topo_sort(array $rundata, array $expectations): void {
|
| 177 |
// Make sure all the examples in the provider are the same size.
|
177 |
// Make sure all the examples in the provider are the same size.
|
| 178 |
$this->assertSame($expectations['topocount'], count($rundata));
|
178 |
$this->assertSame($expectations['topocount'], count($rundata));
|
| Línea 179... |
Línea 179... |
| 179 |
|
179 |
|
| 180 |
// Make moodle_xhprofrun::xhprof_topo_sort() accessible.
|
180 |
// Make moodle_xhprofrun::xhprof_topo_sort() accessible.
|
| Línea 215... |
Línea 215... |
| 215 |
* @dataProvider run_data_provider
|
215 |
* @dataProvider run_data_provider
|
| 216 |
*
|
216 |
*
|
| 217 |
* @param array $rundata The run data to be reduced.
|
217 |
* @param array $rundata The run data to be reduced.
|
| 218 |
* @param array $expectations The expected results.
|
218 |
* @param array $expectations The expected results.
|
| 219 |
*/
|
219 |
*/
|
| 220 |
public function test_reduce_run_data(array $rundata, array $expectations) {
|
220 |
public function test_reduce_run_data(array $rundata, array $expectations): void {
|
| 221 |
// Make sure that the expected keys that will be removed are present.
|
221 |
// Make sure that the expected keys that will be removed are present.
|
| 222 |
foreach ($expectations['reduceremoved'] as $key) {
|
222 |
foreach ($expectations['reduceremoved'] as $key) {
|
| 223 |
$this->assertArrayHasKey($key, $rundata);
|
223 |
$this->assertArrayHasKey($key, $rundata);
|
| 224 |
}
|
224 |
}
|