Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: WyriHaximus/php-async-test-utilities
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7.1.0
Choose a base ref
...
head repository: WyriHaximus/php-async-test-utilities
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7.2.0
Choose a head ref
  • 8 commits
  • 4 files changed
  • 2 contributors

Commits on Aug 19, 2023

  1. Copy the full SHA
    690cd91 View commit details

Commits on Sep 4, 2023

  1. Merge pull request #223 from WyriHaximus/renovate/phpunit

    Update dependency phpunit/phpunit to v9.6.11
    WyriHaximus authored Sep 4, 2023
    Copy the full SHA
    7a612dd View commit details

Commits on Sep 6, 2023

  1. Copy the full SHA
    2bd54ed View commit details
  2. Merge pull request #224 from WyriHaximus/lock-composer-to-v2.6+-for-p…

    …romise-v3
    
    Lock composer to v2.6+ for promise v3
    WyriHaximus authored Sep 6, 2023
    Copy the full SHA
    039d958 View commit details

Commits on Sep 7, 2023

  1. Copy the full SHA
    88a1583 View commit details
  2. Merge pull request #225 from WyriHaximus/trim-period-of-react-promise…

    …-version
    
    Trim period of react/promise version
    WyriHaximus authored Sep 7, 2023
    Copy the full SHA
    7256fb7 View commit details
  3. Copy the full SHA
    849a17e View commit details
  4. Merge pull request #226 from WyriHaximus/renovate/react-promise-3.x

    Update dependency react/promise to v3
    WyriHaximus authored Sep 7, 2023
    Copy the full SHA
    3cac9f5 View commit details
Showing with 67 additions and 58 deletions.
  1. +4 −1 composer.json
  2. +52 −49 composer.lock
  3. +0 −1 etc/qa/phpstan.neon
  4. +11 −7 src/AsyncTestCase.php
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -13,13 +13,16 @@
"phpunit/phpunit": "^9.6.10",
"react/async": "^4.1.0",
"react/event-loop": "^1.4.0",
"react/promise": "^2.10.",
"react/promise": "^2.10 || ^3.0",
"wyrihaximus/test-utilities": "^5.5.4 || ^6"
},
"require-dev": {
"react/promise-timer": "^1.10.0",
"wyrihaximus/iterator-or-array-to-array": "^1.2"
},
"conflict": {
"composer/compoer": "<2.6.0"
},
"autoload": {
"psr-4": {
"WyriHaximus\\AsyncTestUtilities\\": "src/"
101 changes: 52 additions & 49 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion etc/qa/phpstan.neon
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ parameters:
- '#Trying to invoke array\{\$this\(WyriHaximus\\AsyncTestUtilities\\AsyncTestCase\), string\|null\} but it might not be a callable.#'
- '#Method WyriHaximus\\AsyncTestUtilities\\CallableStub::__invoke\(\) is not final, but since the containing class is abstract, it should be.#'
- '#Parameter \#1 \$name of method ReflectionClass\<\$this\(WyriHaximus\\AsyncTestUtilities\\AsyncTestCase\)\>::getMethod\(\) expects string, string\|null given.#'
- '#Call to an undefined method React\\Promise\\PromiseInterface\<mixed\>::always\(\).#'
- '#Call to deprecated method expectCallableExactly\(\)#'
- '#Call to deprecated method expectCallableOnce\(\)#'
ergebnis:
18 changes: 11 additions & 7 deletions src/AsyncTestCase.php
Original file line number Diff line number Diff line change
@@ -93,13 +93,17 @@ final protected function runAsyncTest(mixed ...$args): mixed

$timeout = Loop::addTimer($timeout, static fn () => Loop::stop());

/**
* @psalm-suppress MixedArgument
* @psalm-suppress UndefinedInterfaceMethod
*/
return await(async(
fn (): mixed => ([$this, $this->realTestName])(...$args),
)()->always(static fn () => Loop::cancelTimer($timeout)));
try {
/**
* @psalm-suppress MixedArgument
* @psalm-suppress UndefinedInterfaceMethod
*/
return await(async(
fn (): mixed => ([$this, $this->realTestName])(...$args),
)());
} finally {
Loop::cancelTimer($timeout);
}
}

final protected function runTest(): mixed