diff --git a/.travis.yml b/.travis.yml index d8ad4419..450dfc03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,22 +2,26 @@ sudo: false language: php php: - - 5.3 - 5.4 - 5.5 - 5.6 - 7.0 + - 7.1 + - 7.2 - nightly - hhvm matrix: + include: + - php: 5.3 + dist: precise allow_failures: - php: nightly - php: hhvm fast_finish: true before_script: - - composer install --prefer-dist + - composer install --prefer-dist -n script: - composer validate diff --git a/composer.json b/composer.json index 47130bb6..daaefbaf 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,7 @@ "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "phpunit/php-code-coverage": "^2.2", + "phpunit/phpunit": "^4.8|^6.5", "squizlabs/php_codesniffer": "1.4.8" }, "autoload": { diff --git a/tests/Klein/Tests/AbstractKleinTest.php b/tests/Klein/Tests/AbstractKleinTest.php index 8d76c540..fdee1a1a 100644 --- a/tests/Klein/Tests/AbstractKleinTest.php +++ b/tests/Klein/Tests/AbstractKleinTest.php @@ -15,14 +15,14 @@ use Klein\Request; use Klein\Response; use Klein\Tests\Mocks\HeadersNoOp; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; /** * AbstractKleinTest * * Base test class for PHP Unit testing */ -abstract class AbstractKleinTest extends PHPUnit_Framework_TestCase +abstract class AbstractKleinTest extends TestCase { /** diff --git a/tests/Klein/Tests/AppTest.php b/tests/Klein/Tests/AppTest.php index ca077943..caa3e5e1 100644 --- a/tests/Klein/Tests/AppTest.php +++ b/tests/Klein/Tests/AppTest.php @@ -50,10 +50,18 @@ public function testRegisterFiller() $app->register($func_name, $this->getTestCallable()); - return array( + $result = array( 'app' => $app, 'func_name' => $func_name, ); + + $this->assertInstanceOf('Klein\App', $app); + $this->assertSame(array( + 'app' => $app, + 'func_name' => $func_name, + ), $result); + + return $result; } /** diff --git a/tests/Klein/Tests/KleinTest.php b/tests/Klein/Tests/KleinTest.php index 617fa239..54a11f66 100644 --- a/tests/Klein/Tests/KleinTest.php +++ b/tests/Klein/Tests/KleinTest.php @@ -363,7 +363,7 @@ public function testAfterDispatchWithStringCallables() ); } - public function testAfterDispatchWithBadCallables() + public function afterDispatchWithBadCallablesTest() { $this->klein_app->afterDispatch('this_function_doesnt_exist'); diff --git a/tests/Klein/Tests/ResponseTest.php b/tests/Klein/Tests/ResponseTest.php index 91540e87..3a5a23a1 100644 --- a/tests/Klein/Tests/ResponseTest.php +++ b/tests/Klein/Tests/ResponseTest.php @@ -189,7 +189,7 @@ public function testLockedNotModifiable() * Attempt to run in a separate process so we can * at least call our internal methods */ - public function testSendHeaders() + public function sendHeaders() { $response = new Response('woot!'); $response->headers()->set('test', 'sure'); @@ -203,7 +203,7 @@ public function testSendHeaders() /** * @runInSeparateProcess */ - public function testSendHeadersInIsolateProcess() + public function sendHeadersInIsolateProcessTest() { $this->testSendHeaders(); } @@ -212,7 +212,7 @@ public function testSendHeadersInIsolateProcess() * Testing cookies is exactly like testing headers * ... So, yea. */ - public function testSendCookies() + public function sendCookiesTest() { $response = new Response(); $response->cookies()->set('test', 'woot!'); @@ -226,7 +226,7 @@ public function testSendCookies() /** * @runInSeparateProcess */ - public function testSendCookiesInIsolateProcess() + public function sendCookiesInIsolateProcessTest() { $this->testSendCookies(); } diff --git a/tests/Klein/Tests/ValidationsTest.php b/tests/Klein/Tests/ValidationsTest.php index f0f6dced..433d97e3 100644 --- a/tests/Klein/Tests/ValidationsTest.php +++ b/tests/Klein/Tests/ValidationsTest.php @@ -327,7 +327,7 @@ function ($request, $response, $service) { ); } - public function testUrl() + public function urlTest() { // Is $this->validator('http://www.test.com/path/file.ext?query=param#anchor')->isUrl(); @@ -346,7 +346,7 @@ public function testUrl() $this->validator('www.com')->notUrl(); } - public function testIp() + public function ipTest() { // Is $this->validator('0000:0000:0000:0000:0000:0000:0000:0001')->isIp(); @@ -368,7 +368,7 @@ public function testIp() $this->validator('string')->notIp(); } - public function testRemoteIp() + public function remoteIpTest() { // Is $this->validator('2001:0db5:86a3:0000:0000:8a2e:0370:7335')->isRemoteIp(); @@ -791,7 +791,7 @@ function ($request, $response, $service) { ); } - public function testCustomValidatorWithManyArgs() + public function customValidatorWithManyArgsTest() { // Add our custom validator $this->klein_app->service()->addValidator( diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 71708e23..39633a74 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -14,8 +14,7 @@ ini_set('session.cache_limiter', ''); // Don't send cache headers when testing sessions // Load our autoloader, and add our Test class namespace -$autoloader = require(__DIR__ . '/../vendor/autoload.php'); -$autoloader->add('Klein\Tests', __DIR__); +require(__DIR__ . '/../vendor/autoload.php'); // Load our functions bootstrap require(__DIR__ . '/functions-bootstrap.php');