Skip to content

Releases: amphp/phpunit-util

2.0.1

19 Sep 05:55
v2.0.1
0411285
Compare
Choose a tag to compare

What's Changed

  • Fix implicitly nullable parameter for PHP 8.4 compatibility by @GromNaN in #24

New Contributors

Full Changelog: v2.0.0...v2.0.1

3.0.0

18 Dec 17:53
v3.0.0
14d1c36
Compare
Choose a tag to compare

This package has been redesigned for compatibility with AMPHP v3 and fibers. AsyncTestCase serves a similar purpose as before, providing helper methods for unit testing within an async context. Each test case is run within a unique fiber to allow suspending during the test run.

  • AsyncTestCase::setUpAsync() and tearDownAsync() have been removed. Use AsyncTestCase::setUp() and tearDown() instead, as both of these methods are now able to execute async using fibers.
  • AsyncTestCase::createCallback() now returns a Closure. Additionally, an optional parameter for expected arguments upon invocation have been added (uses InvocationMocker::with(...) to set expected arguments).

3.0.0 Beta 4

07 Nov 21:28
v3.0.0-beta.4
af5815c
Compare
Choose a tag to compare
3.0.0 Beta 4 Pre-release
Pre-release
  • Add compatibility with Revolt v1.x
  • Require PHP 8.1

3.0.0 Beta 3

12 Jul 21:02
v3.0.0-beta.3
Compare
Choose a tag to compare
3.0.0 Beta 3 Pre-release
Pre-release
  • Replace deprecated Amp\Future\all with Amp\Future\await

3.0.0 Beta 2

19 Jan 20:16
v3.0.0-beta.2
Compare
Choose a tag to compare
3.0.0 Beta 2 Pre-release
Pre-release

Note: This is a pre-release, there might be breaking changes in the final stable version.

  • Add compatibility with revolt/event-loop v0.2.x

3.0.0 Beta 1

04 Dec 18:42
0b72190
Compare
Choose a tag to compare
3.0.0 Beta 1 Pre-release
Pre-release

Note: This is a pre-release, there might be breaking changes in the final stable version.

This package has been redesigned for compatibility with amphp v3 and fibers. AsyncTestCase serves a similar purpose as before, providing helper methods for unit testing within an async context. Each test case is run within a unique fiber to allow suspending during the test run.

  • AsyncTestCase::setUpAsync() and tearDownAsync() have been removed. Use AsyncTestCase::setUp() and tearDown() instead, as both of these methods are now able to execute async using fibers.
  • AsyncTestCase::createCallback() now returns a Closure. Additionally, an optional parameter for expected arguments upon invocation have been added (uses InvocationMocker::with(...) to set expected arguments).

2.0.0

04 Dec 18:26
Compare
Choose a tag to compare

This version is mostly backwards compatible with v1.x, except if a test throws an exception but the loop continues to run, the loop is now stopped after 1 second and the test fails. (#9)

  • PHP 7.1+ required.
  • Calling AsyncTestCase::setTimeout() multiple times will override the previous timeout set.
  • Deprecated functionality has been removed (TestCase and LoopReset removed).

1.4.0

04 May 15:40
99db640
Compare
Choose a tag to compare
  • Added setUpAsync() and tearDownAsync() to AsyncTestCase. These methods are executed before and after the test, similar to setUp() and tearDown().
    • Similar to the test case, these methods are executed using Amp\call(), so they may be a regular function, return a promise, or return a generator to be run as a coroutine.
    • setUpAsync() is run after setUp() and must resolve before the test method is executed.
    • tearDownAsync() is run immediately after the test concludes (or times out) and must resolve before tearDown() is run.
  • If a test times out, the test error message now provides, if available, the line in the generator returned by the test method where the timeout was reached.

1.3.0

20 Feb 16:24
bc4c6fd
Compare
Choose a tag to compare
  • Added support for PHPUnit 9.

1.2.0

04 Oct 19:53
v1.2.0
Compare
Choose a tag to compare