mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
Merge pull request #987 from m1guelpf/php8
Add support for PHP 8 & move tests to GitHub Actions
This commit is contained in:
41
.github/workflows/tests.yml
vendored
Normal file
41
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
mac_tests:
|
||||
runs-on: macos-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0]
|
||||
|
||||
name: PHP ${{ matrix.php }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: dom, curl, libxml, mbstring, zip, fileinfo
|
||||
tools: composer:v2
|
||||
coverage: none
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-interaction --prefer-dist
|
||||
if: matrix.php != 8.0
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||
if: matrix.php == 8.0
|
||||
|
||||
- name: Execute tests
|
||||
env:
|
||||
APP_ENV: testing
|
||||
run: vendor/bin/phpunit --verbose
|
||||
31
.travis.yml
31
.travis.yml
@@ -1,31 +0,0 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
- 7.4
|
||||
|
||||
env:
|
||||
global:
|
||||
- setup=basic
|
||||
- APP_ENV=testing
|
||||
|
||||
sudo: false
|
||||
|
||||
before_install:
|
||||
- phpenv config-rm xdebug.ini || true
|
||||
- travis_retry composer self-update
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
install:
|
||||
- if [[ $setup = 'basic' ]]; then travis_retry composer install --no-interaction --prefer-dist; fi
|
||||
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable; fi
|
||||
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi
|
||||
|
||||
script: vendor/bin/phpunit --verbose
|
||||
@@ -8,6 +8,8 @@ class Brew
|
||||
{
|
||||
const SUPPORTED_PHP_VERSIONS = [
|
||||
'php',
|
||||
'php@8.1',
|
||||
'php@8.0',
|
||||
'php@7.4',
|
||||
'php@7.3',
|
||||
'php@7.2',
|
||||
|
||||
@@ -165,8 +165,7 @@
|
||||
/**
|
||||
* Stop serving the given domain over HTTPS and remove the trusted TLS certificate.
|
||||
*/
|
||||
$app->command('unsecure [domain] [--all]', function ($domain = null, $all) {
|
||||
|
||||
$app->command('unsecure [domain] [--all]', function ($domain = null, $all = false) {
|
||||
if ($all) {
|
||||
Site::unsecureAll();
|
||||
return;
|
||||
|
||||
@@ -71,6 +71,8 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
{
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@8.1')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@8.0')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@7.4')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@7.3')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(true);
|
||||
@@ -87,6 +89,8 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@8.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.0')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.4')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.3')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
@@ -103,6 +107,8 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@8.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.0')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.4')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.3')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(true);
|
||||
@@ -119,6 +125,8 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.0')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.4')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.3')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
@@ -135,6 +143,8 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.0')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.4')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.3')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
@@ -151,6 +161,8 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.0')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.4')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.3')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
@@ -167,6 +179,8 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@8.0')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.4')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.3')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
|
||||
Reference in New Issue
Block a user