FunctionAllTestRejectedShouldReportUnhandled.phpt 486 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Calling all() with rejected promises should report unhandled rejection
  3. --INI--
  4. # suppress legacy PHPUnit 7 warning for Xdebug 3
  5. xdebug.default_enable=
  6. --FILE--
  7. <?php
  8. use function React\Promise\all;
  9. use function React\Promise\reject;
  10. require __DIR__ . '/../vendor/autoload.php';
  11. all([
  12. reject(new RuntimeException('foo')),
  13. reject(new RuntimeException('bar'))
  14. ]);
  15. ?>
  16. --EXPECTF--
  17. Unhandled promise rejection with RuntimeException: foo in %s:%d
  18. Stack trace:
  19. #0 %A{main}