| Total Complexity | 7 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class ContextTest extends TestCase |
||
| 8 | { |
||
| 9 | protected $file; |
||
| 10 | |||
| 11 | public function setup() |
||
| 12 | { |
||
| 13 | $this->file = tempnam(sys_get_temp_dir(), 'PHPUnitContext'); |
||
| 14 | $handle = fopen($this->file, 'w+'); |
||
| 15 | if (false === $handle) { |
||
| 16 | throw new \ErrorException('Failed to open file: '.$this->file); |
||
| 17 | } |
||
| 18 | foreach (range(1, 40) as $line) { |
||
| 19 | fwrite($handle, 'Line '.$line."\n"); |
||
| 20 | } |
||
| 21 | $stat = fstat($handle); |
||
| 22 | ftruncate($handle, $stat['size'] - 1); |
||
| 23 | fclose($handle); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function tearDown() |
||
| 27 | { |
||
| 28 | unlink($this->file); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testContextTop() |
||
| 35 | } |
||
| 36 | |||
| 37 | public function testContextMiddle() |
||
| 41 | } |
||
| 42 | |||
| 43 | public function testContextBottom() |
||
| 47 | } |
||
| 48 | } |
||
| 49 |