public function testExport() { if (self::$response0->getStatus() == 201) { self::$client->resetParameters(); //self::$client->setUri(BASE_URI_ . '/public/api/find-concepts?q=prefLabel:' . self::$prefLabel); //$response = self::$client->request(Zend_Http_Client::GET); //!!! it used to be self::$uuid!!! $response = RequestResponse::ExportRequest(self::$client, self::$about, dirname(__DIR__) . '/OpenSkos2/ExportTest.xml'); if ($response->getStatus() != 200) { Logging::failureMessaging($response, "export concept"); } $this->AssertEquals(200, $response->getStatus()); var_dump($response->GetBody()); $this->assertions($response); } else { Logging::failureMessaging(self::$response0, "create test concept"); } }
public function testDeleteCandidate() { print "\n deleting concept with candidate status ..."; if (self::$response0C->getStatus() === 201) { $response = RequestResponse::DeleteRequest(self::$client, self::$aboutC); if ($response->getStatus() !== 202) { Logging::failureMessaging($response, "delete candidate concept"); } $this->AssertEquals(202, $response->getStatus()); self::$client->setUri(BASE_URI_ . '/public/api/concept?id=' . self::$uuidC); $responseCheck = self::$client->request('GET'); if ($responseCheck->getStatus() !== 410) { print "\n getting deleted concept has status " . $responseCheck->getStatus(); print "\n with the message " . $responseCheck->getMessage(); } $this->AssertEquals(410, $responseCheck->getStatus()); } }
public static function deleteConcepts($abouts, $client) { foreach ($abouts as $about) { if ($about != null) { $response = RequestResponse::DeleteRequest($client, $about); if ($response->getStatus() !== 202 && $response->getStatus() !== 200) { Logging::failureMessaging($response, 'deleting test concept ' . $about); } } } }
private function resultMessaging($response) { if ($response->getStatus() == 201) { print "\n Hosanna: a concept is created! \n"; print "\n HTTPResponseHeader-Location: " . $response->getHeader('Location') . "\n"; } else { Logging::failureMessaging($response, 'create concept'); } }
public function testAutocompleteFormatHTML() { print "\n testAutocomplete search pref Label"; if (self::$success) { $word = self::$labelMap[PREF_LABEL] . self::$prefs[1]; // prefLabel<someuuid>a. $response = RequestResponse::AutocomleteRequest(self::$client, $word, "?format=html"); if ($response->getStatus() != 200) { Logging::failureMessaging($response, 'autocomplete on word ' . $word . "?format=html"); } $this->AssertEquals(200, $response->getStatus()); // todo: add some chek when it becomes clear how the output looks like } else { print "\n Cannot perform the test because something is wrong with creating test concepts, see above. \n "; } }