Пример #1
0
 function it_can_get_multiple_nodes_by_id(Node $node, Node $node2)
 {
     $node->getId()->willReturn('stub-id-1');
     $node2->getId()->willReturn('stub-id-2');
     $this->addNode($node);
     $this->addNode($node2);
     $this->getByIds(['stub-id-1', 'stub-id-2'])->shouldHaveNodeCount(2);
 }
Пример #2
0
 function it_can_compile_children(Node $child, Node2 $child2, Node3 $child3)
 {
     $this->setId('stub-parent-id');
     $factory = $this->getNodeFactory();
     $child->getId()->willReturn('stub-id-1');
     $child->setParentId("stub-parent-id")->shouldBeCalled();
     $child->deferCompile()->willReturn(false);
     $child->isExtractable()->willReturn(false);
     $child2->getId()->willReturn('stub-id-2');
     $child2->setParentId("stub-parent-id")->shouldBeCalled();
     $child2->deferCompile()->willReturn(false);
     $child2->isExtractable()->willReturn(false);
     $child3->getId()->willReturn('stub-id-3');
     $child3->setParentId("stub-parent-id")->shouldBeCalled();
     $child3->deferCompile()->willReturn(true);
     $child3->isExtractable()->willReturn(false);
     $factory->addNode($child);
     $factory->addNode($child2);
     $factory->addNode($child3);
     $this->addChild($child);
     $this->addChild($child2);
     $this->addChild($child3);
     $this->compileChildren();
 }