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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:28:39+00:00 2026-06-08T23:28:39+00:00

I am trying to setup a controller unit test but I get the following

  • 0

I am trying to setup a controller unit test but I get the following error:

InscricaoControllerTest::testInscricaoPage()
Zend_Controller_Exception: Failed saving metadata to metadataCache#0 [internal function]: PHPUnit_Util_ErrorHandler::handleError(1024, 'Failed saving m...', 'C:\xampp\ZendFr...', 838, Array)
#1 C:\xampp\ZendFramework-1.11.12\library\Zend\Db\Table\Abstract.php(838): trigger_error('Failed saving m...', 1024)
#2 C:\xampp\ZendFramework-1.11.12\library\Zend\Db\Table\Abstract.php(874): Zend_Db_Table_Abstract->_setupMetadata()
#3 C:\xampp\ZendFramework-1.11.12\library\Zend\Db\Table\Abstract.php(982): Zend_Db_Table_Abstract->_setupPrimaryKey()
#4 C:\xampp\ZendFramework-1.11.12\library\Zend\Db\Table\Select.php(100): Zend_Db_Table_Abstract->info()
#5 C:\xampp\ZendFramework-1.11.12\library\Zend\Db\Table\Select.php(78): Zend_Db_Table_Select->setTable(Object(Application_Model_DbTable_TipoUsuario))
#6 C:\xampp\ZendFramework-1.11.12\library\Zend\Db\Table\Abstract.php(1018): Zend_Db_Table_Select->__construct(Object(Application_Model_DbTable_TipoUsuario))
#7 C:\htdocs\sgsa\application\models\DbTable\TipoUsuario.php(19): Zend_Db_Table_Abstract->select()
#8 C:\htdocs\sgsa\library\Sistema\Controller\Plugin\Acl.php(10): Application_Model_DbTable_TipoUsuario->getTipoUsuario()
#9 C:\xampp\ZendFramework-1.11.12\library\Zend\Controller\Plugin\Broker.php(309): Sistema_Controller_Plugin_Acl->preDispatch(Object(Zend_Controller_Request_HttpTestCase))
#10 C:\xampp\ZendFramework-1.11.12\library\Zend\Controller\Front.php(941): Zend_Controller_Plugin_Broker->preDispatch(Object(Zend_Controller_Request_HttpTestCase))
#11 C:\xampp\ZendFramework-1.11.12\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#12 C:\xampp\ZendFramework-1.11.12\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#13 C:\xampp\ZendFramework-1.11.12\library\Zend\Test\PHPUnit\ControllerTestCase.php(206): Zend_Application->run()
#14 C:\htdocs\sgsa\tests\application\controllers\InscricaoControllerTest.php(11): Zend_Test_PHPUnit_ControllerTestCase->dispatch('/inscricao')
#15 [internal function]: InscricaoControllerTest->testInscricaoPage()
...

In my bootstrap I have APC cache:

protected function _initCache() {
    $frontendOptions = array(
        'lifetime' => 7200, // cache lifetime of 2 hours
        'automatic_serialization' => true
    );
    $backendOptions = array(
            //'cache_dir' => APPLICATION_PATH. '/../data/cache/' // Directory where to put the cache files
    );
    // getting a Zend_Cache_Core object
    $cache = Zend_Cache::factory('Core', 'Apc', $frontendOptions, $backendOptions);
    Zend_Db_Table::setDefaultMetadataCache($cache);
    Zend_Locale::setCache($cache);
    Zend_Date::setOptions(array('cache' => $cache));
    return $cache;
}

I am running the test below:

public function testInscricaoPage() {
    $this->dispatch('/inscricao');
    $this->assertResponseCode(200);
    $this->assertQueryContentContains('h1', 'Inscrição');
}

Why I am getting this error? seems php cli can’t use caching but the application runs normally on browser

  • 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-06-08T23:28:41+00:00Added an answer on June 8, 2026 at 11:28 pm

    APC is disabled for PHP CLI by default, adding the following config line in php.ini solves the issue.

    apc.enable_cli=1
    

    This configuration can only be set in php.ini or httpd.conf.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to test a controller. Zend Tool has generated the following code: class
I am running on Castle's trunk, and trying to unit-test a controller-action where validation
I'm trying to get my head around how one would unit test an ASP.NET
I'm trying to unit-test my controller (Yii framework). /** * @dataProvider provider */ public
I want to write a unit test for the following controller action: public ActionResult
So I'm trying to unit-test a controller method. I'm using MSTest in VS 2010,
I'm trying to set up a test email in my controller that outputs the
Trying to setup and get going with the RestKit library for a cocoa project
Im trying to setup my asp.net mvc page like the following image: The header
We're trying to setup controller tests for our Pylons app. I made a very

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.