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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:27:17+00:00 2026-05-15T04:27:17+00:00

The Zend Tutorial lists many assertions to check the output generated by a request.

  • 0

The Zend Tutorial lists many assertions to check the output generated by a request.

http://framework.zend.com/manual/en/zend.test.phpunit.html

But they all seem to assume that the output is html. I need to test json output instead.

Are there any assertions helpful to check json, or is there at least a generic way to make assertions against the output? Anything that doesn’t rely on the request outputting html?

  • 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-15T04:27:18+00:00Added an answer on May 15, 2026 at 4:27 am

    There are no assertion methods specific to JSON implemented in Zend_Test_PHPUnit. However, the first test you would might want to do is check that the JSON is valid, thus convert it to its original type (array/object). From then on you are in position to use PHPUnit’s generic assertions to validate its contents.

    UPDATE: To get the raw response body you can do the following (when extending Zend_Test_PHPUnit_ControllerTestCase):

    $this->getResponse()->getBody();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following tutorial: http://framework.zend.com/manual/en/learning.quickstart.create-model.html When I try to insert record in database
i've followed the pagination tutorial from http://framework.zend.com/manual/en/zend.paginator.usage.html I have successfully implemented pagination for my
Zend Framework 1.11.2 PHPUnit 3.5.10 PHP 5.3.1 NetBeans 6.9.1 http://pastebin.com/L5bi9AgY I followed Lebensold's tutorial
I'm doing this tutorial: http://www.phpeveryday.com/articles/Zend-Framework-Database-Creating-Input-Form-P494.html We are building a simple input form using POST
I'm following a tutorial on Zend Framework here (http://www.ibm.com/developerworks/opensource/tutorials/os-php-zend2/section2.html). I barely got started, but
I'm following this example tutorial project code: http://akrabat.com/wp-content/uploads/zf-tutorial-layoutform.zip tutorial: http://akrabat.com/zend-framework/a-form-in-your-layout/ The project code runs
Have just finished tutorial by Rob Allen: http://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework-2.pdf then i decided to get module
I've done the first steps in Zend Framework with akrabat.com/zend-framework-tutorial/. The Demo-App works fine,
i m referring tutorial http://www.webpixel.gr/blog/zend-framework/integrate-doctrine-2-0-1-with-zend-framework-1-11-x and i m using ZendFramework-1.11.11 and doctrine2-2.2.0-BETA2 there is
Zend Route issue. Normally it works fine. http://www.example.com/course-details/1/Physics-Newtons-Law But if I type in an

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.