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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:46:01+00:00 2026-05-16T07:46:01+00:00

Background: I am attempting to do a couple of unit tests on AJAX requests

  • 0

Background: I am attempting to do a couple of unit tests on AJAX requests which would call PHP functions on the server-side. As this involves database manipulation, I have decided to check the return of the calls using unit tests in PHP.

Given the URL of an AJAX request, how do I call it and gets its response?

**Added question:**If the parameters include a form sent via POST, how shall I handle it?

  • 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-16T07:46:02+00:00Added an answer on May 16, 2026 at 7:46 am

    You could do this by making requests with CURL. You could even use phpUnit or some equivalent to track the progress.

    <?php
    $session = curl_init($request); 
    curl_setopt($session, CURLOPT_HEADER, false); 
    curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($session); 
    curl_close($session); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting at changing the background color of the td's on click. This is
I have the following code which is attempting to send an email in background.
I'm attempting to pull an image (in this case, /camera/frame , which is a
Background: I'm working on migrating from SQL Server 2000 to SQL Server 2005. This
Background: I'm running a Minecraft server for friends on a VPS, and I'm attempting
Background: I am attempting to copy a DataTable to a SQLite database. In comparison
Background I am attempting to create a reusable chart object with D3.js . I
I'm attempting to just change the background colour of a webpage upon page load.
I am attempting to overlay images on top of a background image using the
I'm attempting to run echoprint-codegen in a background process for analysing audio files as

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.