News Feed
Sections




News Archive
feed this:

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

Master Zend Framework:
Simplifying Unit Testing (and asking for help when needed)
March 20, 2014 @ 11:54:16

On Matthew Ssetter's "Master Zend Framework" blog today he talks about simplifying unit testing and some of his experience with getting too complicated in his own testing practices.

Recently I was a bit stuck, trying to figure out how to test a section of an application I've been developing. Specifically, I was trying to mock a HydratingResultSet in a controller test, so it could be the return value of a method call on a datasource, my controller needed. I was sure it was the right approach to help ensure the functionality in question was working properly. But no matter what I tried, my tests didn't work, because I wasn't mocking it correctly. [...] I asked for help [on IRC], laying out the problem as I saw it. The first response which came back, from Ocramius, stopped me dead in my tracks: "Why are you trying to do that?"

He includes a bit of background on what he was trying to test and the functionality around it and how, when he stopped to think about it, wondered why he was testing it too. He talks about the refactor he made to his code with a positive end result - the tests now passed. He suggests a few questions to ask yourself when writing your tests such as "am I doing too much?" or "am I testing code in the right place?" Chances are, if you step back and really look at what you're testing, you might realize that the answer to these questions is just to simplify.

He finishes the post with a few suggestions, some of his own personal favorites, of places you can go for help when questions do pop up. He points out that the usual excuses shouldn't be a blocker on asking for help. He is "encouraging you to set your pride, ego and excuses aside and when you're stuck: ask for help."

0 comments voice your opinion now!
testing simplify unittest zftalk help question

Link: http://www.masterzendframework.com/people/right-approach-unit-testing-asking-help

NetTuts.com:
Simplify Form Handling in a Big Way
February 02, 2011 @ 12:16:54

On NetTuts.com today there's a new tutorial that wants to help you simplify your form handling in your PHP application with a few advanced tips.

Save time, reduce maintenance pains, simplify your code, and do it all while feeling like a freakin' genius! In this tutorial, learn how to use variable variables, lookup arrays, and a bit of clever programming to simplify form handling in a big way.

They show how to use variable variables in some practical examples of filtering posted information and an alternative to creating multiple form handling scripts that all do (virtually) the same thing. They've created an alternative - a single script that uses a large switch to filter through each posted element.

1 comment voice your opinion now!
simplify form handling tutorial


RIA Development Center:
Expression Web 2 for PHP Developers - Simplifying Your PHP Applications
September 30, 2008 @ 09:38:53

On the RIA Development Center website, there's this recent post showing off the Expression Web 2 software and how PHP developers could use it in their coding work.

Some of the most important new features in Microsoft's recently released Expression Web 2 involve enhanced support for PHP. Don't think this is just a half hearted effort to appeal to the Open Source web development crowd. Expression Web 2 supports PHP developers with a carefully constructed, feature full treatment which you should seriously consider for your PHP applications.

These new features include a built-in development server with integrated browser support, include and design view integration, IntelliSense (code completion) and support for XHTML syntax and syntax highlighting.

0 comments voice your opinion now!
microsoft expresssionweb2 simplify development application



Community Events





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


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

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