2014-06-17 3 views
1

으로 잘못하고 이것이 내 테스트 코드 :내가 조롱

1) TransceiverTest::testTransceiverEntityCreate Argument 2 passed to Recoder\Entities\Transceiver::__construct() must be an instance of Recoder\TransceiverUtils, instance of Mockery_2__TransceiverUtils given, called in /var/www/solidoptics-recorder/private/application/libraries/Recoder/tests/Entities/TransceiverTest.php on line 35 and defined

왜 Mockery_2__TransceiverUtils :

public function testTransceiverEntityCreate() 
{ 
    $transceiver_driver = Mockery::mock('Recoder\Drivers\TransceiverDriverInterface'); 
    $transceiver_driver->shouldReceive('load'); 

    $transceiver_utils = Mockery::mock('TransceiverUtils'); 

    new Transceiver('1F2D03', $transceiver_utils, $transceiver_driver); 
} 

나는 그것을 반환 테스트를 실행 오류 다음? 나는 어떤 아이디어라도 기뻐할 것이다. 감사.

답변

1

이것은 클래스가 발견되지 않아서 Mockery가 클래스를 확장하지 않고 완전히 모의합니다. 클래스는 이미로드되었거나 자동 로딩을 통해로드 할 수 있어야합니다.

+0

감사합니다. 그것은 작동합니다! –