Skip to content

Commit ddbb54a

Browse files
authored
Merge pull request #39 from maxleaver/master
Namespace compatibility for PHPUnit 6/DBUnit 3
2 parents 8558755 + 8d8127e commit ddbb54a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/bootstrap.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,15 @@
22

33
chdir(dirname(__DIR__));
44
require 'vendor/autoload.php';
5+
6+
// Backward compatibility for PHPUnit 4/5
7+
if (!class_exists('\PHPUnit\Framework\TestCase') &&
8+
class_exists('\PHPUnit_Framework_TestCase')) {
9+
class_alias('\PHPUnit_Framework_TestCase', 'PHPUnit\Framework\TestCase');
10+
}
11+
12+
// Backward compatibility for DBUnit 2
13+
if (!class_exists('\PHPUnit\DbUnit\TestCase') &&
14+
class_exists('\PHPUnit_Extensions_Database_TestCase')) {
15+
class_alias('\PHPUnit_Extensions_Database_TestCase', 'PHPUnit\DbUnit\TestCase');
16+
}

0 commit comments

Comments
 (0)