Example #1
0
 /**
  * Test setting body in JSON format
  */
 public function testRepresentJson()
 {
     $this->model->setHeader('Content-Type', 'text/javascript');
     $this->model->representJson('json_string');
     $this->assertEquals('application/json', $this->model->getHeader('Content-Type')->getFieldValue());
     $this->assertEquals('json_string', $this->model->getBody('default'));
 }
 /**
  * {@inheritdoc}
  */
 public function getBody()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getBody');
     if (!$pluginInfo) {
         return parent::getBody();
     } else {
         return $this->___callPlugins('getBody', func_get_args(), $pluginInfo);
     }
 }