static function create($values) { self::$unique_key = self::$unique_key + 1; $values = array_merge(array('uid' => 1, 'api_key' => md5(self::$unique_key), 'api_secret' => 'api_secret', 'enabled' => true), $values); $dao = new ApiKeys_ApiKeyDao(Database::obtain()); $struct = new ApiKeys_ApiKeyStruct($values); return $dao->create($struct); }
private function prepareUserAndKey() { $this->test_data->user = Factory_User::create(); $this->test_data->api_key = Factory_ApiKey::create(array('uid' => $this->test_data->user->uid)); }
private function prepareUserAndApiKey() { $this->test_data->user = Factory_User::create(); $this->test_data->api_key = Factory_ApiKey::create(array('uid' => $this->test_data->user->uid)); $this->test_data->headers = array("X-MATECAT-KEY: {$this->test_data->api_key->api_key}", "X-MATECAT-SECRET: {$this->test_data->api_key->api_secret}"); }