 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Chris Jones: Using the PHP CLI Webserver to Identify and Test Memory Issues in PHP
by Chris Cornutt August 15, 2012 @ 08:35:07
Chris Jones has a new post today showing how you can use PHP 5.4's built-in web server to help test for memory issues in your application (and the language).
Rasmus mentioned on IRC how he ran the [command line] tests: simply renaming the ".phpt" test files as ".php", and invoking them through the CLI webserver. The SKIPIF sections get executed, but that doesn't affect the desired outcome of testing multiple HTTP requests with different input scripts. [Here] are some quick shell scripts I put together to automate testing the OCI8 extension with valgrind.
He uses the OCI8 extension as an example, showing how to set up these scripts to enable the execution of the tests, fire up the web server and execute Valgrind to help monitor the memory of the execution.
voice your opinion now!
builtin webserver cli test unittest phpt tutorial shell
QaFoo.com: Testing file uploads with PHP
by Chris Cornutt December 13, 2010 @ 13:53:24
On the QaFoo.com site Manuel Pichler has posted a new tutorial about using unit testing, specifically with PHPUnit (really ending up on phpt) to test and be sure that your file upload handling is working correctly.
A question I am asked on a regular basis is, how you can test a file upload with PHP. In this blog post, I take a precise look at this topic and show you how to test your file uploads from within your standard testing environment, using widely unknown testing framework for PHP.
He shows how to use a custom $_FILES superglobal to mimic the upload process noting, however, that this won't work due to possible file handling on the backend. His alternative is to use a phpt test to push a raw posted file to the application and then check the results. He then shows how to take these functioning tests and drop them back into PHPUnit via it's "PhpTestCase" handling. You can find full code examples here.
voice your opinion now!
testing unittest file upload phpunit phpt tutorial
Rafael Dohms' Blog: PHPT Writing tests for PHP
by Chris Cornutt August 25, 2009 @ 12:05:35
If you've ever wanted to give back to the PHP project, but weren't sure quite how, Rafael Dohms has written up a post to make one of the options much easier to get into - writing PHPT tests for the PHP language.
The beauty about PHPT is that you need to know very little other than writing PHP code. A little knowledge into the inner workings of PHP will of course help you in finding areas of code that need testing, and how best to test them, but just knowing PHP is enough to start.
He leads you through a five step process that'll have you up and writing tests in no time - setting up your environment, looking for something to test, writing and executing a test and submitting the results back to the PHP project. He sprinkles in a few code bits and screenshots to help point you in the right direction.
voice your opinion now!
phpt test tutorial introduction
Lorna Mitchell's Blog: Testing PHP
by Chris Cornutt May 04, 2009 @ 12:06:42
In this new post to her blog Lorna Mitchell talks a bit about the upcoming TestFest event happening in Manchester next weekend and what she's learned about testing PHP to make things flow a bit smoother for her while there (and you, should you want to write tests in the future).
In preparation I decided it was high time to sit down and figure out what testing PHP is all about. People kept telling me it was easy but I had no clear picture of how all the pieces went together - there are different ways of doing the same thing and although I have been keen to get involved with testing for some time, I haven't been able to get started until now.
She looks at the automated tests as a part of the build ("make test") and some of the screens from the lcov testing results. She also recommends reading up on the phpt documentation to help you get going.
voice your opinion now!
testing phpt testfest manchester learn maketest lcov
Stefan Koopmanschap's Blog: TestFest is back!
by Chris Cornutt April 28, 2009 @ 08:46:49
In a recent blog post Stefan Koopmanschap reminds the PHP development community that the PHP TestFest is back again this year!
Last year's TestFest was a huge success. The worldwide initiatives by usergroups and individuals gave a nice addition to the code coverage for PHP itself. This year, the TestFest period has been extended to 3 months, starting the beginning of this month and ending end of june. But a nice bunch of European usergroups including the Dutch usergroup are combining TestFest on may 9th!
TestFest events are happening all over the world - you can see if there's one near you on this page of the PHP.net wiki. For those attending php|tek this year, there'll also be a TestFest going on during the Hackathon event (read our interview about the event here).
voice your opinion now!
testfest09 testfest hackathon community phpt test usergroup
Greg Beaver's Blog: Pyrus, PEAR2 and web code coverage report for phpt-based tests
by Chris Cornutt February 17, 2009 @ 09:31:57
Greg Beaver has posted an update one some of the things he's been working on in the realm of his projects - Pyrus, PEAR2 and code coverage for phpt-based tests.
In any case, now that work on ext/phar has shifted primarily to maintenance mode, and namespaces are finally ancient history, I've shifted all of my coding energy to getting Pyrus, PEAR's next-generation installer, ready to ship.
Pyrus is the PEAR installer as rewritten for the next major PHP release (5.3) and uses a lot of the new features it offers (including full archive support, SQLite 3, combined configuration files and several new developer-centric additions). He also includes a sample bit of code that he worked up to run code coverage reports against the PEAR packages. He includes links to three different examples of the report's output.
voice your opinion now!
pyrus pear codecoverage unittest phpt test installer pear2
Johannes Schluter's Blog: NetBeans plugin for running phpt tests
by Chris Cornutt December 18, 2008 @ 09:35:16
In a new post to his blog today Johannes Schluter talks about a plugin for the NetBeans IDE that allows you to run tests for PHP's regression test suite right in the editor.
The test system therefore produces a bunch of files, a file containing the expected output, one containing the actual output and a diff between these as relevant files. The problem there is that the diff, for being portable, is using a quite simple mechanism which only shows the lines which differ without any context.
[...] Lately I've changed my way of working and use vim less, I still use it, but I use NetBeans as an IDE more and more. So I thought a bit about that test issue and searched my brain for my Java skills and started playing around to see whether I manage to write a NetBeans plugin which can run the tests and report the results in a usable way.
Hes created a project for the plugin (where you can download the latest version - 0.6.0) and install it to your local IDE copy. It adds a toolbar icon, asks for the location of the binaries to test and runs the diff quickly and easily. You can see a screenshot of the tool in action here.
voice your opinion now!
netbeans plugin phpt test regression toolbar button wizard
Maarten Manders' Blog: Static + Unit Tests = Arrrghhh!
by Chris Cornutt August 08, 2008 @ 10:23:08
Take a hint from Maarten Manders when renaming and moving around your unit testing order:
It's absolutely amazing how much you can mess up unit tests just by changing their order! (Trevi_* comes after Tilllate_*) Everyone knows that tests are supposed to be independent. But we all know how it is.
He asks for recommendations on what to do to help the situation. Comments on the post (including ones from Lukas Smith and Sebastian Bergmann) mention using PHPT, a new version of PHPUnit that will do just what he wants and whether or not to use Singletons.
voice your opinion now!
unittest static phpt phpunit recommend
|
Community Events
Don't see your event here? Let us know!
|