public function testBuildingEntityWithoutParameters() { $response = $this->getMockBuilder('Buzz\\Message\\Response')->getMock(); $request = $this->getMockBuilder('Buzz\\Message\\Request')->getMock(); $client = $this->getMockBuilder('Buzz\\Client\\Curl')->getMock(); $entity = new ExternalRoute($response, $request, $client); $this->assertInstanceOf('Expressly\\Entity\\ExternalRoute', $entity->setMethod('GET')); $this->assertInstanceOf('Expressly\\Entity\\ExternalRoute', $entity->setHost('https://dev.expresslyapp.com/api/v2')); $this->assertInstanceOf('Expressly\\Entity\\ExternalRoute', $entity->setURI('/ping')); $this->assertInstanceOf('Expressly\\Entity\\ExternalRoute', $entity->setRules(array())); $this->assertInstanceOf('Expressly\\Entity\\ExternalRoute', $entity->setParameters(array())); $this->assertEquals('GET', $entity->getMethod()); $this->assertEquals('https://dev.expresslyapp.com/api/v2', $entity->getHost()); $this->assertEquals('/ping', $entity->getURI()); $this->assertEquals('https://dev.expresslyapp.com/api/v2/ping', $entity->getURL()); $this->assertEquals('https://dev.expresslyapp.com/api/v2/ping', (string) $entity); $this->assertInstanceOf('Buzz\\Message\\Response', $entity->process(function ($request) { })); $this->assertTrue($entity->isSuccessful()); }