News Feed
Sections




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

DZone.com:
CakePHP - Web Test Cases with SimpleTest
September 07, 2011 @ 10:08:24

On DZone.com today there's a new post written up by Mike Bernat about making web test cases for CakePHP applications with SimpleTest.

Most of the applications I work on have very straight-forward components and not a lot of complex functions/methods. I would only be testing whether or not they worked at all, rather than if they worked in a wide-array of situations. [...] For example, unit-testing a simple news list and detail page is probably overkill. Sure, you can test your classes by simple instantiating them but that only goes so far. My new method involves using SimpleTest's Scriptable Browser to actually crawl webpages and ensure that the proper data is being displayed.

He includes a few snippets of code to show how to implement SimpleTest's web test functionality - one that just checks a HTTP response values, another that checks for text on the page, one testing for a login on an admin page and a test for add/edit pages to ensure valid loading based on URLs/links.

0 comments voice your opinion now!
simpletest web test case browser tutorial


blog comments powered by Disqus

Similar Posts

WebCheatSheet.com: PHP: Dynamic Image Generation

SitePoint PHP Blog: pTest: PHP Unit Tester in 9 Lines Of Code

NETTUTS.com: CodeIgniter from Scratch: File Uploading and Image Manipulation

OneNextraPixel.com: 13 Useful WordPress SQL Queries You Wish You Knew Earlier

Felix Geisendörfer's Blog: Agile Web development (with CakePHP)


Community Events





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


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

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