Example #1
0
 /**
  * @covers Paradox\Client::listAQLFunctions
  */
 public function testListAQLFunctions()
 {
     $action = "function () { return 'hello'; }";
     $result = $this->client->createAQLFunction("paradoxtest1::helloworld", $action);
     $result = $this->client->createAQLFunction("paradoxtest2::helloworld", $action);
     $registered = $this->client->listAQLFunctions("paradoxtest1");
     $this->assertCount(1, $registered, "There should only be one paradoxtest function");
     $this->assertArrayHasKey("paradoxtest1::helloworld", $registered, "The AQL function was not registered");
     $registered = $this->client->listAQLFunctions("paradoxtest2");
     $this->assertCount(1, $registered, "There should only be one paradoxtest function");
     $this->assertArrayHasKey("paradoxtest2::helloworld", $registered, "The AQL function was not registered");
     $this->client->deleteAQLFunction("paradoxtest1::helloworld");
     $this->client->deleteAQLFunction("paradoxtest2::helloworld");
     $registered = $this->client->listAQLFunctions("paradoxtest1");
     $this->assertEmpty($registered, "The AQL function was not deleted");
     $registered = $this->client->listAQLFunctions("paradoxtest2");
     $this->assertEmpty($registered, "The AQL function was not deleted");
 }