@@ -37,31 +37,30 @@ public function testConstructorWithExcessiveMode()
3737
3838 /**
3939 * @covers React\Stream\WritableResourceStream::__construct
40- * @expectedException InvalidArgumentException
4140 */
4241 public function testConstructorThrowsIfNotAValidStreamResource ()
4342 {
4443 $ stream = null ;
4544 $ loop = $ this ->createLoopMock ();
4645
46+ $ this ->setExpectedException ('InvalidArgumentException ' );
4747 new WritableResourceStream ($ stream , $ loop );
4848 }
4949
5050 /**
5151 * @covers React\Stream\WritableResourceStream::__construct
52- * @expectedException InvalidArgumentException
5352 */
5453 public function testConstructorThrowsExceptionOnReadOnlyStream ()
5554 {
5655 $ stream = fopen ('php://temp ' , 'r ' );
5756 $ loop = $ this ->createLoopMock ();
5857
58+ $ this ->setExpectedException ('InvalidArgumentException ' );
5959 new WritableResourceStream ($ stream , $ loop );
6060 }
6161
6262 /**
6363 * @covers React\Stream\WritableResourceStream::__construct
64- * @expectedException InvalidArgumentException
6564 */
6665 public function testConstructorThrowsExceptionOnReadOnlyStreamWithExcessiveMode ()
6766 {
@@ -71,12 +70,12 @@ public function testConstructorThrowsExceptionOnReadOnlyStreamWithExcessiveMode(
7170 unlink ($ name );
7271
7372 $ loop = $ this ->createLoopMock ();
73+ $ this ->setExpectedException ('InvalidArgumentException ' );
7474 new WritableResourceStream ($ stream , $ loop );
7575 }
7676
7777 /**
7878 * @covers React\Stream\WritableResourceStream::__construct
79- * @expectedException RuntimeException
8079 */
8180 public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking ()
8281 {
@@ -87,6 +86,7 @@ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking(
8786 $ stream = fopen ('blocking://test ' , 'r+ ' );
8887 $ loop = $ this ->createLoopMock ();
8988
89+ $ this ->setExpectedException ('RuntimeException ' );
9090 new WritableResourceStream ($ stream , $ loop );
9191 }
9292
@@ -325,6 +325,10 @@ public function testEndWithoutDataDoesNotCloseIfWritableResourceStreamIsFull()
325325 */
326326 public function testEndWithDataClosesImmediatelyIfWritableResourceStreamFlushes ()
327327 {
328+ if (defined ('HHVM_VERSION ' )) {
329+ $ this ->markTestSkipped ('Not supported on HHVM ' );
330+ }
331+
328332 $ stream = fopen ('php://temp ' , 'r+ ' );
329333 $ filterBuffer = '' ;
330334 $ loop = $ this ->createLoopMock ();
@@ -480,8 +484,8 @@ public function testErrorWhenStreamResourceIsInvalid()
480484 $ this ->assertInstanceOf ('Exception ' , $ error );
481485
482486 // the error messages differ between PHP versions, let's just check substrings
483- $ this ->assertContains ('Unable to write to stream: ' , $ error ->getMessage ());
484- $ this ->assertContains (' not a valid stream resource ' , $ error ->getMessage (), '' , true );
487+ $ this ->assertContainsString ('Unable to write to stream: ' , $ error ->getMessage ());
488+ $ this ->assertContainsStringIgnoringCase (' Not a valid stream resource ' , $ error ->getMessage ());
485489 }
486490
487491 public function testWritingToClosedStream ()
0 commit comments