diff --git a/src/TestSessionEnvironment.php b/src/TestSessionEnvironment.php index 0a729e3..1b9fb1f 100644 --- a/src/TestSessionEnvironment.php +++ b/src/TestSessionEnvironment.php @@ -529,7 +529,10 @@ class TestSessionEnvironment public function getState() { $path = Director::getAbsFile($this->getFilePath()); - return (file_exists($path ?? '')) ? json_decode(file_get_contents($path)) : new stdClass; + if (file_exists($path ?? '')) { + return json_decode(file_get_contents($path)) ?: new stdClass; + } + return new stdClass; } /**