News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

VG Tech:
Using PHP's Built-in Web Server in Your Test Suites
July 22, 2013 @ 10:47:33

PHP introduced a handy built-in web server that makes it much simpler to test applications quickly and locally than having to have a full Apache+PHP install sitting on you machine. In this new post to the VG Tech blog, they take it one step further. They suggest that you can use it for testing too.

As of PHP-5.4.0 the CLI SAPI provides a built-in web server. The web server is designed for development purposes, and serves requests sequentially. This web server can come in really handy when the need for an httpd arises during (integration) tests. In this post I'll use PHPUnit as the testing framework, and I'll show you how to start the web server during the bootstrap process, and how to shut it down when the test suite is finished.

His example shows the creation of a basic phpunit.xml configuration file, but the bootstrap is a little different than some you've seen. With the help of a few constants and a command-line call to start the web server, he gets things up and running and ready for testing. A shutdown command is also included as a registered shutdown function to clean up after the testing is done.

0 comments voice your opinion now!
webserver builtin phpunit unittest integration bootstrap tutorial

Link: http://tech.vg.no/2013/07/19/using-phps-built-in-web-server-in-your-test-suites

blog comments powered by Disqus

Similar Posts

SocialDevelopers.net: Facebook and the Zend Framework - Part 1: Iframe Authentication

DevShed: Building a Database-Driven Application with the Code Igniter PHP Framework

Robert Basic's Blog: Login example with Zend_Auth

Marcelo Gornstein's Blog: Sniffing in PHP using libpcap: Thank you SWIG!

DevHell Podcast: Episode 3: Beatings Will Continue Until Test Coverage Improves


Community Events





Don't see your event here?
Let us know!


configure introduction laravel voicesoftheelephpant opinion interview version unittest composer api framework list series community podcast symfony conference language release threedevsandamaybe

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework