JSON data error-PHP -
am trying run below mentioned php code, errors out.
php code:
<?php public function setup() { parent::setup(); $this->citationstyles = $this->sm->get('citationstyleconversion\model\citationstyles'); $this->resettestdata(); } public function testsubmitactioncannotbeaccessedloggedout() { $this->dispatch($this->buildquery('submit', array(), false)); $this->assertresponsestatuscode(403); } public function testsubmitaction() { $stylemap = $this->citationstyles->getstylemap(); $keys = array_keys($stylemap); $data = array( 'filename' => "testfile.txt", 'filecontent' => base64_encode('test content'), 'citationstylehash' => $keys[0], ); $this->dispatch($this->buildquery('submit', $data)); $this->assertresponsestatuscode(200); $response = json_decode($this->getresponse()->getcontent()); print_r($response); //to print json result $this->asserttrue(is_object($response)); $this->assertsame($response->status, 'success'); $this->assertnotempty($response->id); }
error:
phpunit 3.7.29 sebastian bergmann.
configuration read /home/quotequadsco/public_html/xmlps/phpunit.xml .................fstdclass object ( [error] => file name (filename) parameter missing. [status] => error [flashmessages] => array ( ) ) time: 4.17 seconds, memory: 43.00mb there 1 failure: 1) apitest\controller\apicontrollertest::testsubmitaction failed asserting 2 strings identical. --- expected +++ actual @@ @@ -error +success /home/quotequadsco/public_html/xmlps/module/api/test/apitest/controller/jobcontrollertest.php:64 failures! tests: 18, assertions: 56, failures: 1.
am not sure doing wrong in code. have parameter "filename" errors says filename missing. don't have clue how solve it.pls me!
Comments
Post a Comment