 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
DZone.com: CakePHP - Web Test Cases with SimpleTest
by Chris Cornutt 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.
voice your opinion now!
simpletest web test case browser tutorial
Bradley Holt's Blog: The Case For Rapid Release Cycles
by Chris Cornutt August 09, 2011 @ 08:44:33
Bradley Holt has a new post to his blog today talking about something he's a fan of in his development processes - rapid release cycles - and how something like the Zend Framework could benefit from it.
There has been some discussion recently on the Zend Framework mailing list around release cycles. I proposed a release cycle of six months for major versions (someone else suggested eighteen months, which may be more reasonable for a framework). Rapid releases allow one to accelerate the cycle of building, measuring, and learning. Gathering data from actual usage (measuring) provides an opportunity for learning that can be applied to the next release (building).
He points out that the post isn't specifically targeted at the Zend Framework project, merely that it was the inspiration point for the idea. He talks about what rapid release cycles are and what it can give the team that implements it - less worries about backwards compatibility breaks, a potential encouragement for development pacing and the ease for the customers doing upgrades.
A rapid release cycle allows you to apply new learning, knowledge, and perspective as often as possible. Do your best today, and give yourself opportunities to do your best in the future as well.
voice your opinion now!
case opinion rapid release cycle software development
Debuggable Blog: Code Insults Round 1 - Why switch blocks are dumb
by Chris Cornutt October 29, 2008 @ 08:48:28
In the first of his "I will insult your code" series, Nate Abele looks at this submitted code and points out that maybe blocks of switch/case statements aren't such a good idea after all.
The entire submission is actually two files, which together comprise a console script for interacting with a web service (the names of the entrants have been withheld to protect the identities of the guilty). Rather than examine the full entry, we're going to take a look at one part which I find comes up fairly often: switch block overkill.
The example he's talking about has a switch statement with eight different cases under it, most of them just setting two properties on the current class. Its used ot map command line parameters to their correct properties. Nate suggests a bit different method - still using switch/case but pulling the properties to be assigned from an array of options rather than hard-coding them into the evaluation.
voice your opinion now!
switch case block insult refine overkill property
Debuggable Blog: Testing Models in CakePHP - Now let's get rid of the unnecessary ModelTest classes!
by Chris Cornutt July 31, 2008 @ 07:51:38
On the Debuggable blog today Tim Koschutzki looks at another testing topics for the CakePHP framework - a cleaner way for testing models.
Up until now there was always a need to create a so-called test model that extends your model-under-test in order to overwrite its $useDbConfig setting to be 'test_suite'. By that you ensured that your models run with the test_suite datasource when the tests are run. [...] Nate proposed ClassRegistry::config(), which allows you to tell the ClassRegistry class which datasource it shall use when
ClassRegistry::init() is used the next time (and thereby a model is instantiated).
He includes an example of the new functionality - a test case ensuring that three articles are there and are marked as published. The registry makes it easier to automatically create the ArticleTest instance inside the test case rather than having to manually declare and define it.
voice your opinion now!
test case cakephp framework registry modeltest class
Debuggable Blog: How to bend Cake's Modelfind() method to your needs
by Chris Cornutt June 23, 2008 @ 12:08:32
New on the Debuggable blog, Tim Koschutzki has posted a method to get the fund() method in the CakePHP framework's models to bend to your will.
CakePHP allows you to use your own "find-types" for the Model::find() methodology. Those of your who are familiar with the find() method know that there are currently four types in the core: 'list', 'all', 'first' and 'count'. However, sometimes it is nice to specify your own type.
He shows an example of the end result - a find() call with a custom type that automagically gets translated correctly. His script overrides and enhances the usual find call in an extended object (extended from AppModel) that uses a switch/case statement to define the custom types and their find() search calls.
voice your opinion now!
cakephp framework find custom type model switch case
Stuart Herbert's Blog: Missing The Business Case For PHP
by Chris Cornutt January 18, 2007 @ 08:40:00
In this new post to his blog today, Stuart Herbert suggests something that the PHP community really is in dire need of - a site/resource providing a place developers can point at to help refute some of the PHP rumors floating around and provide examples and test cases for one of the most stubborn PHP markets out there - business.
At work, we make and sell software written in a number of languages; our flagship product is written in PHP.
But one of the unfortunate side-effects of Stefan Esser's much-publicized departure from the PHP Security Team has been an increase in the number of IT staff we're coming across who "believe" both that open-source is inherently insecure, and that PHP in particular has incurable problems. These "beliefs" hurt ISVs trying to sell PHP-based applications into skeptical organizations.
He asks why there is no "Why PHP?" resource out there that clients/businesses in general can be referred to for better information. He also suggests one of the most logical fits for this kind of information and is surprised they don't really have something already - Zend. Check out the comments to see how much of the community is already behind the effort.
voice your opinion now!
business case whyphp insecure problems refute claim business case whyphp insecure problems refute claim
|
Community Events
Don't see your event here? Let us know!
|