mirror of
https://github.com/silverstripe/silverstripe-testsession
synced 2024-10-22 14:06:00 +02:00
BUG Add a guard to prevent Behat runs from failing.
This commit is contained in:
parent
975e6bed56
commit
4d77dc6565
@ -278,10 +278,12 @@ class TestSessionEnvironment extends Object {
|
||||
}
|
||||
}
|
||||
|
||||
file_put_contents(
|
||||
$this->getFilePath(),
|
||||
json_encode($state, JSON_PRETTY_PRINT)
|
||||
);
|
||||
if (defined('JSON_PRETTY_PRINT')) {
|
||||
$content = json_encode($state, JSON_PRETTY_PRINT);
|
||||
} else {
|
||||
$content = json_encode($state);
|
||||
}
|
||||
file_put_contents($this->getFilePath(), $content);
|
||||
|
||||
$this->extend('onAfterApplyState');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user