 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
DZone.com: PHPUnit_Selenium
by Chris Cornutt January 20, 2012 @ 09:12:18
On DZone.com today Giorgio Sironi has a quick tutorial showing you how to set up and use the PHPUnit_Selenium component in the latest releases of the popular testing software.
With the 1.2 release, PHPUnit_Selenium supports (basically) for the first time the Selenium 2 WebDriver API. While PHPUnit_Selenium already worked with Selenium 2, it did so only by using the Selenium 1 emulation included in the jar; now it provides an object-oriented API right natively supported in a base PHPUnit test case, shipped in PHPUnit's PEAR channel.
He includes the steps you'll need to pull it from the PEAR channel and how to set up a test case based on the PHPUnit_Extensions_Selenium2TestCase object. He gives a few examples of how to select various components on the page (via CSS selectors and XPath), assert that the right information is there and interact with forms.
voice your opinion now!
phpunit selenium install unittest tutorial example select interact
Devis Lucato's Blog: Select Inversion of Control
by Chris Cornutt December 14, 2011 @ 13:34:53
In a recent post to his blog Devis Lucato introduces the "Inversion of Control" design pattern and shares an implementation he's created as an illustration - a Service Locator called Select.
[In a Service Locator] all the dependencies are provided by a builder, which serves as a registry of dependencies and/or service definitions. The service locator knows how to instantiate each dependency. Such service exposes methods like 'getMailer()', 'getLogger()' etc. A service locator centralises the configuration detailing classes and parameters involved on objects instantiations.
He includes some sample code showing the structure of a Select implementation using a "Mailer" identifier and definitions of the classes to load for it. He also includes a bit of documentation of the (simple) API you can use to work with the tool - setting namespaces, replacing class definitions, creating definitions and finding the resource associated with a definition (to name a few).
voice your opinion now!
inversion control designpattern select implementation
Court Ewing's Blog: Create and Validate a Choice List in a Symfony 2 Form
by Chris Cornutt August 17, 2011 @ 08:28:21
Court Ewing has written up a new post to his blog about creating a "choice" list (a select list as defined by Symfony 2) with dynamic options and validating the resulting submission. His example uses Doctrine 2 entities to work with most of the data handling.
A standard select list can be created using Symfony's choice field type; it is pretty clear how to create a new choice field with simple, non-dynamic options (e.g. gender), but it gets a little more complicated when you want to create and validate a dynamically generated choice list.
He includes the code for a simple entity, a Post model to fetch the category information and the set up of the form element - a select list of post types/categories. He also includes a bonus section showing how you can achieve the same thing without a model to bind to.
The code's a little bit more complex than the previous example, but it's basically just reproducing some of the validation and fetching logic manually.
voice your opinion now!
create validate tutorial symfony2 form select choice dynamic
Ian Christian's Blog: Creating a custom form field type in Symfony 2
by Chris Cornutt August 16, 2011 @ 12:04:37
Ian Christian has added a new post to his blog today showing how you can create a custom form field type in Symfony 2 by extending the AbstractType.
I am finally starting to dive into symfony 2 properly. Yes - it's taken a while, work has taken me in different directions! I found myself needing to create a custom form field type pretty quickly, but couldn't find much in the way of documentation to do so, so I thought I'ld throw it up here; partly to help others, but mostly to get feedback to make sure I'm not approaching this from the wrong angle.
He includes the code that creates his custom "Person" model and the class to create his "transport type" select box that pulls in its values from a "choice list" class. He registers it in his bundle and it can then be included in his buildForm() method just like any other form field.
voice your opinion now!
symfony tutorial custom form field select abstract
Jani Hartikainen' Blog: Database backed Zend_Form elements
by Chris Cornutt March 09, 2009 @ 08:45:27
Jani Hartikainen has a new post that should interest the Zend Framework developers out there - a look at automatically querying the database to fill in the right option values for a Zend_Form element.
It's not very tricky to query a database, and fill a Zend_Form element's possible values from the resultset, but it can be quite boring and extraneous code... We could also create an element which we can give some SQL, and it'll fill itself automatically! This way you can even define database-backed elements in XML or INI configuration files.
He starts with a simple Select element type example and builds from there. He creates a DbSelect layer for the element and with the help of a main method, _performSelect, the script can create a new instance of the CU_Form_Element_DbSelect to pull in the options from the SQL (given in the "dbSelect" parameter).
voice your opinion now!
database backend select option zendform zendframework query
Sameer Borate's Blog: Selecting all except some columns in MySQL
by Chris Cornutt March 02, 2009 @ 11:13:08
Sameer Borate shows how to turn things around in your application's SQL statement and, instead of selecting the columns you need, showing how to remove the columns you don't need dynamically.
The MySQL SELECT is a ubiquitous statement. You can select rows using the '˜*' operator or by listing the individual column names. But many times you may require using all the columns from a table except a couple of them. For example you may have a table containing twelve columns from which you require only eleven columns.
Sometimes that extra column can contain larger content you might not need or want. He creates a get_column_names and create_statement functions that grab the column names and, based on an "exclude" array, takes out the unwanted records. The array is then looped through and appended back together as the new column list for the select.
voice your opinion now!
select exception mysql column array remove
|
Community Events
Don't see your event here? Let us know!
|