public static function stub() { $lexicon = LexiconStub::get(); $factory = $lexicon->getFoundation()->getNodeFactory(); $node = $factory->make(new static($lexicon)); return $node->setRawAttributes('name="foo"'); }
/** * @return SectionExtends */ public static function stub() { $lexicon = LexiconStub::get(); $factory = $lexicon->getFoundation()->getNodeFactory(); $root = $factory->make(new Block($lexicon)); return $factory->make(new static($lexicon), [], $root); }
/** * Stub for testing with PHPSpec * * @return \Anomaly\Lexicon\Contract\Node\NodeInterface */ public static function stub() { $lexicon = LexiconStub::get(); $nodeFactory = $lexicon->getFoundation()->getNodeFactory(); $parent = $nodeFactory->make(new Block($lexicon)); $parent->setFullContent('{{ children }}'); return $nodeFactory->make(new static($lexicon), [], $parent); }
/** * Stub for testing with PHPSpec * * @return ConditionalInterface */ public static function stub() { $lexicon = LexiconStub::get(); $nodeFactory = $lexicon->getFoundation()->getNodeFactory(); /** @var ConditionalInterface $conditionalNode */ $expressionNode = $nodeFactory->make(new ExpressionNode($lexicon), []); return $nodeFactory->make(new static($lexicon), [], $expressionNode); }
public static function get() { $lexicon = LexiconStub::get(); $nodeFactory = $lexicon->getFoundation()->getNodeFactory(); $if = $nodeFactory->make(new Conditional($lexicon)); $if->setName('if'); $if2 = $nodeFactory->make(new Conditional($lexicon)); $if2->setName('if'); $elseif = $nodeFactory->make(new Conditional($lexicon)); $elseif->setName('elseif'); $endif = $nodeFactory->make(new ConditionalEndif($lexicon)); $endif->setName('endif'); $match = [['content', 25]]; $schoolName = $nodeFactory->make(new NodeStub($lexicon), $match); $schoolName->setName('name'); $books = $nodeFactory->make(new Block($lexicon)); $books->setName('books'); $books->setItemAlias('book'); $books->addChild($schoolName); $books->addChild($if); $books->addChild($if2); $books->addChild($elseif); $books->addChild($endif); //dd($books->getChildren()); $libraries = $nodeFactory->make(new Block($lexicon)); $libraries->addChild($books); $libraries->setName('libraries'); $libraries->setItemAlias('library'); $schools = $nodeFactory->make(new Block($lexicon)); $schools->addChild($libraries); $schools->setName('schools'); $schools->setItemAlias('school'); $schoolName->addChild($schools); $root = $nodeFactory->make(new Block($lexicon)); $root->addChild($schools); return $lexicon->getFoundation()->getNodeFinder($schoolName); }
/** * Stub for testing with PHPSpec * * @return ConditionalInterface */ public static function stub() { $lexicon = LexiconStub::get(); $nodeFactory = $lexicon->getFoundation()->getNodeFactory(); /** @var ConditionalInterface $conditionalNode */ $conditionalNode = $nodeFactory->make(new Conditional($lexicon), []); $conditionalNode->setContent('foo or bar and baz && yin || yang'); $expressionNode = $nodeFactory->make(new static($lexicon), [], $conditionalNode); /* $expressionNode ->setContent('foo or bar and baz && yin || yang') ->createChildNodes();*/ return $expressionNode; }
/** * Engine stub for PHPSpec unit test at spec\Anomaly\Lexicon\View\EngineSpec * * @return Engine */ public static function stub() { return LexiconStub::engine(); }
/** * @return static */ public static function stub() { return new static(LexiconStub::get()); }
/** * Stub for testing with PHPSpec * * @return NodeFactory */ public static function stub() { return LexiconStub::foundation()->getNodeFactory(); }
/** * Stub for testing with PHPSpec * * @return Block */ public static function stub() { $lexicon = LexiconStub::get(); $factory = $lexicon->getFoundation()->getNodeFactory(); return $factory->make(new static($lexicon))->setName('books'); }
public static function stub() { return (new static())->setLexicon(LexiconStub::get()); }
/** * View stub for PHPSpec unit test at spec\Anomaly\Lexicon\View\ViewSpec * * @return Engine */ public static function stub() { $data = ['name' => 'Mr. Anderson']; return LexiconStub::factory()->make('test::hello', $data); }
/** * Lexicon * * @return AttributeNode */ public static function stub() { $lexicon = LexiconStub::get(); $nodeFactory = $lexicon->getFoundation()->getNodeFactory(); $variableNode = $nodeFactory->make(new Variable($lexicon)); $variableNode->setName('example'); return $nodeFactory->make(new static($lexicon), [], $variableNode); }
/** * @return static */ public static function stub() { $lexicon = LexiconStub::get(); return new static($lexicon, new EscapePhpParser($lexicon)); }
/** * Engine stub for PHPSpec unit test at spec\Anomaly\Lexicon\View\EngineSpec * * @return CompilerInterface */ public static function stub() { return LexiconStub::compiler(); }
/** * Factory stub for PHPSpec test * * @return Factory */ public static function stub() { return LexiconStub::factory(); }