public function testUpdateStorage() { $a = ['name' => 'Newerlands peso', 'iso_code' => 'NPS', 'is_main' => 1, 'format_string' => '# pps.', 'intl_formatting' => 0]; $c = new Currency(); $c->setDefaults(); $c->setAttributes($a); FunctionalHelper::flushStorage($c->getStorage()); CurrencyStorageHelper::updateStorage($c); $this->assertFileExists($c->getStorage()); $curr = []; if (true === file_exists($c->getStorage())) { $curr = (include $c->getStorage()); } $this->assertNotEmpty($curr); $this->assertCount(1, $curr); $this->assertArrayHasKey($a['name'], $curr); FunctionalHelper::flushStorage($c->getStorage()); }