Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Added Laravel 8.x and PHP 8.x compatibility #6

Merged
merged 5 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,30 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4, 7.3, 7.2.15]
laravel: [7.*]
php: [8.0, 7.4]
laravel: [8.*, 7.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl
coverage: xdebug

- name: Cache dependencies
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
Expand All @@ -51,6 +53,6 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
rm -rf composer.* vendor/
composer require cedx/coveralls
vendor/bin/coveralls build/logs/clover.xml
rm -rf composer.* vendor/
composer require php-coveralls/php-coveralls
vendor/bin/php-coveralls
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
}
],
"require": {
"php": "^7.2.15",
"php": "^7.4||^8.0",
"ext-json": "*",
"illuminate/support": "^7.0"
"illuminate/support": "^7.0||^8.0"
},
"require-dev": {
"orchestra/testbench": "^5.0",
"orchestra/testbench": "^5.0||^6.0",
"guzzlehttp/guzzle": "^6.5||^7.0",
"phpunit/phpunit": "^8.5||^9.0"
"phpunit/phpunit": "^9.3",
"mockery/mockery": "^1.4",
"nesbot/carbon": "^2.41"
},
"autoload": {
"psr-4": {
Expand All @@ -45,7 +47,7 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test": "vendor/bin/phpunit --coverage-clover build/logs/clover.xml",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
Expand Down
8 changes: 4 additions & 4 deletions tests/DatetimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Tests;

use Carbon\CarbonPeriod;
use Carbon\CarbonInterval;
use Orchestra\Testbench\TestCase;
use Carbon\CarbonPeriod;
use Illuminate\Support\Facades\Date;
use Orchestra\Testbench\TestCase;

class DatetimeTest extends TestCase
{
Expand All @@ -29,7 +29,7 @@ public function test_diff()

$this->assertInstanceOf(CarbonInterval::class, $today);
$this->assertSame(1, $today->invert);
$this->assertSame(9, $today->roundDays()->totalDays);
$this->assertSame(-9, $today->roundDays()->totalDays);
}

public function test_period()
Expand Down Expand Up @@ -97,4 +97,4 @@ public function test_yesterday()
$yesterday = yesterday('America/New_York');
$this->assertSame('2019-12-30 00:00:00', $yesterday->toDateTimeString());
}
}
}