public function testCanNest() { $nodeBuilder = new Node(); $nodeBuilder->add('mockfqn', true); $nodeBuilder->start()->add('submockfqn', true)->end(); $rootNode = $nodeBuilder->retrieve(); $addedNode = $rootNode->getChildAt(0)->getChildAt(0); $this->assertInstanceOf(\Awl\Compiler\Node::class, $addedNode); $this->assertEquals('submockfqn', $addedNode->getName()); $this->assertTrue($addedNode->getContents()); }
/** * @param $awl * * @return Node */ public function buildTree($awl) { $nodes = (new Parser())->parse((new Converter())->convert($awl, $this->getDefinitions())); return NodeBuilder::buildTreeFromAwl($nodes); }