 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
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
Codewalkers.com: Book Review - Pro PHP-GTK
by Chris Cornutt June 27, 2006 @ 08:37:47
Codewalkers.com has posted a new book review today of the APress book (by Scott Mattocks) - Pro PHP-GTK.
PHP-GTK is a library allowing PHP developers to create graphical GTK applications. Pro PHP-GTK by Scott Mattocks aims to teach this tool to people of all skill levels from those who can read PHP fairly well to professionals. This might make it kind of disturbing for the more advanced coder, because the book teaches even the most basic things like "What is a GUI application?" and "What are they good for?"
Although the book is meant for beginning coders, too, it doesn't mean it should contain stuff that is aimed at people who know nothing about computers. Luckily, after a few chapters this problem seems to vanish.
He notes that once the basics are out of the way, the book really gets to the heart of the matter with a case study of a product information management system example. Lots of code is provided, and there's some talk about getting the needed packages installed to work with the examples in the book. He rates it well, with only a few issues (too simple to start?) to detract from it.
voice your opinion now!
book review pro php-gtk apress basics case study reference book review pro php-gtk apress basics case study reference
|
Community Events
Don't see your event here? Let us know!
|