spec\PhpSpec\Locator\PrioritizedResourceManagerSpec::it_uses_the_resource_from_the_highest_priority_locator_when_duplicates_occur PHP Метод

it_uses_the_resource_from_the_highest_priority_locator_when_duplicates_occur() публичный Метод

public it_uses_the_resource_from_the_highest_priority_locator_when_duplicates_occur ( $locator1, $locator2, PhpSpec\Locator\Resource $resource1, PhpSpec\Locator\Resource $resource2 )
$resource1 PhpSpec\Locator\Resource
$resource2 PhpSpec\Locator\Resource
    function it_uses_the_resource_from_the_highest_priority_locator_when_duplicates_occur($locator1, $locator2, Resource $resource1, Resource $resource2)
    {
        $locator1->getPriority()->willReturn(2);
        $locator2->getPriority()->willReturn(1);
        $this->registerLocator($locator1);
        $this->registerLocator($locator2);
        $resource1->getSpecClassname()->willReturn('Some\\Spec');
        $resource2->getSpecClassname()->willReturn('Some\\Spec');
        $locator1->getAllResources()->willReturn(array($resource1));
        $locator2->getAllResources()->willReturn(array($resource2));
        $this->locateResources('')->shouldReturn(array($resource1));
    }