public function testCoreUpdate() { $data = DM\Core::update(array('name' => $this->testCoreName, 'cfg' => '{"db_user": "******"}', 'active' => 0)); $data = DM\Core::read($this->testCoreName); $this->assertArraySubset(array('name' => $this->testCoreName, 'cfg' => array("db_user" => "root"), 'active' => 0), $data); }
/** * get core config stored in casebox.cores table * * @return array */ public static function getPlatformConfigForCore($coreName) { $rez = array(); $r = DM\Core::read($coreName); if (isset($r['cfg'])) { $rez = $r['cfg']; $rez['core_id'] = $r['id']; $rez['core_status'] = $r['active']; } else { trigger_error("ERROR: Config::getPlatformConfigForCore(" . $coreName . ") cfg=" . print_r($r, true), E_USER_WARNING); // throw new \Exception('Error getting core config', 1); } return $rez; }