for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace spec\Knp\RadBundle\Mailer;
use PhpSpec\ObjectBehavior;
class MessagesLoggerSpec extends ObjectBehavior
{
/**
* @param Knp\RadBundle\ObjectStore\ObjectStoreInterface $objStore
* @param Swift_Mime_Message $a
* @param Swift_Mime_Message $b
* @param Swift_Mime_Message $c
*/
function let($objStore, $a, $b, $c)
$this->beConstructedWith($objStore);
$objStore->findAll()->willReturn(array($a, $b, $c));
}
function it_should_store_a_given_message($objStore, $a)
$objStore->store($a)->shouldBeCalled();
$this->storeMessage($a);
function it_should_get_messages_sent_to_a_specific_email($objStore, $a, $b, $c)
$objStore
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$a->getTo()->willReturn(array('[email protected]' => 'John'));
$b->getTo()->willReturn(array('[email protected]' => 'Sarah'));
$c->getTo()->willReturn(array('[email protected]' => 'George', '[email protected]' => ''));
$this->getMessagesSentTo('[email protected]')->shouldReturn(array($a, $c));