public function testCRUD() { $dto = new OwnerDTO(); $dto->setEmail(self::EMAIL); $dto->setPassword(self::PASSWORD); $json = json_encode($dto); $this->curl->doPost($json); $data = $this->curl->getResultData(); $this->assertEquals(self::ID, $data->id); $this->assertEquals(self::EMAIL, $data->email); $this->assertNull($data->password); $this->curl->doGetId(self::ID); $data = $this->curl->getResultData(); $this->assertEquals(self::ID, $data->id); $this->assertEquals(self::EMAIL, $data->email); $this->assertNull($data->password); $dto->setId(self::ID); $dto->setEmail(self::EMAIL_ANOTHER); $json = json_encode($dto); $this->curl->doPut(self::ID, $json); $data = $this->curl->getResultData(); $this->assertEquals(self::ID, $data->id); $this->assertEquals(self::EMAIL_ANOTHER, $data->email); $this->assertNull($data->password); $this->curl->doDelete(self::ID); $this->curl->doGetId(self::ID); $data = $this->curl->getResultData(); $this->assertNull($data->id); $this->assertNull($data->email); $this->assertNull($data->password); }
public function testDelete() { $this->curl->doDelete(self::ID); $result = $this->curl->getResult(); $this->assertEquals('Controller\\TestController::delete', $result->message->method); $this->assertNull($result->data); $this->assertEquals('DELETE', $result->message->server->REQUEST_METHOD); }
public function testConnection() { $this->curl->doGet(); $result = $this->curl->getResult(); $info = $this->curl->getInfo(); $this->assertEquals('application/json', $info['content_type']); $this->assertEquals(400, $info['http_code']); $this->assertEquals(false, $result->success); $this->assertEquals(400, $result->statusCode); $this->assertEquals(Application::ERROR_WS_NOT_FOUND, $result->message); }