Skip to content

Commit 0d1e277

Browse files
authored
Bump phpunit and PSR standards (#72)
1 parent 561a5ee commit 0d1e277

File tree

7 files changed

+38
-37
lines changed

7 files changed

+38
-37
lines changed

.travis.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ language: php
22

33
matrix:
44
include:
5-
- php: 5.5.9
6-
dist: trusty
7-
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
8-
- php: 5.5
9-
dist: trusty
10-
- php: 5.6
11-
dist: xenial
125
- php: 7.0
136
dist: xenial
147
- php: 7.1
@@ -24,5 +17,5 @@ install:
2417
- travis_retry composer update ${COMPOSER_FLAGS}
2518

2619
script:
27-
- vendor/bin/phpcs --standard=psr2 src/
20+
- vendor/bin/phpcs --standard=psr12 src/
2821
- vendor/bin/phpunit

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=5.5.9",
15+
"php": "^7.0",
1616
"symfony/http-foundation": "~2.7|~3.0|~4.0|~5.0",
1717
"symfony/http-kernel": "~2.7|~3.0|~4.0|~5.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^5.0 || ^4.8.10",
20+
"phpunit/phpunit": "^6|^7|^8|^9",
2121
"squizlabs/php_codesniffer": "^3.5"
2222
},
2323
"autoload": {
2424
"psr-4": {
25-
"Asm89\\Stack\\": "src/Asm89/Stack/"
25+
"Asm89\\Stack\\": "src/"
2626
}
2727
},
2828
"autoload-dev": {
2929
"psr-4": {
30-
"Asm89\\Stack\\": "test/Asm89/Stack/"
30+
"Asm89\\Stack\\Tests\\": "tests/"
3131
}
3232
},
3333
"scripts": {

phpunit.xml.dist

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
>
1312
<testsuites>
1413
<testsuite name="Stack Cors Test Suite">
15-
<directory>./test/Asm89/</directory>
14+
<directory>./tests</directory>
1615
</testsuite>
1716
</testsuites>
1817

File renamed without changes.
File renamed without changes.

test/Asm89/Stack/CorsTest.php renamed to tests/CorsTest.php

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Asm89\Stack;
12+
namespace Asm89\Stack\Tests;
1313

14-
use PHPUnit_Framework_TestCase;
15-
use Symfony\Component\HttpKernel\HttpKernelInterface;
14+
use Asm89\Stack\Cors;
15+
use Asm89\Stack\CorsService;
16+
use PHPUnit\Framework\TestCase;
1617
use Symfony\Component\HttpFoundation\Request;
1718
use Symfony\Component\HttpFoundation\Response;
1819

19-
class CorsTest extends PHPUnit_Framework_TestCase
20+
class CorsTest extends TestCase
2021
{
2122
/**
2223
* @test
@@ -537,22 +538,3 @@ private function createStackedApp(array $options = array(), array $responseHeade
537538
return new Cors(new MockApp($responseHeaders), $passedOptions);
538539
}
539540
}
540-
541-
class MockApp implements HttpKernelInterface
542-
{
543-
private $responseHeaders;
544-
545-
public function __construct(array $responseHeaders)
546-
{
547-
$this->responseHeaders = $responseHeaders;
548-
}
549-
550-
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
551-
{
552-
$response = new Response();
553-
554-
$response->headers->add($this->responseHeaders);
555-
556-
return $response;
557-
}
558-
}

tests/MockApp.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Asm89\Stack\Tests;
4+
5+
use Symfony\Component\HttpFoundation\Request;
6+
use Symfony\Component\HttpFoundation\Response;
7+
use Symfony\Component\HttpKernel\HttpKernelInterface;
8+
9+
class MockApp implements HttpKernelInterface
10+
{
11+
12+
private $responseHeaders;
13+
14+
public function __construct(array $responseHeaders)
15+
{
16+
$this->responseHeaders = $responseHeaders;
17+
}
18+
19+
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
20+
{
21+
$response = new Response();
22+
23+
$response->headers->add($this->responseHeaders);
24+
25+
return $response;
26+
}
27+
}

0 commit comments

Comments
 (0)