We have a Repository object, which has a Storage object and a Repository object passed in through the constructor. The method I need to test, saves a collection of entities in the following method:
public function saveCollection(Collection $currencies)
{
$this->getStorage()->saveCollection($currencies);
if (isset($this->repository)) {
$this->getRepository()->saveCollection($currencies);
}
}
For some reason, my test throws, "method Double\blahblah\Db\P51e421061b7b4::saveCollection()` not found.
function it_should_save_collections($collections, $db)
{
$db->saveCollection()->willReturn(null);
$this->setStorage($db);
$this->saveCollection($collections)
->shouldReturn(null);
}
Tried pretty much every combination of willReturns and tweaks to get around it but no luck. Any suggestions? I'm testing $db->saveCollection separately and that's working perfectly fine.
Cheers,
J
--
You received this message because you are subscribed to the Google Groups "PHPSpec - Behavior Driven Design (BDD) for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpspec-dev...@googlegroups.com.
To post to this group, send email to phpsp...@googlegroups.com.
Visit this group at http://groups.google.com/group/phpspec-dev.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "PHPSpec - Behavior Driven Design (BDD) for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpspec-dev...@googlegroups.com.
To post to this group, send email to phpsp...@googlegroups.com.
Visit this group at http://groups.google.com/group/phpspec-dev.
For more options, visit https://groups.google.com/groups/opt_out.