@@ 112-121 (lines=10) @@ | ||
109 | * @covers TextFile\Walker\SimpleWalker::goBeforeCharacter |
|
110 | * @expectedException \TextFile\Exception\OutOfBoundsException |
|
111 | */ |
|
112 | public function testGoBeforeCharacterTooLow() |
|
113 | { |
|
114 | $filePath = $this->createTestFileFromFixtures('simple_multiline_file.txt'); |
|
115 | ||
116 | $file = new \SplFileObject($filePath, 'r+'); |
|
117 | ||
118 | $walker = new SimpleWalker(); |
|
119 | ||
120 | $walker->goBeforeCharacter($file, -1); |
|
121 | } |
|
122 | ||
123 | /** |
|
124 | * @covers TextFile\Walker\SimpleWalker::goBeforeCharacter |
|
@@ 127-136 (lines=10) @@ | ||
124 | * @covers TextFile\Walker\SimpleWalker::goBeforeCharacter |
|
125 | * @expectedException \TextFile\Exception\OutOfBoundsException |
|
126 | */ |
|
127 | public function testGoBeforeCharacterTooHigh() |
|
128 | { |
|
129 | $filePath = $this->createTestFileFromFixtures('simple_multiline_file.txt'); |
|
130 | ||
131 | $file = new \SplFileObject($filePath, 'r+'); |
|
132 | ||
133 | $walker = new SimpleWalker(); |
|
134 | ||
135 | $walker->goBeforeCharacter($file, $file->getSize() + 1); |
|
136 | } |
|
137 | } |
|
138 |
@@ 73-83 (lines=11) @@ | ||
70 | * |
|
71 | * @expectedException \TextFile\Exception\OutOfBoundsException |
|
72 | */ |
|
73 | public function testGetNextLineContentOutOfBounds() |
|
74 | { |
|
75 | $reader = new SimpleReader(new SimpleWalker()); |
|
76 | ||
77 | $filePath = $this->createTestFileFromFixtures('complex_multiline_file.txt'); |
|
78 | $file = new \SplFileObject($filePath, 'r+'); |
|
79 | ||
80 | $file->seek(5); |
|
81 | ||
82 | $reader->getNextLineContent($file); |
|
83 | } |
|
84 | ||
85 | /** |
|
86 | * @covers TextFile\Reader\SimpleReader::getPreviousLineContent |
|
@@ 109-119 (lines=11) @@ | ||
106 | * |
|
107 | * @expectedException \TextFile\Exception\OutOfBoundsException |
|
108 | */ |
|
109 | public function testGetPreviousLineContentOutOfBounds() |
|
110 | { |
|
111 | $reader = new SimpleReader(new SimpleWalker()); |
|
112 | ||
113 | $filePath = $this->createTestFileFromFixtures('complex_multiline_file.txt'); |
|
114 | $file = new \SplFileObject($filePath, 'r+'); |
|
115 | ||
116 | $file->seek(0); |
|
117 | ||
118 | $reader->getPreviousLineContent($file); |
|
119 | } |
|
120 | ||
121 | /** |
|
122 | * @covers TextFile\Reader\SimpleReader::getCurrentLineContent |