/var/www/vhosts/nabawater/vendor/codeception/base/src/Codeception
NameSizeModeActions
Command/-0775rm
Coverage/-0775rm
Event/-0775rm
Exception/-0775rm
Lib/-0775rm
Module/-0775rm
Step/-0775rm
Subscriber/-0775rm
Template/-0775rm
Test/-0775rm
Util/-0775rm
Actor.php11540664editdlrm
Application.php54020664editdlrm
Codecept.php75500664editdlrm
Configuration.php243270664editdlrm
CustomCommandInterface.php1980664editdlrm
Events.php36510664editdlrm
Example.php25740664editdlrm
Extension.php32730664editdlrm
GroupObject.php6690664editdlrm
InitTemplate.php69120664editdlrm
Module.php84930664editdlrm
README.md4270664editdlrm
Scenario.php43450664editdlrm
Snapshot.php31050664editdlrm
Step.php102650664editdlrm
Suite.php19900664editdlrm
SuiteManager.php77080664editdlrm
TestInterface.php1980664editdlrm
Edit: /var/www/vhosts/nabawater/vendor/codeception/base/src/Codeception/Snapshot.php (3105B)
assertEquals($this->dataSet, $data, 'Snapshot doesn\'t match real data'); } /** * Loads data set from file. */ protected function load() { if (!file_exists($this->getFileName())) { return; } $this->dataSet = json_decode(file_get_contents($this->getFileName())); if (!$this->dataSet) { throw new ContentNotFound("Loaded snapshot is empty"); } } /** * Saves data set to file */ protected function save() { file_put_contents($this->getFileName(), json_encode($this->dataSet)); } /** * If no filename is defined, generates one from class name * * @return string */ protected function getFileName() { if (!$this->fileName) { $this->fileName = preg_replace('/\W/', '.', get_class($this)) . '.json'; } return codecept_data_dir() . $this->fileName; } /** * Performs assertion for data sets */ public function assert() { // fetch data $data = $this->fetchData(); if (!$data) { throw new ContentNotFound("Fetched snapshot is empty."); } $this->load(); if (!$this->dataSet) { $this->printDebug('Snapshot is empty. Updating snapshot...'); $this->dataSet = $data; $this->save(); return; } try { $this->assertData($data); $this->printDebug('Data matches snapshot'); } catch (AssertionFailedError $exception) { $this->printDebug('Snapshot assertion failed'); if (!is_bool($this->refresh)) { $confirm = Debug::confirm('Should we update snapshot with fresh data? (Y/n) '); } else { $confirm = $this->refresh; } if ($confirm) { $this->dataSet = $data; $this->save(); $this->printDebug('Snapshot data updated'); return; } $this->fail($exception->getMessage()); } } /** * Force update snapshot data. * * @param bool $refresh */ public function shouldRefreshSnapshot($refresh = true) { $this->refresh = $refresh; } private function printDebug($message) { Debug::debug(get_class($this) . ': ' . $message); } }