Skip to content

Commit

Permalink
Merge pull request #177 from koriym/gh-action
Browse files Browse the repository at this point in the history
Enable PHP 7.2-8.1 compat
  • Loading branch information
harikt authored Jan 26, 2022
2 parents 2261eca + bec65c5 commit de25bae
Show file tree
Hide file tree
Showing 22 changed files with 102 additions and 61 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Continuous Integration

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
operating-system:
- ubuntu-latest
php-version:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: none
ini-values: assert.exception=1, zend.assertions=1

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php

- name: Run test suite
run: ./vendor/bin/phpunit
14 changes: 6 additions & 8 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
filter:
paths: ["src/*"]
tools:
external_code_coverage: true
php_code_coverage: true
php_sim: true
php_mess_detector: true
php_pdepend: true
php_analyzer: true
php_cpd: true
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2017, Aura for PHP
Copyright (c) 2015-2022, Aura for PHP

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Alternatively, [download a release][], or clone this repository, then map the

## Dependencies

This package requires PHP 5.5 or later; it has been tested on PHP 5.6, PHP 7,
PHP 7.1 and HHVM. We recommend using the latest available version of PHP as a
This package requires PHP 7.2 or later. It has been tested on PHP 7.2-8.1. We recommend using the latest available version of PHP as a
matter of principle.

