Exemplo 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"');
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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;
 }
Exemplo n.º 7
0
 /**
  * Engine stub for PHPSpec unit test at spec\Anomaly\Lexicon\View\EngineSpec
  *
  * @return Engine
  */
 public static function stub()
 {
     return LexiconStub::engine();
 }
Exemplo n.º 8
0
 /**
  * @return static
  */
 public static function stub()
 {
     return new static(LexiconStub::get());
 }
Exemplo n.º 9
0
 /**
  * Stub for testing with PHPSpec
  *
  * @return NodeFactory
  */
 public static function stub()
 {
     return LexiconStub::foundation()->getNodeFactory();
 }
Exemplo 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');
 }
Exemplo n.º 11
0
 public static function stub()
 {
     return (new static())->setLexicon(LexiconStub::get());
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo n.º 14
0
 /**
  * @return static
  */
 public static function stub()
 {
     $lexicon = LexiconStub::get();
     return new static($lexicon, new EscapePhpParser($lexicon));
 }
Exemplo n.º 15
0
 /**
  * Engine stub for PHPSpec unit test at spec\Anomaly\Lexicon\View\EngineSpec
  *
  * @return CompilerInterface
  */
 public static function stub()
 {
     return LexiconStub::compiler();
 }
Exemplo n.º 16
0
 /**
  * Factory stub for PHPSpec test
  *
  * @return Factory
  */
 public static function stub()
 {
     return LexiconStub::factory();
 }