Bug #27378

JsonView not testable view \F3\FLOW3\Tests\FunctionalTestCase->sendWebRequest

Added by Fernando Arconada about 4 years ago. Updated about 3 years ago.

Status:Closed Start date:2011-06-12
Priority:Should have Due date:
Assigned To:Robert Lemke % Done:

0%

Category:- Testing -
Target version:TYPO3 Flow Base Distribution - 1.1 RC1
PHP Version: Complexity:
Has patch:No Affected Flow version:FLOW3 1.0.0

Description

If you try to create a Functional test that uses a JsonView you will have an exception
//'CuentaController' and 'list' action uses '\F3\FLOW3\MVC\View\JsonView'
class JsonOutputTest extends \F3\FLOW3\Tests\FunctionalTestCase {
/** * @test * @return void
*/
public function cuentasList() {
$output = $this->sendWebRequest('Cuenta','Sifpe','list',array(),'json');
$decoded = json_decode($output,TRUE);
$this->assertTrue(is_array($decoded));
}
}

E_ERROR: Call to undefined method Mock_ResponseInterface_a5944a04::setHeader()
#0 /var/www/html/FLOW3/Data/Temporary/Testing/Cache/Code/FLOW3_Object_Classes/F3_FLOW3_MVC_View_JsonView_Original.php(137)
PHP Fatal error: Call to undefined method Mock_ResponseInterface_a5944a04::setHeader() in /var/www/html/FLOW3/Data/Temporary/Testing/Cache/Code/FLOW3_Object_Classes/F3_FLOW3_MVC_View_JsonView_Original.php on line 137
PHP Stack trace:
PHP 1. {main}() /tmp/phpunit_Sifpe_falcifer.php:0
PHP 2. MyTestRunner::main() /tmp/phpunit_Sifpe_falcifer.php:814
PHP 3. MyTestRunner::runTest() /tmp/phpunit_Sifpe_falcifer.php:796
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /tmp/phpunit_Sifpe_falcifer.php:485
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:305
PHP 6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:693
PHP 7. PHPUnit_Framework_TestSuite->runTest() /usr/share/pear/PHPUnit/Framework/TestSuite.php:733
PHP 8. PHPUnit_Framework_TestCase->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:757
PHP 9. PHPUnit_Framework_TestResult->run() /usr/share/pear/PHPUnit/Framework/TestCase.php:576
PHP 10. F3\FLOW3\Tests\FunctionalTestCase->runBare() /usr/share/pear/PHPUnit/Framework/TestResult.php:666
PHP 11. F3\FLOW3\Tests\BaseTestCase->runBare() /var/www/html/FLOW3/Packages/Framework/FLOW3/Tests/FunctionalTestCase.php:114
PHP 12. PHPUnit_Framework_TestCase->runBare() /var/www/html/FLOW3/Packages/Framework/FLOW3/Tests/BaseTestCase.php:52
PHP 13. PHPUnit_Framework_TestCase->runTest() /usr/share/pear/PHPUnit/Framework/TestCase.php:628
PHP 14. ReflectionMethod->invokeArgs() /usr/share/pear/PHPUnit/Framework/TestCase.php:738
PHP 15. F3\Sifpe\Tests\Functional\Output\JsonOutputTest->cuentasList() /var/www/html/Sifpe/Tests/Functional/Output/JsonOutputTest.php:0
PHP 16. F3\FLOW3\Tests\FunctionalTestCase->sendWebRequest() /var/www/html/Sifpe/Tests/Functional/Output/JsonOutputTest.php:11
PHP 17. F3\FLOW3\MVC\Controller\ActionController_Original->processRequest() /var/www/html/FLOW3/Packages/Framework/FLOW3/Tests/FunctionalTestCase.php:240
PHP 18. F3\FLOW3\MVC\Controller\ActionController_Original->callActionMethod() /var/www/html/FLOW3/Data/Temporary/Testing/Cache/Code/FLOW3_Object_Classes/F3_FLOW3_MVC_Controller_ActionController_Original.php:171
PHP 19. F3\FLOW3\MVC\View\JsonView_Original->render() /var/www/html/FLOW3/Data/Temporary/Testing/Cache/Code/FLOW3_Object_Classes/F3_FLOW3_MVC_Controller_ActionController_Original.php:298

History

#1 Updated by Karsten Dambekalns almost 4 years ago

  • Affected Flow version set to FLOW3 1.0.0

#2 Updated by Karsten Dambekalns over 3 years ago

  • Status changed from New to Accepted
  • Assigned To set to Robert Lemke
  • Priority changed from Must have to Should have
  • Target version set to 1.1
  • Has patch set to No

Assigning to Robert as the MVC refactoring should solve this "along the way".

#3 Updated by Karsten Dambekalns about 3 years ago

  • Target version changed from 1.1 to 1.1 RC1

#4 Updated by Karsten Dambekalns about 3 years ago

  • Status changed from Accepted to Closed

I strongly believe this is outdated with 1.1.

Also available in: Atom PDF