From 6d49c754acac1c950c037481521bae510157f2d5 Mon Sep 17 00:00:00 2001 From: Russell Michell Date: Mon, 30 Apr 2018 21:52:58 +1200 Subject: [PATCH] FIX: Added parent::__construct to tests. Patched path to YML fixture. --- tests/JSONTextBasicTest.php | 2 ++ tests/JSONTextExtensionTest.php | 14 +++++++++++++- tests/JSONTextIntegrationTest.php | 4 +++- tests/JSONTextQueryTest.php | 2 ++ tests/JSONTextSetValueTest.php | 2 ++ tests/JSONTextTest.php | 2 ++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/JSONTextBasicTest.php b/tests/JSONTextBasicTest.php index 02ee736..d1066ea 100755 --- a/tests/JSONTextBasicTest.php +++ b/tests/JSONTextBasicTest.php @@ -36,6 +36,8 @@ public function __construct() foreach($this->fixtures as $name => $path) { $this->fixtures[$name] = realpath(__DIR__) . '/' . $path; } + + parent::__construct(); } /** diff --git a/tests/JSONTextExtensionTest.php b/tests/JSONTextExtensionTest.php index f258666..8a8d4a0 100644 --- a/tests/JSONTextExtensionTest.php +++ b/tests/JSONTextExtensionTest.php @@ -23,7 +23,19 @@ class JSONTextExtensionTest extends FunctionalTest /** * @var string */ - protected static $fixture_file = 'jsontext/tests/fixtures/yml/JSONTextExtension.yml'; + protected static $fixture_file; + + /** + * Modifies fixtures property to be able to run on PHP <5.6 without use of constant in class property which 5.6+ allows + */ + public function __construct() + { + $dir = realpath(__DIR__); + + self::$fixture_file = $dir . '/fixtures/yml/JSONTextExtension.yml'; + + parent::__construct(); + } /** * Is an exception thrown when no POSTed vars are available for diff --git a/tests/JSONTextIntegrationTest.php b/tests/JSONTextIntegrationTest.php index 1576f93..97392d4 100755 --- a/tests/JSONTextIntegrationTest.php +++ b/tests/JSONTextIntegrationTest.php @@ -16,7 +16,7 @@ class JSONTextIntegrationTest extends SapphireTest /** * @var string */ - protected static $fixture_file = '/fixtures/yml/MyAwesomeJSONModel.yml'; + protected static $fixture_file; /** * Modifies fixtures property to be able to run on PHP <5.6 without use of constant in class property which 5.6+ allows @@ -26,6 +26,8 @@ public function __construct() $dir = realpath(__DIR__); self::$fixture_file = $dir . '/fixtures/yml/MyAwesomeJSONModel.yml'; + + parent::__construct(); } /** diff --git a/tests/JSONTextQueryTest.php b/tests/JSONTextQueryTest.php index 88fe803..d125431 100755 --- a/tests/JSONTextQueryTest.php +++ b/tests/JSONTextQueryTest.php @@ -42,6 +42,8 @@ public function __construct() foreach($this->fixtures as $name => $path) { $this->fixtures[$name] = realpath(__DIR__) . '/' . $path; } + + parent::__construct(); } /** diff --git a/tests/JSONTextSetValueTest.php b/tests/JSONTextSetValueTest.php index 7e88ccd..14fc93d 100755 --- a/tests/JSONTextSetValueTest.php +++ b/tests/JSONTextSetValueTest.php @@ -30,6 +30,8 @@ public function __construct() foreach($this->fixtures as $name => $path) { $this->fixtures[$name] = realpath(__DIR__) . '/' . $path; } + + parent::__construct(); } /** diff --git a/tests/JSONTextTest.php b/tests/JSONTextTest.php index f6957a4..6f956eb 100755 --- a/tests/JSONTextTest.php +++ b/tests/JSONTextTest.php @@ -33,6 +33,8 @@ public function __construct() foreach($this->fixtures as $name => $path) { $this->fixtures[$name] = realpath(__DIR__) . '/' . $path; } + + parent::__construct(); } /**