Esempio n. 1
0
 function it_can_make_node_of_type(Node $nodeType, NodeFinder $nodeFinder)
 {
     $nodeType->setId($id = 'F4pwOfe4eAaTJxFf483ZsQnFL3ALqXjl')->shouldBeCalled();
     $nodeType->incrementDepth()->willReturn(true);
     $nodeType->getId()->shouldBeCalled();
     $nodeType->setParentId(null)->shouldBeCalled();
     $nodeType->setMatch([])->shouldBeCalled();
     $nodeType->setOffset(0)->shouldBeCalled();
     $nodeType->setDepth(1)->shouldBeCalled();
     $nodeType->setup()->shouldBeCalled();
     $nodeType->getItemAliasFromRawAttributes()->shouldBeCalled()->willReturn('book');
     $nodeType->setItemAlias('book')->shouldBeCalled();
     $this->make($nodeType, $match = [], $parent = null, $offset = 0, $depth = 0, $id)->shouldHaveType('Anomaly\\Lexicon\\Test\\Stub\\Node\\Node');
 }
Esempio n. 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();
 }