Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 995093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:40:08+00:00 2026-05-16T06:40:08+00:00

in the docs the provided code for bootstrapping looks like protected $application; public function

  • 0

in the docs the provided code for bootstrapping looks like

protected $application;
public function setUp() {
    $this->bootstrap = array($this, 'appBootstrap');
    parent::setUp();
}
public function appBootstrap() {
    $this->application = new Zend_Application( ... );
    $this->application->bootstrap();
}

i was curious why when i tried

protected $application;
public function setUp() {
    $this->application = new Zend_Application( ... );
    $this->application->bootstrap();
    parent::setUp();
}

it failed. also when i tried moving bootstrapping the application in bootstrap.php it fails too

// bootstrap.php
...
$application = new Zend_Application( ... );
$application->bootstrap();

the reason why i thought of moving this to bootstrap.php is jon lebensold from zend casts extended the ControllerTestCase to handle all this bootstrapping in a separate class. i thought instead of extending the class, if i can move the code into the bootstrap.php in 1 place wont it be better

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:40:08+00:00Added an answer on May 16, 2026 at 6:40 am

    This is what my ControllerTestCase.php looks like:

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

    TestHelper.php (Bootstrap)

    <?php
    define('BASE_PATH', realpath(dirname(__FILE__) . '/../public'));
    define('APPLICATION_PATH', realpath(BASE_PATH . '/../application'));
    
    set_include_path(implode(PATH_SEPARATOR, array(
        '.',
        realpath(APPLICATION_PATH . '/../library'),
        get_include_path()
    )));
    
    define('APPLICATION_ENV', 'testing');
    
    require_once "Zend/Loader/Autoloader.php";
    
    $loader = Zend_Loader_Autoloader::getInstance();
    $loader->setFallbackAutoloader(true);
    $loader->suppressNotFoundWarnings(false);
    
    require_once 'ControllerTestCase.php';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Form docs: Comparable c=mock(Comparable.class); when(c.compareTo(anyInt())).thenReturn(-1); I would like: File tempDir=new File(test); Comparable c=mock(Comparable.class); when(c.compareTo(anyInt())).thenReturn(tempDir.mkdir());
The docs on this are pretty shoddy. There are a number of events you
MSDN docs say that only value types need boxing, but this does not apply
NOTE Due to the successful outcome of this thread, the documentation at the provided
I am generating C code based on information provided by another file (an XML
I'm adding navigation tabs to an action bar using the sample code provided here:
The docs for NSFetchedResultsControllerDelegate provide the following sample code - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath
If you follow the quickstart guide provided by the official Model-Glue docs, found here:
I successfully created tables with style that salesforce provided. (like the one that highlighted
In my app my cloud services are provided by google drive (formely google docs)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.