Esempio n. 1
0
 function testFlatten()
 {
     $node = new Node();
     $node->valid = true;
     $node->change = Change::User;
     $node->children[] = $child = new Node();
     $child->change = Change::Internal;
     $child->valid = false;
     $child->messages[] = new Message(['id' => 'foo.bar']);
     $flat = $node->flatten();
     $this->assertInstanceOf(Node::class, $flat);
     $this->assertFalse($flat->valid);
     $this->assertEquals(Change::User, $flat->change);
 }
Esempio n. 2
0
 /**
  * @param depth int Internal
  */
 public function formatNode(\Fulfil\Node $node, $depth = null)
 {
     return $this->formatAll($node->flatten()->messages, $depth);
 }