News Feed
Sections




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

Rami Alnawas:
How to unit test code with Phalcon MVC Models
April 29, 2014 @ 11:57:39

Rami Alnawas has posted an interesting tutorial for the Phalcon users out there showing one way you can unit test your models. It's based on his own experience with the framework in a current project.

My first contribution to the PHP community in general, and Phalcon folks in particular, was the introduction of MVC Functional Testing with PHPUnit, this meant that Applications developed using Phalcon Framework could be unit tested by requesting a url then asserting that the response is handled by a specific action within the controller. [...] To date, my latest addition is an example of how to unit test code that utilises Phalcon models, mainly the various static find methods. The code is available on github and the coverage report is coveralls.io.

He shows it at work, creating a simple "Popup" model and a facade to help with making instances for testing. He also includes the code to test this facade, checking the results of methods like "fetchall", "select" and "execute".

0 comments voice your opinion now!
phalcon framework unit test coverage mvc model tutorial

Link: http://www.rami.me.uk/how-to-unit-test-code-with-phalcon-mvc-models

blog comments powered by Disqus

Similar Posts

Vidyut Luther's Blog: Adding Subscribers to Campaign Monitor Lists using PHP5 and SOAP

IBM developerWorks: Java and PHP technology on AIX - Integrate the Java business application w/ DB2

Brian Swan's Blog: Using the Windows Azure Command Line Tools for PHP

PHPMaster.com: Saving PHP Sessions in Redis

Idrish Laxmidhar's Blog: How to send mail from Localhost with XAMPP and mercury/32


Community Events





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


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

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