Skip to content

Commit 4ccd10b

Browse files
committed
Nasty work around for testing over multiple PHPUnit versions
1 parent 0c66426 commit 4ccd10b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"require": {
66
"php": "^5.0 || ^7.0"
77
},
8+
"require-dev": {
9+
"phpunit/phpunit": "~4.8|~5.7"
10+
},
811
"autoload": {
912
"psr-0" : {
1013
"violuke\\Barcodes" : "src"

tests/BarcodeValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use violuke\Barcodes\BarcodeValidator;
66

77
// Nasty work around for testing over multiple PHPUnit versions
8-
if (!class_exists('PHPUnit_Framework_TestCase')) {
9-
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase {}
8+
if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
9+
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
1010
}
1111

1212
class BarcodeValidatorTest extends \PHPUnit_Framework_TestCase

0 commit comments

Comments
 (0)