Skip to content

Commit

Permalink
Test enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k committed May 28, 2019
1 parent 9b23d3b commit fcea5cf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3

matrix:
include:
- php: hhvm
dist: trusty
- php: 5.3
dist: precise
allow_failures:
- php: hhvm

before_script:
- composer install --dev --prefer-dist --no-interaction
Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@
"php": "^5.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.5 || ^5.7"
"phpunit/phpunit": "^4.8 || ^5.7"
},
"autoload": {
"psr-0": { "JsonpCallbackValidator": "src/" }
"psr-0": {
"JsonpCallbackValidator": "src/"
}
},
"autoload-dev": {
"psr-4": {
"JsonpCallbackValidator\\Tests\\": "tests/"
}
}
}
11 changes: 8 additions & 3 deletions tests/JsonpCallbackValidatorTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php

class JsonpCallbackValidatorTest extends \PHPUnit_Framework_TestCase
namespace JsonpCallbackValidator\Tests;

use JsonpCallbackValidator;
use PHPUnit\Framework\TestCase;

class JsonpCallbackValidatorTest extends TestCase
{
const IS_VALID = true;

Expand All @@ -11,7 +16,7 @@ class JsonpCallbackValidatorTest extends \PHPUnit_Framework_TestCase
*/
public function testValidate($callback, $expected)
{
$validator = new \JsonpCallbackValidator();
$validator = new JsonpCallbackValidator();
$this->assertEquals($expected, $validator->validate($callback));
}

Expand Down Expand Up @@ -72,6 +77,6 @@ public static function dataProviderForTestValidate()

public function testCallStatically()
{
$this->assertTrue(\JsonpCallbackValidator::validate('foo'));
$this->assertTrue(JsonpCallbackValidator::validate('foo'));
}
}

0 comments on commit fcea5cf

Please sign in to comment.