Skip to content

Commit

Permalink
Merge pull request #6 from BaguettePHP/replace-phpunit
Browse files Browse the repository at this point in the history
Replace PHPUnit
  • Loading branch information
zonuexe committed Jul 31, 2023
2 parents 59dacff + 6b0b179 commit 556ceaf
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 65,985 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Expand Up @@ -7,7 +7,5 @@
build/ export-ignore
docs/ export-ignore
phpdox.xml* export-ignore
phpunit -crlf -diff
phpunit export-ignore
phpunit.xml* export-ignore
tests/ export-ignore
31 changes: 31 additions & 0 deletions .github/workflows/CI.yml
@@ -0,0 +1,31 @@
name: CI

on:
push:
paths-ignore:
- '**/*.md'

jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer
extensions: intl, mbstring

- name: Setup Composer
run: 'composer install'

- name: Run tests
run: './vendor/bin/phpunit'
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,3 +8,4 @@
/.idea
/*.iml
/*.tar
.phpunit.result.cache
28 changes: 0 additions & 28 deletions .scrutinizer.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions composer.json
Expand Up @@ -15,6 +15,8 @@
"zonuexe/objectsystem": "~0.5|~0.6"
},
"require-dev": {
"phpunit/phpunit": "^8.5|^7.5|^4.8",
"yoast/phpunit-polyfills": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -29,5 +31,8 @@
"scripts": {
"doc": "apigen generate",
"test": "php phpunit"
},
"config": {
"sort-packages": true
}
}
65,924 changes: 0 additions & 65,924 deletions phpunit

This file was deleted.

2 changes: 1 addition & 1 deletion tests/ActionTest.php
Expand Up @@ -7,7 +7,7 @@
* @copyright 2016 BaguetteHQ
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
*/
final class ActionTest extends \PHPUnit_Framework_TestCase
final class ActionTest extends TestCase
{
/**
* @dataProvider dataProviderFor_match
Expand Down
8 changes: 5 additions & 3 deletions tests/RouterTest.php
Expand Up @@ -7,13 +7,15 @@
* @copyright 2016 BaguetteHQ
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
*/
final class RouterTest extends \PHPUnit_Framework_TestCase
final class RouterTest extends TestCase
{
private static $router;
private static $route_map;

public static function setUpBeforeClass()
public static function set_up_before_class()
{
parent::set_up_before_class();

$re_user = '/^@([-A-Za-z]{3,15})$/';
$re_id = '/^\d+$/';
self::$route_map = [
Expand Down Expand Up @@ -136,7 +138,7 @@ public function dataProviderFor_makePath()
*/
public function test_makePath_throws_DomainException($expected, $name, array $param)
{
$this->setExpectedException('\DomainException', $expected);
$this->expectException('\DomainException', $expected);
$this->assertEquals($expected, self::$router->makePath($name, $param, true));
}

Expand Down
9 changes: 9 additions & 0 deletions tests/TestCase.php
@@ -0,0 +1,9 @@
<?php

namespace Teto\Routing;

use Yoast\PHPUnitPolyfills\TestCases\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
}

0 comments on commit 556ceaf

Please sign in to comment.