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.0.1
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.0.2
Choose a head ref

Commits on May 6, 2023

  1. Add renovate.json

    renovate[bot] authored and WyriHaximus committed May 6, 2023
    Copy the full SHA
    e58d2c2 View commit details
  2. Merge pull request #180 from WyriHaximus/renovate/configure

    Configure Renovate
    WyriHaximus authored May 6, 2023
    Copy the full SHA
    d2260ea View commit details
  3. Disable Dependabot

    WyriHaximus committed May 6, 2023
    Copy the full SHA
    4152a36 View commit details
  4. Merge pull request #202 from WyriHaximus/disable-dependabot

    Disable Dependabot
    WyriHaximus authored May 6, 2023
    Copy the full SHA
    6736851 View commit details
  5. Copy the full SHA
    9d845d4 View commit details
  6. Merge pull request #203 from WyriHaximus/update-to-lateast-v5-depende…

    …ncies
    
    Update to the latest v5 dependencies
    WyriHaximus authored May 6, 2023
    Copy the full SHA
    02b727d View commit details
  7. Bump guzzlehttp/psr7 from 1.0.0 to 1.9.1

    Bumps [guzzlehttp/psr7](https://github.com/guzzle/psr7) from 1.0.0 to 1.9.1.
    - [Release notes](https://github.com/guzzle/psr7/releases)
    - [Changelog](https://github.com/guzzle/psr7/blob/1.9.1/CHANGELOG.md)
    - [Commits](guzzle/psr7@1.0.0...1.9.1)
    
    ---
    updated-dependencies:
    - dependency-name: guzzlehttp/psr7
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored May 6, 2023
    Copy the full SHA
    556070c View commit details
  8. Copy the full SHA
    ba358bd View commit details
  9. Merge pull request #199 from WyriHaximus/renovate/react-event-loop-1.x

    Update dependency react/event-loop to ^1.4.0
    WyriHaximus authored May 6, 2023
    Copy the full SHA
    cb2c85f View commit details
  10. Merge pull request #204 from WyriHaximus/dependabot/composer/guzzleht…

    …tp/psr7-1.9.1
    
    Bump guzzlehttp/psr7 from 1.0.0 to 1.9.1
    WyriHaximus authored May 6, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    41938f6 View commit details
  11. Bump guzzlehttp/guzzle from 6.0.0 to 7.5.1

    Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 6.0.0 to 7.5.1.
    - [Release notes](https://github.com/guzzle/guzzle/releases)
    - [Changelog](https://github.com/guzzle/guzzle/blob/7.5/CHANGELOG.md)
    - [Commits](guzzle/guzzle@6.0.0...7.5.1)
    
    ---
    updated-dependencies:
    - dependency-name: guzzlehttp/guzzle
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored May 6, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    18bdfa3 View commit details

Commits on May 7, 2023

  1. Merge pull request #205 from WyriHaximus/dependabot/composer/guzzleht…

    …tp/guzzle-7.5.1
    
    Bump guzzlehttp/guzzle from 6.0.0 to 7.5.1
    WyriHaximus authored May 7, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    b57c65b View commit details

Commits on May 11, 2023

  1. Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    af033a4 View commit details
  2. Merge pull request #206 from WyriHaximus/renovate/phpunit-phpunit-9.x

    Update dependency phpunit/phpunit to ^9.6.8
    WyriHaximus authored May 11, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    5aa1a43 View commit details

Commits on May 21, 2023

  1. Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    85cc0be View commit details
  2. Merge pull request #207 from WyriHaximus/switch-to-external-workflows

    Switch to external workflows
    WyriHaximus authored May 21, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    6d04794 View commit details

Commits on May 31, 2023

  1. Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    3f58d3c View commit details
  2. Merge pull request #208 from WyriHaximus/Switch-CI-workflow-to-main-e…

    …xternal-branch
    
    Switch CI workflow to main external branch
    WyriHaximus authored May 31, 2023
    Copy the full SHA
    a5d3d76 View commit details

Commits on Jun 11, 2023

  1. Copy the full SHA
    86f9038 View commit details

Commits on Jun 12, 2023

  1. Merge pull request #209 from WyriHaximus/renovate/phpunit-phpunit-9.x

    Update dependency phpunit/phpunit to ^9.6.9
    WyriHaximus authored Jun 12, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    laurit Lauri Tulmin
    Copy the full SHA
    7d69e85 View commit details

Commits on Jun 17, 2023

  1. Copy the full SHA
    5dbb353 View commit details
  2. Merge pull request #210 from WyriHaximus/bump-test-utilities-to-5.5.4

    Bump test utilities to 5.5.4
    WyriHaximus authored Jun 17, 2023
    Copy the full SHA
    d949b9f View commit details
Showing with 496 additions and 794 deletions.
  1. +0 −17 .github/dependabot.yml
  2. +26 −0 .github/renovate.json
  3. +8 −173 .github/workflows/ci.yml
  4. +0 −104 .github/workflows/set-milestone-on-pr.yaml
  5. +1 −1 Makefile
  6. +3 −3 composer.json
  7. +442 −472 composer.lock
  8. +3 −2 etc/qa/phpstan.neon
  9. +3 −2 rules.neon
  10. +9 −19 src/AsyncTestCase.php
  11. +1 −1 tests/bootstrap.php
17 changes: 0 additions & 17 deletions .github/dependabot.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"managers": ["composer"],
"rangeStrategy": "in-range-only"
},
{
"managers": ["composer"],
"rangeStrategy": "bump"
},
{
"managers": ["composer"],
"matchPackageNames": ["php"],
"enabled": false
}
],
"extends": [
"config:base",
":widenPeerDependencies",
":rebaseStalePrs",
":prHourlyLimitNone",
":prConcurrentLimitNone",
"group:phpstan"
]
}
181 changes: 8 additions & 173 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -6,177 +6,12 @@ on:
- 'master'
- 'refs/heads/v[0-9]+.[0-9]+.[0-9]+'
pull_request:
## This workflow needs the `pull-request` permissions to work for the package diffing
## Refs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions
permissions:
pull-requests: write
contents: read
jobs:
package-name:
name: Package Name
runs-on: ubuntu-latest
needs:
- lint-json
outputs:
package-name: ${{ steps.package-name.outputs.package-name }}
steps:
- uses: actions/checkout@v3
- id: package-name
run: |
printf "::set-output name=package-name::[\"%s\"]" $(docker run --rm -v "`pwd`:`pwd`" jess/jq jq -r -c '.name' "${GITHUB_WORKSPACE}/composer.json")
supported-versions-matrix:
name: Supported Versions Matrix
runs-on: ubuntu-latest
needs:
- lint-yaml
- lint-json
outputs:
version: ${{ steps.supported-versions-matrix.outputs.version }}
upcoming: ${{ steps.supported-versions-matrix.outputs.upcoming }}
steps:
- uses: actions/checkout@v3
- id: supported-versions-matrix
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1
with:
upcomingReleases: true
supported-checks-matrix:
name: Supported Checks Matrix
runs-on: ubuntu-latest
needs:
- lint-yaml
outputs:
check: ${{ steps.supported-checks-matrix.outputs.check }}
steps:
- uses: actions/checkout@v3
- id: supported-checks-matrix
name: Generate check
run: |
printf "Checks found: %s\r\n" $(make task-list-ci)
printf "::set-output name=check::%s" $(make task-list-ci)
can-require:
name: Test we can require "${{ matrix.package-name }}" on PHP ${{ matrix.php }}
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
package-name: ${{ fromJson(needs.package-name.outputs.package-name) }}
needs:
- lint-yaml
- lint-json
- package-name
- supported-versions-matrix
runs-on: ubuntu-latest
container:
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
steps:
- uses: actions/checkout@v3
with:
path: checked_out_package
- name: Set Up composer.json
run: |
echo "{\"repositories\": [{\"name\": \"${{ matrix.package-name }}\",\"type\": \"path\",\"url\": \"./checked_out_package\"}]}" > composer.json
- name: Require package
if: needs.supported-versions-matrix.outputs.upcoming != matrix.php
run: |
composer config --no-plugins "allow-plugins.*/*" true
composer require "${{ matrix.package-name }}:dev-${GITHUB_SHA}" --no-progress --ansi --no-interaction --prefer-dist -o -vvv || composer require "${{ matrix.package-name }}:dev-${GITHUB_REF_NAME}" --no-progress --ansi --no-interaction --prefer-dist -o -vvv
qa:
name: Run ${{ matrix.check }} on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
composer: [lowest, locked, highest]
check: ${{ fromJson(needs.supported-checks-matrix.outputs.check) }}
needs:
- lint-yaml
- lint-json
- supported-checks-matrix
- supported-versions-matrix
runs-on: ubuntu-latest
container:
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
steps:
- uses: actions/checkout@v3
- uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.composer }}
- run: git config --global --add safe.directory $GITHUB_WORKSPACE # Do this ourself because `actions/checkout@v3 doesn't succeed in doing this
- name: Fetch Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
if: matrix.check == 'backward-compatibility-check'
- run: make ${{ matrix.check }} || true
if: needs.supported-versions-matrix.outputs.upcoming == matrix.php
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
- run: make ${{ matrix.check }}
if: needs.supported-versions-matrix.outputs.upcoming != matrix.php
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
tests-directly-on-os:
name: Run tests on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
composer: [lowest, locked, highest]
needs:
- lint-yaml
- lint-json
- supported-checks-matrix
- supported-versions-matrix
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
extensions: intl, sodium
- uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.composer }}
- run: make unit-testing-raw || true
if: needs.supported-versions-matrix.outputs.upcoming == matrix.php
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
- run: make unit-testing-raw
if: needs.supported-versions-matrix.outputs.upcoming != matrix.php
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
lint-yaml:
name: Lint YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
config_data: |
extends: default
ignore: |
/.git/
rules:
line-length: disable
document-start: disable
truthy: disable
lint-json:
name: Lint JSON
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: json-syntax-check
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"
check-mark:
name: ✔️
needs:
- lint-yaml
- lint-json
- can-require
- qa
- tests-directly-on-os
runs-on: ubuntu-latest
steps:
- run: echo "✔️"
ci:
name: Continuous Integration
uses: WyriHaximus/github-workflows/.github/workflows/package.yaml@main
104 changes: 0 additions & 104 deletions .github/workflows/set-milestone-on-pr.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ else
-v "`pwd`:`pwd`" \
-v "${COMPOSER_CACHE_DIR}:/home/app/.composer/cache" \
-w "`pwd`" \
"ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-buster${SLIM_DOCKER_IMAGE}-dev"
"ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine${SLIM_DOCKER_IMAGE}-dev"
endif

