From cf14306c2b3f82a81f8d56669a71633b4d4b5fce Mon Sep 17 00:00:00 2001 From: marvin-borner@live.com Date: Mon, 16 Apr 2018 21:09:05 +0200 Subject: Main merge to user management system - files are now at /main/public/ --- .../react/stream/tests/ThroughStreamTest.php | 267 --------------------- 1 file changed, 267 deletions(-) delete mode 100755 assets/php/vendor/react/stream/tests/ThroughStreamTest.php (limited to 'assets/php/vendor/react/stream/tests/ThroughStreamTest.php') diff --git a/assets/php/vendor/react/stream/tests/ThroughStreamTest.php b/assets/php/vendor/react/stream/tests/ThroughStreamTest.php deleted file mode 100755 index a98badf..0000000 --- a/assets/php/vendor/react/stream/tests/ThroughStreamTest.php +++ /dev/null @@ -1,267 +0,0 @@ -write('foo'); - - $this->assertTrue($ret); - } - - /** @test */ - public function itShouldEmitAnyDataWrittenToIt() - { - $through = new ThroughStream(); - $through->on('data', $this->expectCallableOnceWith('foo')); - $through->write('foo'); - } - - /** @test */ - public function itShouldEmitAnyDataWrittenToItPassedThruFunction() - { - $through = new ThroughStream('strtoupper'); - $through->on('data', $this->expectCallableOnceWith('FOO')); - $through->write('foo'); - } - - /** @test */ - public function itShouldEmitAnyDataWrittenToItPassedThruCallback() - { - $through = new ThroughStream('strtoupper'); - $through->on('data', $this->expectCallableOnceWith('FOO')); - $through->write('foo'); - } - - /** @test */ - public function itShouldEmitErrorAndCloseIfCallbackThrowsException() - { - $through = new ThroughStream(function () { - throw new \RuntimeException(); - }); - $through->on('error', $this->expectCallableOnce()); - $through->on('close', $this->expectCallableOnce()); - $through->on('data', $this->expectCallableNever()); - $through->on('end', $this->expectCallableNever()); - - $through->write('foo'); - - $this->assertFalse($through->isReadable()); - $this->assertFalse($through->isWritable()); - } - - /** @test */ - public function itShouldEmitErrorAndCloseIfCallbackThrowsExceptionOnEnd() - { - $through = new ThroughStream(function () { - throw new \RuntimeException(); - }); - $through->on('error', $this->expectCallableOnce()); - $through->on('close', $this->expectCallableOnce()); - $through->on('data', $this->expectCallableNever()); - $through->on('end', $this->expectCallableNever()); - - $through->end('foo'); - - $this->assertFalse($through->isReadable()); - $this->assertFalse($through->isWritable()); - } - - /** @test */ - public function itShouldReturnFalseForAnyDataWrittenToItWhenPaused() - { - $through = new ThroughStream(); - $through->pause(); - $ret = $through->write('foo'); - - $this->assertFalse($ret); - } - - /** @test */ - public function itShouldEmitDrainOnResumeAfterReturnFalseForAnyDataWrittenToItWhenPaused() - { - $through = new ThroughStream(); - $through->pause(); - $through->write('foo'); - - $through->on('drain', $this->expectCallableOnce()); - $through->resume(); - } - - /** @test */ - public function itShouldReturnTrueForAnyDataWrittenToItWhenResumedAfterPause() - { - $through = new ThroughStream(); - $through->on('drain', $this->expectCallableNever()); - $through->pause(); - $through->resume(); - $ret = $through->write('foo'); - - $this->assertTrue($ret); - } - - /** @test */ - public function pipingStuffIntoItShouldWork() - { - $readable = new ThroughStream(); - - $through = new ThroughStream(); - $through->on('data', $this->expectCallableOnceWith('foo')); - - $readable->pipe($through); - $readable->emit('data', array('foo')); - } - - /** @test */ - public function endShouldEmitEndAndClose() - { - $through = new ThroughStream(); - $through->on('data', $this->expectCallableNever()); - $through->on('end', $this->expectCallableOnce()); - $through->on('close', $this->expectCallableOnce()); - $through->end(); - } - - /** @test */ - public function endShouldCloseTheStream() - { - $through = new ThroughStream(); - $through->on('data', $this->expectCallableNever()); - $through->end(); - - $this->assertFalse($through->isReadable()); - $this->assertFalse($through->isWritable()); - } - - /** @test */ - public function endShouldWriteDataBeforeClosing() - { - $through = new ThroughStream(); - $through->on('data', $this->expectCallableOnceWith('foo')); - $through->end('foo'); - - $this->assertFalse($through->isReadable()); - $this->assertFalse($through->isWritable()); - } - - /** @test */ - public function endTwiceShouldOnlyEmitOnce() - { - $through = new ThroughStream(); - $through->on('data', $this->expectCallableOnce('first')); - $through->end('first'); - $through->end('ignored'); - } - - /** @test */ - public function writeAfterEndShouldReturnFalse() - { - $through = new ThroughStream(); - $through->on('data', $this->expectCallableNever()); - $through->end(); - - $this->assertFalse($through->write('foo')); - } - - /** @test */ - public function writeDataWillCloseStreamShouldReturnFalse() - { - $through = new ThroughStream(); - $through->on('data', array($through, 'close')); - - $this->assertFalse($through->write('foo')); - } - - /** @test */ - public function writeDataToPausedShouldReturnFalse() - { - $through = new ThroughStream(); - $through->pause(); - - $this->assertFalse($through->write('foo')); - } - - /** @test */ - public function writeDataToResumedShouldReturnTrue() - { - $through = new ThroughStream(); - $through->pause(); - $through->resume(); - - $this->assertTrue($through->write('foo')); - } - - /** @test */ - public function itShouldBeReadableByDefault() - { - $through = new ThroughStream(); - $this->assertTrue($through->isReadable()); - } - - /** @test */ - public function itShouldBeWritableByDefault() - { - $through = new ThroughStream(); - $this->assertTrue($through->isWritable()); - } - - /** @test */ - public function closeShouldCloseOnce() - { - $through = new ThroughStream(); - - $through->on('close', $this->expectCallableOnce()); - - $through->close(); - - $this->assertFalse($through->isReadable()); - $this->assertFalse($through->isWritable()); - } - - /** @test */ - public function doubleCloseShouldCloseOnce() - { - $through = new ThroughStream(); - - $through->on('close', $this->expectCallableOnce()); - - $through->close(); - $through->close(); - - $this->assertFalse($through->isReadable()); - $this->assertFalse($through->isWritable()); - } - - /** @test */ - public function pipeShouldPipeCorrectly() - { - $output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); - $output->expects($this->any())->method('isWritable')->willReturn(True); - $output - ->expects($this->once()) - ->method('write') - ->with('foo'); - - $through = new ThroughStream(); - $through->pipe($output); - $through->write('foo'); - } -} -- cgit v1.2.3