set() public method

Sets the string to read from.
public set ( string $string )
$string string The string to read from.
 public function testSet()
 {
     $stream = new StringInputStream(self::LOREM_IPSUM);
     $this->assertSame("Lorem ipsum dolor sit amet,\n", $stream->readLine());
     $stream->set('Foobar');
     $this->assertSame('Foobar', $stream->readLine());
     $this->assertNull($stream->readLine());
 }
Beispiel #2
0
 public function testReadLineReturnsDefaultIfNotInteractive()
 {
     $this->stream->set(self::LOREM_IPSUM);
     $this->input->setInteractive(false);
     $this->assertSame('Default', $this->input->readLine('Default'));
 }