className = 'ezcWebdavPropFindRequest'; $this->constructorArguments = array( '/foo', '/bar' ); $this->defaultValues = array( 'allProp' => false, 'propName' => false, 'prop' => null, ); $this->workingValues = array( 'allProp' => array( true, false, ), 'propName' => array( true, false, ), 'prop' => array( new ezcWebdavBasicPropertyStorage(), null ), ); $this->failingValues = array( 'allProp' => array( 23, 23.34, 'foo bar', array( 23, 42 ), new stdClass(), ), 'propName' => array( 23, 23.34, 'foo bar', array( 23, 42 ), new stdClass(), ), 'prop' => array( 23, 23.34, 'foo bar', true, false, new stdClass(), array( 23, 42), ), ); } public function testValidateHeadersSuccess() { $req = new ezcWebdavPropFindRequest( '/foo', '/bar' ); $req->setHeader( 'Depth', ezcWebdavPropFindRequest::DEPTH_ONE ); $req->validateHeaders(); $req->setHeader( 'Depth', ezcWebdavPropFindRequest::DEPTH_INFINITY ); $req->validateHeaders(); $req->setHeader( 'Depth', ezcWebdavPropFindRequest::DEPTH_ZERO ); $req->validateHeaders(); } public function testValidateHeadersFailure() { $req = new ezcWebdavPropFindRequest( '/foo', '/bar' ); $req->setHeader( 'Depth', null ); try { $req->validateHeaders(); $this->fail( 'Exception not thrown on missing Depth header.' ); } catch ( ezcWebdavMissingHeaderException $e ) {} $req->setHeader( 'Depth', 'A' ); try { $req->validateHeaders(); $this->fail( 'Exception not thrown on invalid Depth header.' ); } catch ( ezcWebdavInvalidHeaderException $e ) {} } } ?>