Simple example of controlling access to resources based on origin IP address, this example validates origin is a private IP range.
I have also added the supporting unit test, note that I am reflecting the method inorder to set it to public visibility to allow testing of it. It should also be note that in order to generate the tests you must change the protected to public so that PHPUnit will recognize the annotated assertions and generate the desired tests.
* Test class for PrivateIPAssertion.
* Generated by PHPUnit on 2011-06-11 at 19:38:41.
* Generated from @assert ('10.0.0.1') == true.
* Generated from @assert ('192.168.0.1') == true.
* Generated from @assert (68.45.32.17) == false.