Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .circleci/config.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches:
- "1.0"
pull_request:
branches:
- "1.0"

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.2"
- "8.3"
- "8.4"
- "8.5"

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
extensions: apcu
ini-values: apc.enable_cli=1

- name: Composer install
run: composer install

- name: PHPUnit
run: vendor/bin/phpunit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor
/composer.lock
/.phpunit.result.cache
13 changes: 11 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,21 @@
},
"require-dev": {
"php": ">=7.0",
"phpunit/phpunit": "~6.3",
"satooshi/php-coveralls": "~0"
"phpunit/phpunit": "^9.6"
},
"autoload": {
"psr-4": {
"Packaged\\Dispatch\\": "src"
}
},
"config": {
"audit": {
"block-insecure": false
},
"policy": {
"advisories": {
"block": false
}
}
}
}
6 changes: 2 additions & 4 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
strict="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite>
<testsuite name="dispatch">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
</phpunit>
2 changes: 1 addition & 1 deletion tests/AssetResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testResponse()
$response = $builder->createResponse($asset, $request);

$this->assertEquals('text/css', $response->headers->get('Content-Type'));
$this->assertContains('background:blue', (string)$response);
$this->assertStringContainsString('background:blue', (string)$response);
$this->assertInstanceOf(
'\Symfony\Component\HttpFoundation\Response',
$response
Expand Down
2 changes: 1 addition & 1 deletion tests/DispatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testUrls($config, $path, $host, $expect)

$dispatcher = new \Packaged\Dispatch\Dispatch(new DummyKernel(), $config);
$resp = $dispatcher->handle($request);
$this->assertContains($expect, $resp->getContent());
$this->assertStringContainsString($expect, $resp->getContent());
}

public function urlProvider()
Expand Down
4 changes: 2 additions & 2 deletions tests/PathSecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PathSecurityTest extends TestCase
{
private $root;

protected function setUp()
protected function setUp(): void
{
$this->root = sys_get_temp_dir() . '/dispatch-security-' . uniqid();
foreach(['resources/nested', 'public', 'src', 'vendor/acme/package', 'resources-private'] as $dir)
Expand All @@ -29,7 +29,7 @@ protected function setUp()
symlink($this->root . '/absent', $this->root . '/resources/broken.css');
}

protected function tearDown()
protected function tearDown(): void
{
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($this->root, FilesystemIterator::SKIP_DOTS),
Expand Down
Loading