コード例 #1
0
 public function testCommandIdentifier()
 {
     $uuid = UUIDHelper::generateUUID();
     $this->dumperHelper->expects($this->once())->method('getTreeWalker')->will($this->returnValue($this->treeWalker));
     $this->session->expects($this->once())->method('getNodeByIdentifier')->with($uuid)->will($this->returnValue($this->node1));
     $this->treeWalker->expects($this->once())->method('traverse')->with($this->node1);
     $this->executeCommand('phpcr:node:dump', array('identifier' => $uuid));
 }
コード例 #2
0
 public function getTreeWalker(OutputInterface $output, $options)
 {
     $options = array_merge(array('dump_uuids' => false, 'ref_format' => 'uuid', 'show_props' => false, 'show_sys_nodes' => false), $options);
     $propVisitor = null;
     $nodeVisitor = new ConsoleDumperNodeVisitor($output, $options['dump_uuids']);
     if (true === $options['show_props']) {
         $propVisitor = new ConsoleDumperPropertyVisitor($output, $options);
     }
     $treeWalker = new TreeWalker($nodeVisitor, $propVisitor);
     if (false === $options['show_sys_nodes']) {
         $filter = new SystemNodeFilter();
         $treeWalker->addNodeFilter($filter);
         $treeWalker->addPropertyFilter($filter);
     }
     return $treeWalker;
 }