Friday, June 26th, 2009
After learning to write tests and some good testing practices, it's now time to look at mock objects.
When testing a class which needs an instance of another class to work, you do not want to depend on the other class too much. This is where mock objects come in - ...
Posted in Programming | 6 Comments »
Wednesday, June 17th, 2009
Now that you know what unit testing is and how to write and run tests, it's time to look at writing tests in more depth.
Today we'll take an example class and write tests for it. We'll also introduce some common testing methodologies.
Posted in Programming | 8 Comments »
Wednesday, June 10th, 2009
Continuing from the unit test introduction, we will now continue and take a look at how to write tests and ways to run the tests.
Posted in Programming | 13 Comments »
Monday, June 8th, 2009
Today I'd like to point out a bunch of good articles about refactoring - the process of improving code without changing the functionality.
Sameer Borate has written four posts about the topic in his blog, and I encourage you to check them out:
Refactoring: An introduction to PHP programmers
Refactoring 1: Conslidate ...
Posted in Programming | 2 Comments »
Wednesday, May 20th, 2009
If your application is well thought out, you would not want to save any data that isn't valid. So what do you do, when you need different validation schemes, say for passwords, depending on some special case?
For example: Your user passwords need to be at least 8 characters long and ...
Posted in Programming | 6 Comments »
Saturday, May 16th, 2009
The best PHP ORM libraries, Doctrine and Propel. Last year I compared them to each other, and now it's time to get a fresh look at how they have advanced in about a year - Is Doctrine still the better of the two?
This time, I'll also look at the features ...
Posted in Programming | 24 Comments »
Thursday, May 7th, 2009
Zend_Forms, models, validation and how they all work together is a tricky topic. There are many opinions and many ways to do it.
This time I'll show you what I think could be the answer to validating forms without having to duplicate validation code both in a model class and ...
Posted in Programming | 8 Comments »
Tuesday, April 14th, 2009
I wrote an article for Packt Publishing about PHP's magic features: Magic functions, methods and constants.
The article has now been published on Packt's website, and you can read it here!
Posted in Programming | 1 Comment »
Thursday, April 9th, 2009
Firstly, apologies for the lack of posts lately. I'm pretty busy with various things right now, so I don't have much time for blogging. Hopefully I'll have some pretty interesting/cool stuff to show you later, though!
Now, here's something interesting I spotted recently: Creating a custom front controller for Zend Framework.
Federico ...
Posted in Programming | 1 Comment »
Sunday, April 5th, 2009
How to use FCKeditor, or any other WYSIWYG editor, with Zend_Form? Another relatively common question.
There are many ways you can do this, but let's look at these two as they are the best in my opinion:
Adding some JavaScript to your view script
Creating a Zend_Form_Decorator
We'll be using FCKeditor, but you can ...
Posted in Programming | 11 Comments »