Today I watched How much current can a 9V battery supply? Let’s test it! over on YouTube.
Tag Archives: test
France Grossly Underestimated Radioactive Fallout From Atom Bomb Tests
Common C libraries and data structures
Today I discovered: Common C libraries and data structures. (C99) over on github. So awesome.
I really like the project layout too. Each module in a directory with an example, a bunch of tests, and some documentation to go along with the code. I feel like this is how it should be done. I think today I grew as a programmer because I read this code.
PHPUnit @preserveGlobalState and @runTestsInSeparateProcesses
Today I learned about @preserveGlobalState and @runTestsInSeparateProcesses in PHPUnit.
OWASP ESAPI PHP tests: Security configuration file does not exist
To get the source for OWASP ESAPI PHP:
svn checkout http://owasp-esapi-php.googlecode.com/svn/trunk/ owasp-esapi-php-read-only
Make sure phpunit is installed with PEAR. To run the unit tests:
root@mercy:/home/jj5/Desktop/owasp-esapi-php-read-only# phpunit test Security configuration file does not exist.PHP Fatal error: Call to a member function xpath() on a non-object in /home/jj5/Desktop/owasp-esapi-php-read-only/src/reference/DefaultSecurityConfiguration.php on line 226
To get a better error message:
root@mercy:/home/jj5/Desktop/owasp-esapi-php-read-only# grep -R 'Security conf' . ./src/reference/DefaultSecurityConfiguration.php: throw new Exception("Security configuration file does not exist.");
Edit ‘src/refererence/DefaultSecurityConfiguration.php’ and replace “Security configuration file does not exist.” with “Security configuration file ‘$path’ does not exist.”
Try again:
root@mercy:/home/jj5/Desktop/owasp-esapi-php-read-only# phpunit test Security configuration file '/home/jj5/Desktop/owasp-esapi-php-read-only/test/filters/../../testresources/ESAPI.xml' does not exist.PHP Fatal error: Call to a member function xpath() on a non-object in /home/jj5/Desktop/owasp-esapi-php-read-only/src/reference/DefaultSecurityConfiguration.php on line 226
So the problem is a misconfigured path to the ESAPI.xml file,
root@mercy:/home/jj5/Desktop/owasp-esapi-php-read-only# grep -R \\.\\.\\/testres . ./test/filters/SafeRequestTest.php: $ESAPI = new ESAPI(dirname(__FILE__) . '/../../testresources/ESAPI.xml'); ...
Edit the SafeRequestTest.php file:
root@mercy:/home/jj5/Desktop/owasp-esapi-php-read-only# vim test/filters/SafeRequestTest.php
On line 58 change “/../../testresources” to “/../testresources”.
Now our tests will run:
root@mercy:/home/jj5/Desktop/owasp-esapi-php-read-only# phpunit test
QuirkTools Screenfly
Found out about this handy utility the other day: ScreenFly.
It allows you to test your website on various device form-factors. Handy!
MemberNet PHP tests now have submenu
I’ve been working on my PHP tests system on my MemberNet site.
As you can see if you check out one of the tests, for example the phpinfo test, there is now a submenu that has links for the HTML source, the PHP source, the W3C HTML validator and the W3C CSS validator.