Esempio n. 1
0
 public static function stub()
 {
     $lexicon = LexiconStub::get();
     $factory = $lexicon->getFoundation()->getNodeFactory();
     $node = $factory->make(new static($lexicon));
     return $node->setRawAttributes('name="foo"');
 }
Esempio n. 2
0
 /**
  * @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);
 }
Esempio n. 3
0
 /**
  * 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);
 }
Esempio n. 4
0
 /**
  * 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);
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 /**
  * 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;
 }
Esempio n. 7
0
 /**
  * Engine stub for PHPSpec unit test at spec\Anomaly\Lexicon\View\EngineSpec
  *
  * @return Engine
  */
 public static function stub()
 {
     return LexiconStub::engine();
 }
Esempio n. 8
0
 /**
  * @return static
  */
 public static function stub()
 {
     return new static(LexiconStub::get());
 }
Esempio n. 9
0
 /**
  * Stub for testing with PHPSpec
  *
  * @return NodeFactory
  */
 public static function stub()
 {
     return LexiconStub::foundation()->getNodeFactory();
 }
Esempio n. 10
0
 /**
  * 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');
 }
Esempio n. 11
0
 public static function stub()
 {
     return (new static())->setLexicon(LexiconStub::get());
 }
Esempio n. 12
0
 /**
  * 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);
 }
Esempio n. 13
0
 /**
  * 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);
 }
Esempio n. 14
0
 /**
  * @return static
  */
 public static function stub()
 {
     $lexicon = LexiconStub::get();
     return new static($lexicon, new EscapePhpParser($lexicon));
 }
Esempio n. 15
0
 /**
  * Engine stub for PHPSpec unit test at spec\Anomaly\Lexicon\View\EngineSpec
  *
  * @return CompilerInterface
  */
 public static function stub()
 {
     return LexiconStub::compiler();
 }
Esempio n. 16
0
 /**
  * Factory stub for PHPSpec test
  *
  * @return Factory
  */
 public static function stub()
 {
     return LexiconStub::factory();
 }