@@ -182,10 +182,7 @@ function testDisabledDeferReenableInSubsequentTick() {
182182 });
183183 }
184184
185- /**
186- * @expectedException InvalidWatcherException
187- */
188- function testExceptionOnDeferWatcherIdReuse () {
185+ function testSuccessOnDeferWatcherIdReuse () {
189186 $ this ->start (function (Driver $ loop ) {
190187 $ watcherId = $ loop ->defer (function ($ watcherId ) use ($ loop ) {
191188 $ loop ->disable ($ watcherId );
@@ -303,7 +300,6 @@ function testWatcherReferenceInfo($type, $args) {
303300
304301 /**
305302 * @dataProvider provideRegistrationArgs
306- * @expectedException InvalidWatcherException
307303 */
308304 function testWatcherRegistrationAndCancellationInfo ($ type , $ args ) {
309305 if ($ type === "onSignal " ) {
@@ -362,8 +358,13 @@ function testWatcherRegistrationAndCancellationInfo($type, $args) {
362358 $ expected = ["enabled " => 0 , "disabled " => 0 ];
363359 $ this ->assertSame ($ expected , $ info [$ type ]);
364360
365- // invoke cancel() again to ensure it fails
361+ // invoke watcher control ops again to ensure they succeed
366362 $ loop ->cancel ($ watcherId );
363+ $ loop ->disable ($ watcherId );
364+ $ loop ->enable ($ watcherId );
365+ $ info = $ loop ->info ();
366+ $ expected = ["enabled " => 0 , "disabled " => 0 ];
367+ $ this ->assertSame ($ expected , $ info [$ type ]);
367368 }
368369
369370 /**
@@ -480,24 +481,15 @@ function testNoMemoryLeak($type, $args) {
480481 });
481482 }
482483
483- /**
484- * @expectedException InvalidWatcherException
485- */
486- function testExceptionOnEnableNonexistentWatcher () {
484+ function testSuccessOnEnableNonexistentWatcher () {
487485 $ this ->loop ->enable ("nonexistentWatcher " );
488486 }
489487
490- /**
491- * @expectedException InvalidWatcherException
492- */
493- function testExceptionOnDisableNonexistentWatcher () {
488+ function testSuccessOnDisableNonexistentWatcher () {
494489 $ this ->loop ->disable ("nonexistentWatcher " );
495490 }
496491
497- /**
498- * @expectedException InvalidWatcherException
499- */
500- function testExceptionOnCancelNonexistentWatcher () {
492+ function testSuccessOnCancelNonexistentWatcher () {
501493 $ this ->loop ->cancel ("nonexistentWatcher " );
502494 }
503495
0 commit comments