Skip to content

Commit bcfc2dd

Browse files
committed
Fixed PHPUnit <5.2 tests
1 parent 026a23e commit bcfc2dd

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"php": ">=5.4.0"
3333
},
3434
"require-dev": {
35-
"phpunit/phpunit": ">=4.0",
35+
"phpunit/phpunit": "~4 || ~5",
3636
"codeclimate/php-test-reporter": ">=0.2.0"
3737
},
3838
"support": {

tests/InvalidFormatTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
namespace vipnytt\UserAgentParser\Tests;
1010

1111
use vipnytt\UserAgentParser;
12-
use vipnytt\UserAgentParser\Exceptions\FormatException;
1312

1413
/**
1514
* Class InvalidFormatTest
@@ -19,17 +18,14 @@
1918
class InvalidFormatTest extends \PHPUnit_Framework_TestCase
2019
{
2120
/**
21+
* @requires PHPUnit 5.2
2222
* @dataProvider generateDataForTest
2323
* @param string $product
2424
* @param int|string|null $version
2525
*/
2626
public function testInvalidFormat($product, $version)
2727
{
28-
if (PHP_VERSION_ID < 50600) {
29-
$this->markTestSkipped();
30-
return;
31-
}
32-
$this->expectException(FormatException::class);
28+
$this->expectException(UserAgentParser\Exceptions\FormatException::class);
3329
new UserAgentParser($product, $version);
3430
}
3531

tests/TruncateInvalidTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@
1818
class TruncateInvalidTest extends \PHPUnit_Framework_TestCase
1919
{
2020
/**
21+
* @requires PHPUnit 5.2
2122
* @dataProvider generateDataForTest
2223
* @param string $product
2324
* @param int|string|null $version
2425
*/
2526
public function testTruncateInvalid($product, $version)
2627
{
27-
if (PHP_VERSION_ID < 50600) {
28-
$this->markTestSkipped();
29-
return;
30-
}
3128
$this->expectException(\PHPUnit_Framework_Error_Warning::class);
3229
new UserAgentParser($product, $version);
3330
}

0 commit comments

Comments
 (0)