ReadableStreamTest.php 998 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace React\Tests\Stream;
  3. use React\Stream\ReadableStream;
  4. class ReadableStreamTest extends TestCase
  5. {
  6. /** @test */
  7. public function itShouldBeReadableByDefault()
  8. {
  9. $readable = new ReadableStream();
  10. $this->assertTrue($readable->isReadable());
  11. }
  12. /** @test */
  13. public function pauseShouldDoNothing()
  14. {
  15. $readable = new ReadableStream();
  16. $readable->pause();
  17. }
  18. /** @test */
  19. public function resumeShouldDoNothing()
  20. {
  21. $readable = new ReadableStream();
  22. $readable->resume();
  23. }
  24. /** @test */
  25. public function closeShouldClose()
  26. {
  27. $readable = new ReadableStream();
  28. $readable->close();
  29. $this->assertFalse($readable->isReadable());
  30. }
  31. /** @test */
  32. public function doubleCloseShouldWork()
  33. {
  34. $readable = new ReadableStream();
  35. $readable->close();
  36. $readable->close();
  37. $this->assertFalse($readable->isReadable());
  38. }
  39. }