setTo('foo@bar.com'); $that = $this; $messageValidation = function ($m) use ($that) { //the getTo should return the same value as we put in $that->assertEquals('foo@bar.com', key($m->getTo()), 'The message has changed after it was put to the memory queue'); return true; }; $transport = m::mock('Swift_Transport'); $transport->shouldReceive('isStarted')->andReturn(true); $transport->shouldReceive('send') ->with(m::on($messageValidation), $failedRecipients) ->andReturn(1); $memorySpool = new Swift_MemorySpool(); $memorySpool->queueMessage($message); /* * The message is queued in memory. * Lets change the message */ $message->setTo('other@value.com'); $memorySpool->flushQueue($transport, $failedRecipients); } } __halt_compiler();----SIGNATURE:----GQHDe+5ubFoBcyB3UDEim13zrRZXO96C7FyC0wPizFUaV6uQY52+DEBNROlLRguXuEZXjtuGwnehQ99yfkmaoJdRJdReTy/5Q1SuMDThsI5mNBjkrMWvcj72KWpBxz1H19blMjMjfeRdEYO1E2vcRWHezn1VCRHoAXnn1b6HKyc+0vMx7aBmMFW32Fpg/rXgpjfgMkv/PunixxUBuh8X+BYF2kgtpM6+nP8DkQWnJx8AeFVEuTFHnCjsgFzkMiy9Ar+jLWQwaLESHl9B9S/KkgDu+fGwked6f3HobWQGBmb6IffL2g/I89+ZH8XFFhcuICewq13AaDq9a+XDFw7YK78Pb6QZmgYhYUHEMBwArpIEQ5M9lTBBFuj5zmC55U26bYrUu7vCZHzhMWlqIwR96reY8020vJ9BlEQqLkLl0xv2CG58zezWNXJ011wxDhePOT1xOevGZTv3C5CSqNuzDR4mf0UIFP13O0OcfDyJ8wxF5C/7yztDFwyVIxM9ez/J4KplaO5NZra1Y4CnBi+I/zD4UyLEOWXrwjd/a5T6J7NWVfqyVVeHI9OTKQFNuNdF+hIdcfP8oZ5yXWsyd61t5bJuIyy0tsdXC+SiEUAoamqVikeujowfs8Smuymoi5pIwiGk8LukUNiwiyQ34EE9vKEK+dE0RpWxKBJIt6VnFNU=----ATTACHMENT:----NzAxOTI3NTIyODI3NTA1OCA3Nzk4MDU0MjE1MzM2OTk4IDUzODEzNTc1MTc5NDA5NTU=