public function setEndpoint($name, Endpoint $endpoint) { $this->endpoints[$name] = $endpoint; switch ($endpoint->getHttpMethod()) { case Http::GET: $this->get($endpoint->getPath(), $endpoint->getHandlerMethod()); break; case Http::POST: $this->post($endpoint->getPath(), $endpoint->getHandlerMethod()); break; case Http::PUT: $this->put($endpoint->getPath(), $endpoint->getHandlerMethod()); break; case Http::DELETE: $this->delete($endpoint->getPath(), $endpoint->getHandlerMethod()); break; } return $this; }
public function testPath() { $this->assertEquals($this->endpoint->getPath(), '/all'); }