我正在寻找一种方法来表示 PHPSpec 中每个测试方法的以下内容,每个测试都需要一个像这样创建的类构造函数
$config = new Config( 'path_to_config' );
$client = new SOAPService( $config );
$debtor = new Debtor( $client );
然后我可以测试类似的东西
class DebtorSpec extends ObjectBehavior
{
function it_has_method_getDebtor()
{
$debtor->getDebtor( '123' )->shouldReturn( TRUE );
}
}
如何将这种类构造函数传递给 phpspec?