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 Behat Tests
August 19, 2013 @ 10:13:16

On the VG Tech blog there's a recent post showing you how you can use the built-in PHP web server to help with running your Behat (a behavior-driven development tool) tests.

Behat is a tool for running acceptance tests for your application. If your application is a web application you will need a web server to execute your tests. [...] Some weeks back I wrote a post showing you how to use PHP's built in web server in PHPUnit. This post will show you how to do the same for Behat when running your acceptance tests.

His example (here on github) shows you how to set up Behat via Composer, run it and start in on your first test. In the test's "setUp" method, it calls out to the command line and starts up the built-in web server if it's not already running. It also checks to see if it can connect to the server to make sure it's accessible. Then, in the "tearDown" method, there's a call to kill off the PHP process based on the PID stored on startup.

0 comments voice your opinion now!
builtin webserver bdd tests behat setup teardown

Link: http://tech.vg.no/2013/08/16/using-phps-built-in-web-server-in-behat-tests

blog comments powered by Disqus

Similar Posts

Joshua Thijssen's Blog: php 5.4 + htrouter: Your personal Apache 2.2 compatible server

Leniel Macaferi's Blog: Installing PHP on Mac OS X Snow Leopard 10.6.5

Greg Beaver\'s Blog: Setting up your own PEAR channel - the official way

HowTo Forge: Fedora 8 Server Setup - LAMP, Email, DNS, FTP, ISPConfig - Page 6

NetTuts.com: Getting Started With Phpspec


Community Events





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


introduction refactor framework threedevsandamaybe opinion laravel code podcast interview install symfony2 community series release testing developer list unittest experience language

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