Archive for June 27th, 2007

Zend Developer Zone: Acceptance Testing of Web Applications with PHP

From the Zend Developer Zone, there’s a tutorial covering acceptance testing of web applications, specifically using PHPUnit and Selenium.

In this article I introduce the topic of Acceptance Testing (aka Functional Testing), something more PHP programmers should be starting to practice. I’m sure many of us are well aware of Unit Testing and even Integration Testing so where does this third wheel come into play for web applications given our growing obsession with Web 2.0 and AJAX and how does it differ from the former two practices? Below I’ll explain this.

They start by asking “Why acceptance testing?” at all with an answer of “it’s not about isolated testing, but testing as a whole”. The rest of the article is broken up into several parts:

  • Of User Stories and Acceptance Tests
  • The Iteration Plan
  • Preparing For Acceptance Testing (setting up PHPUnit and Selenium)
  • Writing And Running The Acceptance Tests
  • How to run the tests

In their example they show how to validate that a login on the site works as expected (including interacting with a form on the page).

Continue Reading · Add comment

WebReference.com: Unary, Binary, and Ternary Operators in PHP

WebReference.com has a new tutorial that looks at the difference sorts of operators that PHP has to offer - unary, binary and ternary - to help you with the logic in your applications.

An operator is a special character or combination of characters that operates on variables. There are 3 types of operators in PHP: unary, binary and ternary. They can be used to manipulate a variable with up to 3 arguments at a time. This article wasn’t written to discuss the meaning and usage of each operator in PHP, but rather to explain the differences between these types of operators and to give examples about how each functions.

They look at the different types of operators (and include examples for each) - unary (like ! or ++), binary (things like + / == and &&) and a special case - ternary. This uses two characters in conjunction (the question mark and colon) to replace a simple sort of If statement.

Continue Reading · Add comment

Vinu Thomas’s Blog: Project Jaws

Vinu Thomas points out a CMS project over on the Google Summer of Code that’s looking to make administering the content/functionality of the site simple and easy - the Jaws Project.

Jaws is a Framework and Content Management System for building dynamic web sites. It aims to be User Friendly giving ease of use and lots of ways to customize web sites, but at the same time is Developer Friendly, it offers a simple and powerful framework to hack your own modules.

As Vinu notes, the project also uses some Ajax functionality to help make things more responsive and easier to work with. Check out some screenshots of the project to get a feel for what all it includes so far or just download it now and try it out yourself.

Continue Reading · Add comment

Foobr.co.uk: Focus Cloud [concept]

Jonathan Snook points out a new take on working with tags on a site - a focus cloud.

With this fairly broad classification I set about working out exactly what a Focus Cloud should show. To me the name could only suggest one thing. It shows the area which currently is receiving the most Focus! […] So a Focus Cloud should show not what has been the most popular tags overall, but what is the most popular tags at present. What is your current focus.

The post not only includes the theory behind these focus clouds but also has some PHP code to back it up (using the del.icio.us interface and tags as the foundation of the cloud’s contents). The full code for the cloud can be grabbed here.

Continue Reading · Add comment

Stoyan Stefanov’s Blog: CSS Sprites generation tool

In his latest post, Stoyan Stefanov introduces a new project he’s working on, the implementation of CSS sprites:

This is a simple technique used for page load performance purposes. Since HTTP requests are the most expensive thing you can do in regards to front-end performance, you strive for making as little requests as possible. So instead of having the browser download 4 rounded corner images for example, you create one image that has all four. Then you use CSS’ background-position to only show the part of the image you want.

He explains briefly how the system works and includes a simple example in PHP (showing how to use the imagemagik utility to create the custom image).

Continue Reading · Add comment