Issues

ZF-9613: The dispatch function does not seem to respect modules.

Description

The dispatch function does not seem to respect modules.

Has anyone seen this issues? Can this be true? I was unable to find any examples online that used multiple modules.

class Tests_CalculatorControllerTest extends Tests_ControllerTestCase { //This works because the default module is default public function testDefaultShouldInvokeFileAction() { $this->dispatch('/default/file'); $this->assertModule('default'); $this->assertController('file'); $this->assertAction('index'); } // so does this public function testDefaultShouldInvokeIndexAction() { $this->dispatch('/'); $this->assertModule('default'); $this->assertController('index'); $this->assertAction('index'); }

//This fails because the skeleton module is not default public function testSkeletonShouldInvokeIndexAction() {

    $this->dispatch('/skeleton');
    $this->assertModule('/skeleton');
    $this->assertController('index');
    $this->assertAction('index');
}
// same problem here
public function testSkeletonShouldInvokeCalculatorAction()
{
    $this->dispatch('/skeleton/calculator');
    $this->assertModule('skeleton');
    $this->assertController('calculator');
    $this->assertAction('index');
}

}

PHPUnit 3.4.11 by Sebastian Bergmann.

.FF...

Time: 13 seconds, Memory: 18.50Mb

There were 2 failures:

1) Tests_CalculatorControllerTest::testSkeletonShouldInvokeIndexAction Failed asserting last module used <"default"> was "skeleton"

C:\htdocs\php_library\zendframework\library\Zend\Test\PHPUnit\ControllerTestCase.php:929 C:\htdocs\Root\modules\skeleton\tests\CalculatorControllerTest.php:18

2) Tests_CalculatorControllerTest::testSkeletonShouldInvokeCalculatorAction Failed asserting last module used <"default"> was "skeleton"

C:\htdocs\php_library\zendframework\library\Zend\Test\PHPUnit\ControllerTestCase .php:929 C:\htdocs\Root\modules\skeleton\tests\CalculatorControllerTest.php:26

FAILURES! Tests: 6, Assertions: 10, Failures: 2.

Comments

I have the same problem

in your test directory , did you create skeleton repertory like application/module/skeleton/controllers

I resolve the probleme by having the same structure in the application and the test