News Feed
Sections




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

Gonzalo Ayuso:
Building a BDD framework with PHP
August 19, 2013 @ 09:49:57

Gonzalo Ayuso wanted to look into BDD (behavior driven development) in PHP and was looking around for a tool to fit his needs. He didn't find one right away and so decided to create a simple one as a proof of concept to try out the method for himself.

I want to write as less code as I can (it's only a proof of concept), so I will reuse the assertion framework or PHPUnit. As I've seen when studying Behat, we can use the assertion part as standalone functions. We only need to include vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php file.

He includes the sample code showing his basic interface - a string calculation object being passed into a closure for evaluation by the PHPUnit assertion methods. He also includes an example of using it along with Mockery for creating a mock object and testing based on that.

0 comments voice your opinion now!
bdd behaviordriven development framework proofofconcept poc mockery

Link: http://gonzalo123.com/2013/08/19/building-a-bdd-framework-with-php

blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Consuming Google Calendars with the Zend Framework

DevShed: 7 PHP Frameworks Tested For Speed - Benchmarking PHP Frameworks

Matthew Weier O'Phinney's Blog: Symfony Live 2010 (A message of Interoperability)

DevShed: An Introduction to Simulating the Model-View-Controller Schema in PHP

Piotr Walczyszyn's Blog: Configuring Eclipse PDT & Flash Builder 4 Plug-in for PHP/Flex development


Community Events

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


opinion podcast series framework configure example php7 api interview application community symfony2 install release conference introduction voicesoftheelephpant performance library laravel

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