Skip to content

Commit

Permalink
FIX: Added parent::__construct to tests. Patched path to YML fixture.
Browse files Browse the repository at this point in the history
  • Loading branch information
phptek committed Apr 30, 2018
1 parent 81e087b commit 6d49c75
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/JSONTextBasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public function __construct()
foreach($this->fixtures as $name => $path) {
$this->fixtures[$name] = realpath(__DIR__) . '/' . $path;
}

parent::__construct();
}

/**
Expand Down
14 changes: 13 additions & 1 deletion tests/JSONTextExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/JSONTextIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,6 +26,8 @@ public function __construct()
$dir = realpath(__DIR__);

self::$fixture_file = $dir . '/fixtures/yml/MyAwesomeJSONModel.yml';

parent::__construct();
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/JSONTextQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public function __construct()
foreach($this->fixtures as $name => $path) {
$this->fixtures[$name] = realpath(__DIR__) . '/' . $path;
}

parent::__construct();
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/JSONTextSetValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function __construct()
foreach($this->fixtures as $name => $path) {
$this->fixtures[$name] = realpath(__DIR__) . '/' . $path;
}

parent::__construct();
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/JSONTextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public function __construct()
foreach($this->fixtures as $name => $path) {
$this->fixtures[$name] = realpath(__DIR__) . '/' . $path;
}

parent::__construct();
}

/**
Expand Down

0 comments on commit 6d49c75

Please sign in to comment.