Kraken\_Unit\Stream\StreamWriterTest::testApiWrite_WritesDataCorrectly PHP Method

testApiWrite_WritesDataCorrectly() public method

    public function testApiWrite_WritesDataCorrectly()
    {
        $stream = $this->createStreamMock();
        $resource = $stream->getResource();
        $expectedData = "foobar\n";
        $capturedData = null;
        $stream->on('drain', $this->expectCallableOnce());
        $stream->write($expectedData);
        $stream->rewind();
        $this->assertSame($expectedData, fread($resource, $stream->getBufferSize()));
    }