Skip to content

Bootstrap param is missing in Zend_Controller_Front #48

Closed
zfbot opened this Issue Apr 5, 2013 · 4 comments

2 participants

@zfbot
zfbot commented Apr 5, 2013

Jira Information

Original Issue: ZF-12508
Issue Type: Bug
Reporter: Angel K
Created: 01/16/13
Assignee:
Components: Zend_Test_PHPUnit

Description

Module: Zend_Test_PHPUnit

 public function setUp()
    {
        $this->bootstrap = new \Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.xml');
        parent::setUp();
    }

Then

\Zend_Controller_Front::getInstance()->getParam('bootstrap') is null
@zfbot
zfbot commented Apr 5, 2013

(Originally posted by: froschdesign on 01/16/13)

@Angel
Please provide a small but working example. (Maybe on Github as Gist)
This would help to reproduce the problem.

Thanks a lot!

@zfbot
zfbot commented Apr 5, 2013

This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF-12508

Known GitHub users mentioned in the original message or comment:
@froschdesign

@froschdesign
Zend Framework member

Use dispatch!

Example:

class IndexControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
{
    public function setUp()
    {
        $this->bootstrap = new Zend_Application(
            APPLICATION_ENV,
            APPLICATION_PATH . '/configs/application.ini'
        );
        parent::setUp();
    }

    public function testIndexAction() {
        $this->dispatch('/');
        $this->assertTrue(
            $this->frontController->getParam('bootstrap') instanceof Zend_Application_Bootstrap_Bootstrap
        );
    }
}
@froschdesign froschdesign added invalid and removed bug labels Jul 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.