[TYPO3-core] RFC #10220: Feature: Get some unit tests for the core
Robert Lemke
robert at typo3.org
Fri Jan 23 11:24:20 CET 2009
Hi all,
Am 23.01.2009 um 10:24 schrieb Ernesto Baschny [cron IT]:
>> Yes, that's the problem of fitting the following things in one
>> function
>> name:
>>
>> 1. "test" (required for the function to be recognized as a test
>> function)
Nope, that's not require anymore - PHPUnit supports annotations:
/**
* @test
*/
public function
aNewCustomerIsAssignedACustomerNumberRequestedFromTheCustomerNumberService
() {
...
}
> I don't really see the need to have that much information in the test
> names function. If some test "failed", you will have to look at the
> test
> function anyway, to see what was wrong.
>
> Even better is to document the test cases (phpdoc) so that one knows
> what is being tested. It is very ugly to have all information inside
> the
> difficult-to-read function name.
Well, the long function names do have a purpose of course. With the
TestDox
feature you can create some nice "agile" reports:
http://www.phpunit.de/manual/current/en/other-uses-for-tests.html
However, I have to admit that we don't use method names like the one
above.
Those in v5 are a bit more focussed on the actual methods and
technical background:
createCustomerRequestsANewCustomerNumberFromTheCustomerNumberService()
I think that both styles are helpful: the first one is suited well for
functional
tests and the second is better for true unit tests.
Cheers,
robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: Signierter Teil der Nachricht
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090123/ecee46ea/attachment-0001.pgp
More information about the TYPO3-team-core
mailing list