I have a unit test like
class Application_Controller_Plugin_AclTest extends
Zend_Test_PHPUnit_ControllerTestCase {
public function setUp() {
$this->getFrontController()->setDefaultModule('default');
}
public function testAccessToUnauthorizedPageRedirectsToLogin() {
$this->dispatch('/projects');
$this->assertController('auth');
$this->assertAction('login');
}
public function testAccessToAllowedPageWorks() {
$auth = Zend_Auth::getInstance();
$authAdapter = new Application_Auth_Adapter('jiewmeng', 'password');
$auth->authenticate($authAdapter);
$this->dispatch('/projects');
$this->assertController('projects');
$this->assertAction('index');
}
}
I am getting the error
1)
Application_Controller_Plugin_AclTest::testAccessToUnauthorizedPageRedirectsToLogin
Zend_Controller_Exception: No default module defined for this application
D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Dispatcher\Standard.php:391
D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Dispatcher\Standard.php:204
D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Dispatcher\Standard.php:244
D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Front.php:954
D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Test\PHPUnit\ControllerTestCase.php:205
D:\Projects\Tickle\tests\application\controllers\plugins\aclTest.php:10
for the 1st test, but not the 2nd why is that?
I noticed that I cannot put something like ...
$front = Zend_Controller_Front::getInstance();
$front->setDefaultModule('default');
into the bootstrap.php of my unit tests, I does not seem to do anything, I
still get No default module defined, if I put it in setup(), I will get the
above where the 1st test fails but the 2nd passes
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/No-default-module-defined-for-application-Zend-Test-tp3161541p3161541.html
Sent from the Zend Framework mailing list archive at Nabble.com.