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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:30:01+00:00 2026-05-15T11:30:01+00:00

I use Zend_Test for unit testing in Zend Framework. I have configured the bootstrap

  • 0

I use Zend_Test for unit testing in Zend Framework. I have configured the bootstrap and testing environment properly then I got this error output from test unit

Failed asserting last controller used <"error"> was "index"

This error happens when I call my DbTable class inside action method such as

public function indexAction()
{
    $roleDb = new Model_DbTable_Role;
    $role = $roleDb->getAll();
    $this->_forward('login');
}

If I remove two lines role, unit testing is success. It is my unit testing code

public function testIndexActionShouldRedirectToLoginAction()
{
    $this->dispatch('/index');
    $this->assertController('index');
    $this->assertAction('login');
}

What’s the problem with those lines?

How do I know the real error instead of just Failed asserting last controller used <“error”>?
Thank you

  • 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-15T11:30:02+00:00Added an answer on May 15, 2026 at 11:30 am

    Finally, it solved.

    It was because of PDO pgsql was not detected by php unit. FYI, in XAMPP there are two files of php.ini.

    First, inside apache/bin and second one is inside php folder. XAMPP always use the first php.ini for apache server but php unit use the second one. I have configured the first php.ini to use pgsql but forget the second one. It is the answer why my application still run but php unit doesn’t.

    Then, I enable extension for pgsql in the second php.ini

    extension=php_pdo_mssql.dll
    extension=php_pdo_mysql.dll
    extension=php_pdo_pgsql.dll <= add it
    ;extension=php_pdo_oci.dll
    ;extension=php_pdo_oci8.dll
    ;extension=php_pdo_odbc.dll
    extension=php_pdo_sqlite.dll
    ;extension=php_perl.dll
    extension=php_pgsql.dll <= remove ';'
    

    Last, thank you for any comments or suggestions for this problem. God bless you all. 🙂

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

Sidebar

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.