Example #1
0
 public function testPropStatusResponse()
 {
     $props = array(200 => array(new Property('D:displayname', 'Example resource'), new Property('R:author', 'J.J. Johnson')), 403 => array(new Property('R:DingALing'), new Property('R:Random')));
     $response = new Response('http://www.foo.bar/file', $props, 'Example description');
     $this->assertEquals(Response::PROPSTATUS, $response->getType());
     $this->assertEquals(array('D:displayname', 'R:author'), $response->getPropertyNames());
     $this->assertEquals(array('R:DingALing', 'R:Random'), $response->getPropertyNames(403));
     $this->assertEquals('Example description', $response->getDescription());
     $this->assertEquals('http://www.foo.bar/file', $response->getHref());
     $this->assertCount(0, $response->getPropertyNames(404));
 }