【发布时间】:2015-07-22 12:58:00
【问题描述】:
如何使用 Cest 格式的“@dataProvider”? (http://codeception.com/docs/05-UnitTests#Cest) 例如我有这个代码。怎么写成Cest格式
class ExampleTest extends \Codeception\TestCase\Test
{
/**
* @dataProvider providerAdd
*/
public function testAdd($a, $b, $c)
{
$this->assertEquals($c, ($a + $b));
}
public function providerAdd()
{
return array (
array (2, 2, 4),
array (2, 3, 5),
array (3, 5, 8)
);
}
}
【问题讨论】:
标签: php unit-testing codeception