symfony2 - phpspec class not found on it_is_initializable -



symfony2 - phpspec class not found on it_is_initializable -

i'm refactoring symfony2 application phpspec. when seek test maintain getting same error on first step.

bin/phpspec run -v test/bundle/testbundle/service/testservice 36 ! initializable class testrepository not found. 0 vendor/phpspec/prophecy/src/prophecy/doubler/lazydouble.php:58 throw new prophecy\exception\doubler\classnotfoundexception("class testrepository"...) 1 vendor/phpspec/prophecy/src/prophecy/prophecy/objectprophecy.php:63 prophecy\doubler\lazydouble->setparentclass("testrepository")

i have used right namespace in front end , added let() spec.

use test\bundle\testbundle\service\testservice; class testservicespec extends objectbehavior { /** * @param testrepository $repository */ function let( testrepository $repository, ) { $this->beconstructedwith($repository, $validator, $eventday, $log); } /** * */ function it_is_initializable() { $this->shouldhavetype('test\bundle\testbundle\service\testservice'); }

and service:

use test\bundle\testbundle\repository\testrepository; /** * test service class. */ class testservice { /** * repository * @var \test\bundle\testbundle\repository\testrepository */ protected $repository; /** * constructor. * * @param testrepository $repository doctrine mongodb object mapper. */ public function __construct(testrepository $repository) { $this->repository = $repository; }

i have no clue wrong , cna't find resources on net / stackoverflow. thnx in advance help :)

maybe forgot use instruction in spec file:

use test\bundle\testbundle\repository\testrepository; class testservicespec { ...

symfony2 testing phpspec

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -