Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
Upgrade to Phony 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Dec 21, 2020
1 parent 510b076 commit 00b3f78
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0', '8.1']
name: PHP ${{ matrix.php }}
steps:
- name: Checkout
Expand All @@ -26,7 +26,11 @@ jobs:
- name: Install dependencies
run: make vendor
- name: Make
if: ${{ startsWith(matrix.php, '7.') }}
run: make ci
- name: Make
if: ${{ startsWith(matrix.php, '8.') }}
run: make test
- name: Upload coverage reports
if: success()
run: |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Phony for PHPUnit changelog

## Next release

This release uses *Phony* `5.x`. There no BC breaking API changes.

## 7.0.0 (2020-02-12)

- **[BC BREAK]** PHP 7.2 is no longer supported.
- **[BC BREAK]** Dropped support for PHPUnit `8.x`.
- **[NEW]** Added support for PHPUnit `9.x`.

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Powered by https://makefiles.dev/

PHP_COMPOSER_INSTALL_ARGS += --ignore-platform-reqs

################################################################################

-include .makefiles/Makefile
-include .makefiles/pkg/php/v1/Makefile

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}
],
"require": {
"php": ">=7.3",
"eloquent/phony": "^4",
"php": "^7.3 || ^8",
"eloquent/phony": "^5",
"phpunit/phpunit": "^9"
},
"require-dev": {
Expand Down Expand Up @@ -42,7 +42,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "6.1.x-dev"
"dev-master": "7.2.x-dev"
}
}
}
12 changes: 6 additions & 6 deletions test/suite/PhonyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function testStubGlobal(): void

$this->assertInstanceOf(StubVerifier::class, $actual);
$this->assertSame('a, b', TestNamespace\sprintf('%s, %s', 'a', 'b'));
$this->assertNull(TestNamespace\sprintf('x', 'y'));
$this->assertEmpty(TestNamespace\sprintf('x', 'y'));
$this->assertTrue((bool) $actual->calledWith('%s, %s', 'a', 'b'));
}

Expand All @@ -285,7 +285,7 @@ public function testStubGlobalFunction(): void

$this->assertInstanceOf(StubVerifier::class, $actual);
$this->assertSame('a, b', TestNamespace\vsprintf('%s, %s', ['a', 'b']));
$this->assertNull(TestNamespace\vsprintf('x', 'y'));
$this->assertEmpty(TestNamespace\vsprintf('x', ['y']));
$this->assertTrue((bool) $actual->calledWith('%s, %s', ['a', 'b']));
}

Expand All @@ -294,8 +294,8 @@ public function testRestoreGlobalFunctions(): void
Phony::stubGlobal('sprintf', TestNamespace::class);
Phony::stubGlobal('vsprintf', TestNamespace::class);

$this->assertNull(TestNamespace\sprintf('%s, %s', 'a', 'b'));
$this->assertNull(TestNamespace\vsprintf('%s, %s', ['a', 'b']));
$this->assertEmpty(TestNamespace\sprintf('%s, %s', 'a', 'b'));
$this->assertEmpty(TestNamespace\vsprintf('%s, %s', ['a', 'b']));

Phony::restoreGlobalFunctions();

Expand All @@ -308,8 +308,8 @@ public function testRestoreGlobalFunctionsFunction(): void
stubGlobal('sprintf', TestNamespace::class);
stubGlobal('vsprintf', TestNamespace::class);

$this->assertNull(TestNamespace\sprintf('%s, %s', 'a', 'b'));
$this->assertNull(TestNamespace\vsprintf('%s, %s', ['a', 'b']));
$this->assertEmpty(TestNamespace\sprintf('%s, %s', 'a', 'b'));
$this->assertEmpty(TestNamespace\vsprintf('%s, %s', ['a', 'b']));

restoreGlobalFunctions();

Expand Down

0 comments on commit 00b3f78

Please sign in to comment.