From 1d1186c973db3771302067ef86c63a43acccff1c Mon Sep 17 00:00:00 2001 From: Sherwin H Date: Fri, 26 Apr 2019 16:31:52 -0700 Subject: [PATCH] test: add function to make namespaces backwards compatible between different versions of PHPUnit --- tests/Imgix/Tests/UrlBuilderTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Imgix/Tests/UrlBuilderTest.php b/tests/Imgix/Tests/UrlBuilderTest.php index 874c212..6e5dcda 100644 --- a/tests/Imgix/Tests/UrlBuilderTest.php +++ b/tests/Imgix/Tests/UrlBuilderTest.php @@ -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