function it_finds_matching_nodes(ResourceNode $f1, ResourceNode $f2) { $criteria = ['search' => 'criteria']; $f1->matches($criteria)->willReturn(false); $f2->matches($criteria)->willReturn(true); $this->findMatching($criteria)->shouldBeLike(new ResourceCollection([$f2->getWrappedObject()])); }
function it_does_not_match_if_resource_does_not_match(FieldNode $f1, ResourceNode $resource) { $f1->matches('search-value1')->willReturn(true); $resource->matches(['resource_field' => 'search-value2'])->willReturn(false); $this->matches(['field1' => 'search-value1', ['resource', 'resource1', ['resource_field' => 'search-value2']]])->shouldReturn(false); }