public function testConvertsToStringAndSeeksToByteZero() { $response = new tubepress_http_impl_puzzle_PuzzleBasedResponse(new puzzle_message_Response(200)); $s = new tubepress_http_impl_puzzle_streams_PuzzleBasedStream(puzzle_stream_Stream::factory('foo')); $s->read(1); $response->setBody($s); $this->assertEquals("HTTP/1.1 200 OK\r\n\r\nfoo", (string) $response); }
public function testRead() { $this->_mockDelegate->shouldReceive('read')->once()->with(44)->andReturn('xyz'); $this->assertEquals('xyz', $this->_sut->read(44)); }