[Solar-talk] Solar Testing via external test library
Travis Swicegood
development at domain51.com
Wed Oct 11 13:36:07 PDT 2006
Hello all,
Sorry this thread got dropped, but other code got in the way. The rest
of the email continues below...
Clay Loveless wrote:
> On Oct 4, 2006, at 9:09 AM, Paul M Jones wrote:
>
>
>> Sounds OK to me, if we can get a guru to convert the existing tests
>> then that's fine. (Would be good to target PhpUnit3, I think, seeing
>> as it's PHP5 and fully name-spaced, but arguments in favor of
>> SimpleTest happily accepted.)
>>
>
> Interesting, interesting.
>
> Some good points about depending on oneself to test oneself --
> probably best to have an external entity for testing.
>
> While I like some things about SimpleTest as well, I think today's
> announcement of PHPUnit3's support for Selenium makes it a very, very
> strong contender for the preferred testing framework.
>
I've played with PHPUnit3 a bit this morning and even wrote some basic
tests for Solar::loadClass() and Solar::factory() for it. I have a few
issues with it that I thought I'd bring up to the list and see what
other's thought.
* No easy way to change output from text via CLI to any other format
SimpleTest employs reporters to allow you to create your own output. By
default it comes with Text, HTML, XML, and a ColorText for CLI use.
Everything but the XML output is just a nicety, but the XML can be used
to aggregate tests from multiple servers and run their results back
through your unified tester
* No expectations (i.e., expectError())
The function file_exists() does not scan the include_path for a file. To
do an environment check and make sure Solar.php is availalbe, you need
to do an include('Solar.php') and insure that no errors were generated.
With PHPUnit3, I'm not seeing a way to make that happen.
There are two big pluses that have been brought up - the Selenium
support and the fact that it's PEAR.
1. Selenium support would not be that hard to add to SimpleTest.
Actually, the class that PHPUnit3 uses could be used with just a handful
of lines of code modified.
2. PHPUnit3 being part of PEAR and used by most tested PEAR packages is
not something I can disagree with. The one thing I can bring up is that
unit test suites all carry similar enough languages that if you're not
having to worry about setup and you're just reading the test cases, you
can read through any of them in any language easily.
Any thoughts, ideas? In the mean time, I'm going to float the idea of
adding a Selenium extension to SimpleTest on the ST dev mailing list and
see what the response there is.
-Travis
More information about the solar-talk
mailing list