@@ 169-179 (lines=11) @@ | ||
166 | * コンソールに書き込みができること |
|
167 | * @test |
|
168 | */ |
|
169 | public function okConsoleWrite() |
|
170 | { |
|
171 | $stream = new ConsoleOutputStream(); |
|
172 | $writer = new OutputStreamWriter($stream); |
|
173 | $writer->write("test"); |
|
174 | $writer->write("test"); |
|
175 | $writer->flush(); |
|
176 | $writer->close(); |
|
177 | ||
178 | $this->expectOutputString("testtest"); |
|
179 | } |
|
180 | ||
181 | /** |
|
182 | * 正常系 |
|
@@ 186-196 (lines=11) @@ | ||
183 | * offset指定でコンソールに書き込めること |
|
184 | * @test |
|
185 | */ |
|
186 | public function okConsoleWriteOffset() |
|
187 | { |
|
188 | $stream = new ConsoleOutputStream(); |
|
189 | $writer = new OutputStreamWriter($stream); |
|
190 | $writer->write("123"); |
|
191 | $writer->write("123456", 3); |
|
192 | $writer->flush(); |
|
193 | $writer->close(); |
|
194 | ||
195 | $this->expectOutputString("123456"); |
|
196 | } |
|
197 | ||
198 | /** |
|
199 | * 正常系 |
|
@@ 203-213 (lines=11) @@ | ||
200 | * Length指定でコンソールに書き込みができること |
|
201 | * @test |
|
202 | */ |
|
203 | public function okConsoleWriteLength() |
|
204 | { |
|
205 | $stream = new ConsoleOutputStream(); |
|
206 | $writer = new OutputStreamWriter($stream); |
|
207 | $writer->write("123"); |
|
208 | $writer->write("123456789", null, 3); |
|
209 | $writer->flush(); |
|
210 | $writer->close(); |
|
211 | ||
212 | $this->expectOutputString("123123"); |
|
213 | } |
|
214 | ||
215 | /** |
|
216 | * 正常系 |
|
@@ 220-230 (lines=11) @@ | ||
217 | * Offset,Length指定でコンソールに書き込みができること |
|
218 | * @test |
|
219 | */ |
|
220 | public function okConsoleWriteOffsetLength() |
|
221 | { |
|
222 | $stream = new ConsoleOutputStream(); |
|
223 | $writer = new OutputStreamWriter($stream); |
|
224 | $writer->write("123"); |
|
225 | $writer->write("123456789", 3, 3); |
|
226 | $writer->flush(); |
|
227 | $writer->close(); |
|
228 | ||
229 | $this->expectOutputString("123456"); |
|
230 | } |
|
231 | ||
232 | /** |
|
233 | * 異常系 |