Skip to content

Commit

Permalink
test: add function to make namespaces backwards compatible between di…
Browse files Browse the repository at this point in the history
…fferent versions of PHPUnit
  • Loading branch information
Sherwin H committed Apr 26, 2019
1 parent 7446ba0 commit 1d1186c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Imgix/Tests/UrlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@

class UrlBuilderTest extends \PHPUnit\Framework\TestCase {

private function testBackwardsCompatibility(){
// There is a difference in namespace structure
// between different version of PHPUnit.
// This will perform any aliasing needed to support
// backwards compatibility.
if (!class_exists('\PHPUnit\Framework\TestCase') && class_exists('\PHPUnit_Framework_TestCase')) {
class_alias('\PHPUnit_Framework_TestCase', 'PHPUnit\Framework\TestCase');
}
assertTrue(true);
}

public function testURLBuilderRaisesExceptionOnNoDomains() {
// Because PHP treats warnings the same as exceptions,
// they will be temporarily disabled in certain cases
Expand Down

0 comments on commit 1d1186c

Please sign in to comment.