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に渡すにはどうすればよいですか?