Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 | } |
||
49 |