Aura library packages may sometimes depend on external interfaces, but never on
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": ">=5.5.0",
"php": "^7.2 || ^8.0",
"psr/http-message": "~1.0",
"psr/log": "~1.0"
},
Expand All @@ -28,7 +28,7 @@
},
"require-dev": {
"zendframework/zend-diactoros": "~1.0",
"phpunit/phpunit": "~5.7 || ~4.8"
"phpunit/phpunit": "^8.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<phpunit bootstrap="./phpunit.php">
<testsuites>
<testsuite>
<testsuite name="Aura.Router test suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
Expand Down
8 changes: 5 additions & 3 deletions tests/GeneratorTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace Aura\Router;

class GeneratorTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class GeneratorTest extends TestCase
{
/**
* @var Map
Expand All @@ -13,7 +15,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase
*/
protected $generator;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$container = new RouterContainer();
Expand Down Expand Up @@ -63,7 +65,7 @@ public function testGenerate()

public function testGenerateMissing()
{
$this->setExpectedException('Aura\Router\Exception\RouteNotFound');
$this->expectException('Aura\Router\Exception\RouteNotFound');
$this->generator->generate('no-such-route');
}

Expand Down
5 changes: 3 additions & 2 deletions tests/Helper/RouteRawTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

use Aura\Router\Exception\RouteNotFound;
use Aura\Router\RouterContainer;
use PHPUnit\Framework\TestCase;

class RouteRawTest extends \PHPUnit_Framework_TestCase
class RouteRawTest extends TestCase
{
protected $container;
protected $map;
protected $generator;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$container = new RouterContainer();
Expand Down
5 changes: 3 additions & 2 deletions tests/Helper/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

use Aura\Router\Exception\RouteNotFound;
use Aura\Router\RouterContainer;
use PHPUnit\Framework\TestCase;

class RouteTest extends \PHPUnit_Framework_TestCase
class RouteTest extends TestCase
{
protected $container;
protected $map;
protected $generator;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$container = new RouterContainer();
Expand Down
8 changes: 5 additions & 3 deletions tests/MapTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php
namespace Aura\Router;

class MapTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class MapTest extends TestCase
{
protected $map;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$container = new RouterContainer();
Expand All @@ -28,7 +30,7 @@ protected function assertRoute($expect, $actual)
public function testRouteAlreadyExists()
{
$this->map->route('foo', '/foo');
$this->setExpectedException('Aura\Router\Exception\RouteAlreadyExists');
$this->expectException('Aura\Router\Exception\RouteAlreadyExists');
$this->map->route('foo', '/foo');
}

Expand Down
5 changes: 3 additions & 2 deletions tests/MatcherTest.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?php
namespace Aura\Router;

use PHPUnit\Framework\TestCase;
use Zend\Diactoros\ServerRequestFactory;

class MatcherTest extends \PHPUnit_Framework_TestCase
class MatcherTest extends TestCase
{
protected $map;
protected $matcher;
protected $logger;
protected $request;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$container = new RouterContainer();
Expand Down
11 changes: 6 additions & 5 deletions tests/RouteTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
namespace Aura\Router;

use PHPUnit\Framework\TestCase;
use Zend\Diactoros\ServerRequestFactory;

class RouteTest extends \PHPUnit_Framework_TestCase
class RouteTest extends TestCase
{
public function test__get()
{
Expand All @@ -16,7 +17,7 @@ public function testImmutablePath()
{
$route = new Route();
$route->path('/foo');
$this->setExpectedException(
$this->expectException(
'Aura\Router\Exception\ImmutableProperty',
'Aura\Router\Route::$path'
);
Expand All @@ -27,7 +28,7 @@ public function testImmutablePathPrefix()
{
$route = new Route();
$route->path('/foo');
$this->setExpectedException(
$this->expectException(
'Aura\Router\Exception\ImmutableProperty',
'Aura\Router\Route::$pathPrefix'
);
Expand All @@ -38,7 +39,7 @@ public function testImmutableName()
{
$route = new Route();
$route->name('/foo');
$this->setExpectedException(
$this->expectException(
'Aura\Router\Exception\ImmutableProperty',
'Aura\Router\Route::$name'
);
Expand All @@ -49,7 +50,7 @@ public function testImmutableNamePrefix()
{
$route = new Route();
$route->name('/foo');
$this->setExpectedException(
$this->expectException(
'Aura\Router\Exception\ImmutableProperty',
'Aura\Router\Route::$namePrefix'
);
Expand Down
3 changes: 2 additions & 1 deletion tests/Rule/AbstractRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
namespace Aura\Router\Rule;

use Aura\Router\Route;
use PHPUnit\Framework\TestCase;
use Zend\Diactoros\ServerRequestFactory;

abstract class AbstractRuleTest extends \PHPUnit_Framework_TestCase
abstract class AbstractRuleTest extends TestCase
{
protected $rule;

Expand Down
4 changes: 2 additions & 2 deletions tests/Rule/AcceptsTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
namespace Aura\Router\Rule;

class AcceptTest extends AbstractRuleTest
class AcceptsTest extends AbstractRuleTest
{
public function setup()
public function setup(): void
{
parent::setup();
$this->rule = new Accepts();
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/AllowsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class AllowsTest extends AbstractRuleTest
{
public function setup()
public function setup(): void
{
parent::setup();
$this->rule = new Allows();
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/CustomTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class CustomTest extends AbstractRuleTest
{
public function setup()
public function setup(): void
{
parent::setup();
$this->rule = new FakeCustom();
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/HostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class HostTest extends AbstractRuleTest
{
public function setup()
public function setup(): void
{
parent::setup();
$this->rule = new Host();
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/PathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class PathTest extends AbstractRuleTest
{
public function setup()
public function setUp(): void
{
parent::setup();
$this->rule = new Path();
Expand Down
10 changes: 6 additions & 4 deletions tests/Rule/RuleIteratorTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php
namespace Aura\Router\Rule;

class RuleIteratorTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class RuleIteratorTest extends TestCase
{
protected $ruleIterator;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->ruleIterator = new RuleIterator();
Expand Down Expand Up @@ -46,7 +48,7 @@ public function testUnexpectedValue()
function () { return 'string'; }
]);

$this->setExpectedException(
$this->expectException(
'Aura\Router\Exception\UnexpectedValue',
'string'
);
Expand All @@ -60,7 +62,7 @@ public function testUnexpectedValueObject()
function () { return (object) []; }
]);

$this->setExpectedException(
$this->expectException(
'Aura\Router\Exception\UnexpectedValue',
'object of type stdClass'
);
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/SecureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class SecureTest extends AbstractRuleTest
{
public function setup()
public function setUp(): void
{
parent::setup();
$this->rule = new Secure();
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/SpecialTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class SpecialTest extends AbstractRuleTest
{
public function setup()
public function setUp(): void
{
parent::setup();
$this->rule = new Special();
Expand Down

0 comments on commit de25bae

Please sign in to comment.