Phpspec Нет вызовов, которые соответствуют

Я phpspec с phpspec и No calls have been made that match во время вызова. Вот код до сих пор:

  function it_imports_social_feeds( ContainerInterface $container, FacebookManagerFactory $managerFactory, FacebookConnector $facebookConnector, FacebookMapper $facebookMapper, EzContent $ezContent, Collection $feed, Content $content ) { $chainProfiles = []; $container->getParameter('someParam1')->willReturn($chainProfiles); $container->get('someParam2') ->shouldBeCalled()->willReturn($managerFactory); $managerFactory->createFacebookConnector(Argument::type('string'))->willReturn($facebookConnector); $facebookConnector->getFeed()->shouldBeCalled(); $facebookMapper->getData()->willReturn($feed); $container->getParameter('someParam3')->shouldBeCalled(); $container->getParameter('someParam4')->shouldBeCalled(); // these 2 call are issue $ezContent->save(Argument::type('array'), Argument::any(), Argument::any())->willReturn($content)->shouldBeCalled(); $ezContent->updatePublishedDate(Argument::type('string'), $content)->shouldBeCalled(); $this->importFeeds(); } 

И реализованный метод класса:

 public function importFeeds() { $socialChainsProfiles = $this->container->getParameter('mrkisha_social_feed_profiles'); foreach($socialChainsProfiles as $socialMedia => $chainsProfiles) { foreach($chainsProfiles as $chain => $chainsProfile) { $fbConnector = $this->container ->get("social.feed.facebook.factory") ->createFacebookConnector($chainsProfile); $fbMapper = new FacebookMapper($fbConnector); $fbData = $fbMapper->getData(); $contentTypeIdentifier = $this->container->getParameter('social_feed_content_type_identifier'); $folderId = $this->container->getParameter('social_feed_folder_ids')[$chain]; $sortedData = $fbData->sortByDesc('publishedAt')->values()->all(); foreach ($sortedData as $item) { $item['socialFeed'] = $socialMedia; $publishedDate = $item['publishedAt']; unset($item['publishedAt']); // These 2 calls withing loop phpspec does not see $content = $this->ezContent->save($item, $contentTypeIdentifier, $folderId); $this->ezContent->updatePublishedDate($publishedDate, $content); } } } } с public function importFeeds() { $socialChainsProfiles = $this->container->getParameter('mrkisha_social_feed_profiles'); foreach($socialChainsProfiles as $socialMedia => $chainsProfiles) { foreach($chainsProfiles as $chain => $chainsProfile) { $fbConnector = $this->container ->get("social.feed.facebook.factory") ->createFacebookConnector($chainsProfile); $fbMapper = new FacebookMapper($fbConnector); $fbData = $fbMapper->getData(); $contentTypeIdentifier = $this->container->getParameter('social_feed_content_type_identifier'); $folderId = $this->container->getParameter('social_feed_folder_ids')[$chain]; $sortedData = $fbData->sortByDesc('publishedAt')->values()->all(); foreach ($sortedData as $item) { $item['socialFeed'] = $socialMedia; $publishedDate = $item['publishedAt']; unset($item['publishedAt']); // These 2 calls withing loop phpspec does not see $content = $this->ezContent->save($item, $contentTypeIdentifier, $folderId); $this->ezContent->updatePublishedDate($publishedDate, $content); } } } } 

Я новичок в тестировании, а ресурсы в Интернете для phpspec почти не существуют, любая помощь очень ценится в отношении того, какую концепцию мне не хватает, и что я делаю неправильно.