| @@ 91-99 (lines=9) @@ | ||
| 88 | if ($sql === false) { |
|
| 89 | $this->fail("could not open $path"); |
|
| 90 | } |
|
| 91 | foreach (preg_split('/^-- test .*$/m', $sql) as $pair) { |
|
| 92 | if (trim($pair) != '') { |
|
| 93 | list($text, $expected) = preg_split('/(?<=;)/', $pair); |
|
| 94 | $tests[] = [ |
|
| 95 | trim($text), |
|
| 96 | trim($expected) |
|
| 97 | ]; |
|
| 98 | } |
|
| 99 | } |
|
| 100 | } |
|
| 101 | ||
| 102 | return $tests; |
|
| @@ 147-156 (lines=10) @@ | ||
| 144 | if ($sql === false) { |
|
| 145 | $this->fail("could not open $path"); |
|
| 146 | } |
|
| 147 | foreach (preg_split('/^-- test .*$/m', $sql) as $pair) { |
|
| 148 | if (trim($pair) != '') { |
|
| 149 | list($firstText, $secondText, $expected) = preg_split('/(?<=;)/', $pair); |
|
| 150 | $tests[] = [ |
|
| 151 | trim($firstText), |
|
| 152 | trim($secondText), |
|
| 153 | trim($expected) |
|
| 154 | ]; |
|
| 155 | } |
|
| 156 | } |
|
| 157 | } |
|
| 158 | ||
| 159 | return $tests; |
|