Bonjour

Voila maintenant plusieurs jours que je suis bloqué sur ce point. En gros j'ai un export que je dois simuler avec des test unitaires. Pour cela je dois faire appel a un controller.

Mon fichier test
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class OrderControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
{
    public function appBootstrap()
    {
        $controller = $this->getFrontController();
        //$controller->registerPlugin(new Plugin_Initialize('development'));
    }
 
    public function setUp()
    {
        $this->bootstrap = array($this, 'appBootstrap');
        parent::setUp();
    }
 
    public function testCallWithoutActionShouldPullFromIndexAction()
    {
 
    }
 
    function testvalidAction()
    {
          //$this->getFrontController()->setControllerDirectory(APPLICATION_PATH . '/controllers');  
        //header("Location: http://localhost/pol_test/program/u/1266");
 
        $this->dispatch('/order');
        //$this->assertEquals(1, 0 + 1);
        $ordercontroller  = new OrderController();
 
        $ordercontroller.programAction();
        $ordercontroller.validAction();
    }
}
Mon fichier loader
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
 
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));
 
/** Zend_Application */
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
 
require_once 'Farnsworth/Loader.php';
$loader = new Farnsworth_Loader();
$loader->autoload('Farnsworth_Command_Export');
 
require_once APPLICATION_PATH.'/controllers/OrderController.php';
?>
Voila et quand je lance mes tests j'ai cette erreur:

Argument 1 passed to Zend_Controller_Action::__construct() must be an instance of Zend_Controller_Request_Abstract, none given, called in C:\wamp...
Je tiens avant tout a rappeler que je suis débutant sur Zend et sur les test unitaires, soyez indulgent avec moi ^^. Et n'hésitez pas a me faire remarquer la moindre connerie que j'aurai faite.