unit testing - Parametrized tests in PHPUnit -


on junit, can use annotation @runwith(parameterized.class) run single unit test several times different actual , expected results. i'm new phpunit know suggested approachs achieving same (running 1 unit test many actual, expected results)?

you can use called data provider. this:

/**  * @dataprovider testpersondataprovider  */ public function testperson($name, $age) {     // test ... }  public function testpersondataprovider() {     // test values     return array(         array('foo', 36),         array('bar', 99),         // ...     ); } 

you define data provider using @dataprovider annotation.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -