Skip to content

Commit

Permalink
Merge branch 'develop' into 8.x
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Dec 4, 2023
2 parents db4a76c + 58886fc commit cb920a6
Show file tree
Hide file tree
Showing 18 changed files with 328 additions and 36 deletions.
53 changes: 43 additions & 10 deletions .github/workflows/analyse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: analyse
on:
push:
pull_request:
workflow_dispatch:

jobs:
analyse:
Expand All @@ -14,33 +15,65 @@ jobs:
- "ubuntu-latest"
php:
- 8.2
dependencies:
- "highest"
experimental:
- false

name: PHP${{ matrix.php }} on ${{ matrix.os }}
name: PHP${{ matrix.php }} PHPStan & Pint

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, intl, fileinfo
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, bcmath, fileinfo
coverage: none

- name: Install dependencies
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist --no-cache"

- name: Installed dependencies
run: composer show -D

- name: Execute Code Style Analysis
run: vendor/bin/pint --test

- name: Execute Static Code Analysis
run: vendor/bin/phpstan analyse

lint:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os:
- "ubuntu-latest"
php:
- 8.3
dependencies:
- "highest"
experimental:
- false

name: PHP${{ matrix.php }} Code Lint

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, bcmath, fileinfo
coverage: none

- name: Install dependencies
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist --no-cache"

- name: PHP Lint
run: php -l ./src
3 changes: 1 addition & 2 deletions .github/workflows/audits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: audits
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
audit-dependencies:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coveralls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: coveralls
on:
push:
pull_request:
workflow_dispatch:

jobs:
tests:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: tests
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG-7.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

This changelog references the relevant changes (bug and security fixes) done to `orchestra/testbench-dusk`.

## 7.35.0

Released: 2023-12-04

### Added

* Added the following attributes:
- `Orchestra\Testbench\Dusk\Attributes\BeforeServing`
- `Orchestra\Testbench\Dusk\Attributes\RestartServer`
* Backport `startServing()` and `reloadServing()` to `Orchestra\Testbench\Dusk\CanServeSite` trait.
* Add `createServingApplicationForDuskServer` method to `Orchestra\Testbench\Dusk\CanServeSite` trait.

### Changes

* Update minimum support for Testbench v7.36.0+. ([v7.35.0...v7.36.0](https://github.com/orchestral/testbench/compare/v7.35.0...v7.36.0))
* Allow passing method name to `Orchestra\Testbench\Dusk\CanServeSite::beforeServingApplication()` method.

### Deprecated

* Deprecate `getFreshApplicationToServe` method on `Orchestra\Testbench\Dusk\CanServeSite` trait, use `createServingApplicationForDuskServer` instead.

## 7.34.0

Released: 2023-11-10

### Changes

* Update minimum support for Testbench v7.35.0+. ([v7.34.0...v7.35.0](https://github.com/orchestral/testbench/compare/v7.34.0...v7.35.0))
* Refactor `Orchetra\Testbench\Dusk\DuskServer`.

## 7.33.0

Released: 2023-10-24
Expand Down
41 changes: 40 additions & 1 deletion CHANGELOG-8.x.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
# Change for 8.x
# Changes for 8.x

This changelog references the relevant changes (bug and security fixes) done to `orchestra/testbench-dusk`.

## 8.16.0

Released: 2023-12-04

### Added

* Added the following attributes:
- `Orchestra\Testbench\Dusk\Attributes\BeforeServing`
- `Orchestra\Testbench\Dusk\Attributes\RestartServer`
* Backport `startServing()` and `reloadServing()` to `Orchestra\Testbench\Dusk\CanServeSite` trait.
* Add `createServingApplicationForDuskServer` method to `Orchestra\Testbench\Dusk\CanServeSite` trait.

### Changes

* Update minimum support for Testbench v8.16.0+. ([v8.15.0...v8.16.0](https://github.com/orchestral/testbench/compare/v8.15.0...v8.16.0))
* Allow passing method name to `Orchestra\Testbench\Dusk\CanServeSite::beforeServingApplication()` method.
* Add `#[Override]` attribute to relevant methods, this require `symfony/polyfill-php83` as backward compatibility for PHP 8.1 and 8.2.

### Deprecated

* Deprecate `getFreshApplicationToServe` method on `Orchestra\Testbench\Dusk\CanServeSite` trait, use `createServingApplicationForDuskServer` instead.

## 8.15.0

Released: 2023-11-10

### Changes

* Update minimum support for Testbench v8.15.0+. ([v8.14.0...v8.15.0](https://github.com/orchestral/testbench/compare/v8.14.0...v8.15.0))
* Refactor `Orchetra\Testbench\Dusk\DuskServer`.

## 8.14.2

Released: 2023-11-02

### Changes

* Update skeleton to match v10.2.8.

## 8.14.1

Released: 2023-11-02
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"laravel/serializable-closure": "^1.0",
"orchestra/dusk-updater": "^2.3",
"orchestra/testbench": "8.x-dev",
"php-webdriver/webdriver": "^1.9"
"php-webdriver/webdriver": "^1.9",
"symfony/polyfill-php83": "^1.28"
},
"require-dev": {
"laravel/pint": "^1.6",
Expand Down Expand Up @@ -89,6 +90,6 @@
"config": {
"sort-packages": true
},
"prefer-stable": false,
"prefer-stable": true,
"minimum-stability": "dev"
}
40 changes: 40 additions & 0 deletions src/Attributes/BeforeServing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace Orchestra\Testbench\Dusk\Attributes;

use Attribute;
use Closure;
use Orchestra\Testbench\Contracts\Attributes\Actionable as ActionableContract;

#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class BeforeServing implements ActionableContract
{
/**
* The target method.
*
* @var string
*/
public $method;

/**
* Construct a new attribute.
*
* @param string $method
*/
public function __construct(string $method)
{
$this->method = $method;
}

/**
* Handle the attribute.
*
* @param \Illuminate\Foundation\Application $app
* @param \Closure(string, array<int, mixed>):void $action
* @return string
*/
public function handle($app, Closure $action): string
{
return $this->method;
}
}
22 changes: 22 additions & 0 deletions src/Attributes/RestartServer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Orchestra\Testbench\Dusk\Attributes;

use Attribute;
use Closure;
use Orchestra\Testbench\Contracts\Attributes\Actionable as ActionableContract;

#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class RestartServer implements ActionableContract
{
/**
* Handle the attribute.
*
* @param \Illuminate\Foundation\Application $app
* @param \Closure(string, array<int, mixed>):void $action
*/
public function handle($app, Closure $action): void
{
\call_user_func($action, 'reloadServing', []);
}
}
3 changes: 3 additions & 0 deletions src/Bootstrap/LoadConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use Illuminate\Contracts\Foundation\Application;
use Symfony\Component\Finder\Finder;

/**
* @internal
*/
final class LoadConfiguration
{
/**
Expand Down
Loading

0 comments on commit cb920a6

Please sign in to comment.