Skip to content

Commit

Permalink
Drop PHPUnit 9 and limits Laravel supported versions to 10 and 11 (#1077
Browse files Browse the repository at this point in the history
)

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

---------

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Jan 8, 2024
1 parent 22efc89 commit 41ce56e
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 58 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/browser-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
- develop
- '*.x'
- 'feat/*'
pull_request:
schedule:
- cron: '0 0 * * *'
Expand All @@ -17,24 +18,14 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.0', 8.1, 8.2, 8.3]
laravel: [9, 10, 11]
phpunit: [9, 10]
php: [8.1, 8.2, 8.3]
laravel: [10, 11]
phpunit: [10.5, '11.0']
exclude:
- php: '8.0'
laravel: 11
- php: 8.1
laravel: 11
- php: '8.0'
laravel: 10
- php: '8.0'
phpunit: 10
- php: 8.3
laravel: 9
- laravel: 11
phpunit: 9
- laravel: 9
phpunit: 10
- laravel: 10
phpunit: '11.0'

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - PHPUnit ${{ matrix.phpunit }}

Expand Down
23 changes: 7 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
- develop
- '*.x'
- 'feat/*'
pull_request:
schedule:
- cron: '0 0 * * *'
Expand All @@ -17,24 +18,14 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.0', 8.1, 8.2, 8.3]
laravel: [9, 10, 11]
phpunit: [9, 10]
php: [8.1, 8.2, 8.3]
laravel: [10, 11]
phpunit: [10.5, '11.0']
exclude:
- php: '8.0'
laravel: 11
- php: 8.1
laravel: 11
- php: '8.0'
laravel: 10
- php: '8.0'
phpunit: 10
- php: 8.3
laravel: 9
- laravel: 11
phpunit: 9
- laravel: 9
phpunit: 10
- laravel: 10
phpunit: '11.0'

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - PHPUnit ${{ matrix.phpunit }}

Expand Down Expand Up @@ -71,7 +62,7 @@ jobs:
fail-fast: true
matrix:
php: [8.2]
laravel: [9, 10]
laravel: [10]

name: Test Stubs PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"ext-json": "*",
"ext-zip": "*",
"guzzlehttp/guzzle": "^7.2",
"illuminate/console": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0",
"nesbot/carbon": "^2.0",
"guzzlehttp/guzzle": "^7.5",
"illuminate/console": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0",
"nesbot/carbon": "^2.67",
"php-webdriver/webdriver": "^1.9.0",
"symfony/console": "^6.0|^7.0",
"symfony/finder": "^6.0|^7.0",
"symfony/process": "^6.0|^7.0",
"symfony/console": "^6.2|^7.0",
"symfony/finder": "^6.2|^7.0",
"symfony/process": "^6.2|^7.0",
"vlucas/phpdotenv": "^5.2"
},
"require-dev": {
"mockery/mockery": "^1.4.2",
"orchestra/testbench": "^7.33|^8.13|^9.0",
"mockery/mockery": "^1.5.1",
"orchestra/testbench": "^8.19|^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5.10|^10.4.0",
"phpunit/phpunit": "^10.1|^11.0",
"psy/psysh": "^0.11.12|^0.12"
},
"suggest": {
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/ProvidesBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Exception;
use Illuminate\Support\Collection;
use Laravel\Dusk\Browser;
use PHPUnit\Framework\Attributes\AfterClass;
use PHPUnit\Runner\Version;
use ReflectionFunction;
use Throwable;
Expand All @@ -29,10 +30,9 @@ trait ProvidesBrowser
/**
* Tear down the Dusk test case class.
*
* @afterClass
*
* @return void
*/
#[AfterClass]
public static function tearDownDuskClass()
{
static::closeAll();
Expand Down
6 changes: 3 additions & 3 deletions stubs/DuskTestCase.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

namespace Tests;

use Illuminate\Support\Collection;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Illuminate\Support\Collection;
use Laravel\Dusk\TestCase as BaseTestCase;
use PHPUnit\Framework\Attributes\BeforeClass;

abstract class DuskTestCase extends BaseTestCase
{
use CreatesApplication;

/**
* Prepare for Dusk test execution.
*
* @beforeClass
*/
#[BeforeClass]
public static function prepare(): void
{
if (! static::runningInSail()) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Browser/DuskTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Laravel\Dusk\Browser;
use Laravel\Dusk\TestCase;
use Orchestra\Testbench\Concerns\CreatesApplication;
use PHPUnit\Framework\Attributes\BeforeClass;

class DuskTestCase extends TestCase
{
Expand Down Expand Up @@ -40,9 +41,8 @@ protected function setUp(): void

/**
* Prepare for Dusk test execution.
*
* @beforeClass
*/
#[BeforeClass]
public static function prepare(): void
{
if (! static::runningInSail()) {
Expand Down
5 changes: 2 additions & 3 deletions tests/Unit/OperatingSystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Laravel\Dusk\Tests\Unit;

use Laravel\Dusk\OperatingSystem;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

class OperatingSystemTest extends TestCase
Expand Down Expand Up @@ -41,9 +42,7 @@ public function test_it_cant_resolve_invalid_chrome_version_commands()
OperatingSystem::chromeVersionCommands('window_os');
}

/**
* @dataProvider resolveChromeDriverSlugDataProvider
*/
#[DataProvider('resolveChromeDriverSlugDataProvider')]
public function test_it_can_resolve_chromedriver_slug($version, $os, $expected)
{
$this->assertSame($expected, OperatingSystem::chromeDriverSlug($os, $version));
Expand Down
9 changes: 3 additions & 6 deletions tests/Unit/ProvidesBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Laravel\Dusk\Concerns\ProvidesBrowser;
use Mockery as m;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use stdClass;

Expand All @@ -16,9 +17,7 @@ protected function tearDown(): void
m::close();
}

/**
* @dataProvider testData
*/
#[DataProvider('testData')]
public function test_capture_failures_for()
{
$browser = m::mock(stdClass::class);
Expand All @@ -30,9 +29,7 @@ public function test_capture_failures_for()
$this->captureFailuresFor($browsers);
}

/**
* @dataProvider testData
*/
#[DataProvider('testData')]
public function test_store_console_logs_for()
{
$browser = m::mock(stdClass::class);
Expand Down

0 comments on commit 41ce56e

Please sign in to comment.