Exemplo n.º 1
0
 public function testContent()
 {
     $content = array('fieldOne' => 'valueOne', 'fieldTwo' => 'valueTwo');
     $this->request->setContent($content);
     $this->assertEquals($content, $this->request->getContent());
 }
Exemplo n.º 2
0
 /**
  * @dataProvider createRequest
  *
  * @param \BedRest\Rest\Request\Request $request
  */
 public function testRestPost(Request $request)
 {
     $content = $request->getContent();
     $event = new Event();
     $event->setRequest($request);
     $this->service->restPost($event);
     $data = $event->getData();
     $this->assertInternalType('array', $data);
     $this->assertNotNull($data['id']);
     $this->assertEquals($content['name'], $data['name']);
 }