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 6045653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:08:56+00:00 2026-05-23T07:08:56+00:00

I am setting up testing with PHPUnit and Zend Framework and have a niggling

  • 0

I am setting up testing with PHPUnit and Zend Framework and have a niggling issue with autoloading.

Firstly, I’m not sure why I need to setup autoloading in my the phpunit bootstrap.php. In the production environment, the index.php file isn’t loading it? (My test cases are extending Zend_Test_PHPUnit_ControllerTestCase).

Secondly, I’m having difficulty replacing Zend_Loader with Zend_Loader_Autoload.

If I use this code in my bootstrap…

require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();

… the tests run fine, but with a warning about Zend_Loader being deprecated.

If I use this code, however…

require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

The tests can’t find a library class and a fatal error results.

In my application.ini I have the line autoloaderNamespaces[] = “CP_”. It seems that the Loader class can see it, but not the Autoloader class. Curious…

Any ideas?

Thanks!

  • 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-23T07:08:57+00:00Added an answer on May 23, 2026 at 7:08 am

    PHPUnit sometimes uses the cli/php.ini config instead of the default one. This could be where your problem is originating as you may have added library include paths to your php.ini but neglected to add them to the cli/php.ini.

    I add my libraries to the test bootstrap manually rather than through the ini file. You could try adding something like this under your autoloader lines in the bootstrap:

    $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
        'basePath' => APPLICATION_PATH,
        'namespace' => '',
        'resourceTypes' => array(
            'cplib' => array(
                'path' => 'library/CP',
                'namespace' => 'CP_'
            ),
        ),
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read many posts about setting up unit testing in Zend Framework and
I'm currently using Zend Framework in conjunction with PHPUnit to conduct unit testing on
I'm setting up unit testing for the first time on my Zend Framework app
Setting up ASP.net MVC with Linq2SQL or Entity Framework's context to have scaffolding work
I have a PHP application that is written with Zend Framework. It uses Phing
The classic problem of testing and setting individual bits in an integer in C
I'm looking at setting up unit tests and integration testing, but I've run into
I am setting up unit testing for my core data app. I'm running into
Hey guys, I'm currently testing my app by adding the setting bundle into my
Im stuck, Im setting a variable when someone clicks, then testing with if to

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.