Skip to content

Instantly share code, notes, and snippets.

@vatson
Created October 24, 2011 20:43
Show Gist options
  • Save vatson/1310182 to your computer and use it in GitHub Desktop.
Save vatson/1310182 to your computer and use it in GitHub Desktop.
<?php
$loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
$loader
->expects($this->exactly(2))
->method('load')
->with(
$this->logicalOr(
$this->equalTo($resource1),
$this->equalTo($resource2)
),
$this->logicalOr(
$this->equalTo($locale),
$this->equalTo($locale)
),
$this->logicalOr(
$this->equalTo('messages'),
$this->equalTo('messages')
)
)
->will($this->returnCallback(function($actual_resource) use($resource1_message_catalogue, $resource2_message_catalogue, $resource1, $resource2) {
if($actual_resource == $resource1) {
return $resource1_message_catalogue;
}
if($actual_resource == $resource2) {
return $resource2_message_catalogue;
}
}))
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment