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)); }