Re: Naming conventions in phpt
| From: | Christian Weiske | Date: | Mon, 28 Jan 2008 20:25:14 +0000 |
| Subject: | Re: Naming conventions in phpt | ||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-4777@lists.php.net to get a copy of this message | ||
Hello Till,
> On a sidenote - a small section ("How to write tests") referencing the
> phpt URL and maybe a phpUnit HOWTO would be nice in the PEAR manual as
> well.
Yes, that's a good idea and should be done for pear2 :)
Basic steps:
$ phpunit --skeleton My_Class_Name
$ mkdir -p tests/My/Class
$ mv My/Class/NameTest.php tests/My/Class/
edit the test to
> chdir(dirname(dirname(__FILE__)))
at the beginning, so that we're chdir'ing into the src dir.
Then run
$ php tests/My/Class/Name.php
An AllTests.php file is also nice; you can copy one from the other
packages.
--
Regards/Mit freundlichen Grüßen
Christian Weiske
Attachment: [application/pgp-signature] signature.asc
Attachment: [application/pgp-signature] signature.asc