コード例 #1
0
 function testSettingMultiplePropertiesOnCreation()
 {
     $R = new Request(array('method' => 'POST', 'content' => 'churva', 'headers' => array('foo' => 'bar')));
     $this->assertEquals('POST', $R->getMethod());
     $this->assertEquals('churva', $R->getContent());
     $this->assertEquals('bar', $R->getHeader('foo'));
 }
コード例 #2
0
 /**
  * @dataProvider dataArgsPasssingToNegotiator
  */
 function testArgsPasssingToNegotiator($resource_name, $request_options, $files, $available_types)
 {
     foreach ($files as $file) {
         $this->TFM->newFile($file, '');
     }
     $request = new Request($request_options);
     $this->content_negotiator->expects($this->once())->method('negotiateFormat')->with($request->getHeader('Accept'), $available_types);
     $this->RT->locateFor($resource_name, $request);
 }