Skip to content

Commit

Permalink
[1.x] Uses Pest 2 (#274)
Browse files Browse the repository at this point in the history
* Uses Pest 2

* Updates CI to use L10 only

* Fixes unit stub
  • Loading branch information
nunomaduro authored Mar 20, 2023
1 parent 34fb6f7 commit 3d8955f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: true
matrix:
stack: [blade, react, vue, api]
laravel: [9, 10]
laravel: [10]
args: ["", --pest]
include:
- stack: vue
Expand Down
13 changes: 5 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
}
],
"require": {
"php": "^8.0.2",
"illuminate/console": "^9.21|^10.0",
"illuminate/filesystem": "^9.21|^10.0",
"illuminate/support": "^9.21|^10.0",
"illuminate/validation": "^9.21|^10.0"
},
"conflict": {
"laravel/framework": "<9.37.0"
"php": "^8.1.0",
"illuminate/console": "^10.0",
"illuminate/filesystem": "^10.0",
"illuminate/support": "^10.0",
"illuminate/validation": "^10.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ protected function installTests()
$stubStack = $this->argument('stack') === 'api' ? 'api' : 'default';

if ($this->option('pest')) {
$this->removeComposerPackages(['nunomaduro/collision', 'phpunit/phpunit'], true);
$this->removeComposerPackages(['phpunit/phpunit'], true);

if (! $this->requireComposerPackages(['nunomaduro/collision:^6.4', 'pestphp/pest:^1.22', 'pestphp/pest-plugin-laravel:^1.2'], true)) {
if (! $this->requireComposerPackages(['pestphp/pest:^2.0', 'pestphp/pest-plugin-laravel:^2.0'], true)) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion stubs/default/pest-tests/Feature/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

test('example', function () {
it('returns a successful response', function () {
$response = $this->get('/');

$response->assertStatus(200);
Expand Down
2 changes: 1 addition & 1 deletion stubs/default/pest-tests/Unit/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

test('example', function () {
test('that true is true', function () {
expect(true)->toBeTrue();
});

0 comments on commit 3d8955f

Please sign in to comment.