Example #1
0
 /**
  * Test replacing the whole path with one derived from a class method
  * annotation.
  *
  * @return void
  * @todo
  */
 public function testPathFromResourceMethodAnnotation()
 {
     $request = $this->buildMockRequest('/test/example/', array('host' => 'example.com'));
     $routeOptions = array(array('resourceClassName' => 'Sonno\\Test\\Http\\Uri\\Asset\\TestResource', 'resourceClassMethod' => 'getEntity', 'path' => '/testresource/{id}', 'classPath' => '/testresource'));
     $config = $this->buildMockConfiguration($routeOptions, '/test/');
     $builder = new UriBuilder($config, $request);
     $uri = $builder->resourcePath('Sonno\\Test\\Http\\Uri\\Asset\\TestResource', 'getEntity')->build();
     $this->assertEquals('http://example.com/test/example/testresource', $uri);
 }