ifneq (,$(findstring icrosoft,$(shell cat /proc/version)))
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -10,11 +10,11 @@
],
"require": {
"php": "^8.2",
"phpunit/phpunit": "^9.6.7",
"phpunit/phpunit": "^9.6.9",
"react/async": "^4.0",
"react/event-loop": "^1.3.0",
"react/event-loop": "^1.4.0",
"react/promise": "^2.10.",
"wyrihaximus/test-utilities": "^5.5.0 || ^6"
"wyrihaximus/test-utilities": "^5.5.4 || ^6"
},
"require-dev": {
"react/promise-timer": "^1.9",
914 changes: 442 additions & 472 deletions composer.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions etc/qa/phpstan.neon
Original file line number Diff line number Diff line change
@@ -10,8 +10,9 @@ parameters:
- '#Call to deprecated method expectCallableExactly\(\)#'
- '#Call to deprecated method expectCallableOnce\(\)#'
ergebnis:
classesAllowedToBeExtended:
- WyriHaximus\AsyncTestUtilities\AsyncTestCase
noExtends:
classesAllowedToBeExtended:
- WyriHaximus\AsyncTestUtilities\AsyncTestCase

includes:
- ../../vendor/wyrihaximus/test-utilities/rules.neon
5 changes: 3 additions & 2 deletions rules.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
parameters:
ergebnis:
classesAllowedToBeExtended:
- WyriHaximus\AsyncTestUtilities\AsyncTestCase
noExtends:
classesAllowedToBeExtended:
- WyriHaximus\AsyncTestUtilities\AsyncTestCase

includes:
- ../test-utilities/rules.neon
28 changes: 9 additions & 19 deletions src/AsyncTestCase.php
Original file line number Diff line number Diff line change
@@ -16,27 +16,21 @@ abstract class AsyncTestCase extends TestCase
{
private const INVOKE_ARRAY = ['__invoke'];

private ?string $realTestName = null;
private string|null $realTestName = null;

/**
* @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.)
*/
/** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
final protected function expectCallableExactly(int $amount): callable
{
return $this->getCallableMock(self::exactly($amount));
}

/**
* @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.)
*/
/** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
final protected function expectCallableOnce(): callable
{
return $this->getCallableMock(self::once());
}

/**
* @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.)
*/
/** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
final protected function expectCallableNever(): callable
{
return $this->getCallableMock(self::never());
@@ -55,15 +49,12 @@ private function getCallableMock(InvokedCount $invokedCount): callable
return $mock;
}

/**
* @codeCoverageIgnore Invoked before code coverage data is being collected.
*/
/** @codeCoverageIgnore Invoked before code coverage data is being collected. */
final public function setName(string $name): void
{
/**
* @psalm-suppress InternalMethod
*/
/** @psalm-suppress InternalMethod */
parent::setName($name);

$this->realTestName = $name;
}

@@ -75,6 +66,7 @@ final protected function runAsyncTest(mixed ...$args): mixed
* @psalm-suppress PossiblyNullArgument
*/
parent::setName($this->realTestName);

$timeout = 30;
$reflectionClass = new ReflectionClass($this::class);
foreach ($reflectionClass->getAttributes() as $classAttribute) {
@@ -112,9 +104,7 @@ final protected function runAsyncTest(mixed ...$args): mixed

final protected function runTest(): mixed
{
/**
* @psalm-suppress InternalMethod
*/
/** @psalm-suppress InternalMethod */
parent::setName('runAsyncTest');

return parent::runTest();
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -12,6 +12,6 @@ function_exists('xdebug_set_filter') &&
XDEBUG_PATH_WHITELIST,
[
dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src',
]
],
);
}