Issues

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

Issue Type: Bug Created: 2010-04-04T10:58:23.000+0000 Last Updated: 2012-11-20T21:37:41.000+0000 Status: Open Fix version(s): Reporter: Ethan Brooks (ebr00ks) Assignee: None Tags: - Zend_Test_PHPUnit

Related issues: Attachments:

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

  1. 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

Posted by mosta (crow) on 2010-06-15T16:10:13.000+0000

I have the same problem

Posted by mosta (crow) on 2010-06-16T06:03:16.000+0000

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts