File tree Expand file tree Collapse file tree 1 file changed +36
-2
lines changed
tests/PHPCR/Tests/Util/Console/Helper Expand file tree Collapse file tree 1 file changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,46 @@ public function setUp()
1010 $ this ->helper = new PhpcrConsoleDumperHelper ;
1111 }
1212
13- public function testHelper ()
13+ public function provideHelper ()
1414 {
15- $ tw = $ this ->helper ->getTreeWalker ($ this ->output , array ());
15+ return array (
16+ array (array ()),
17+ array (array (
18+ 'show_props ' => true ,
19+ )),
20+ );
21+ }
22+
23+ /**
24+ * @dataProvider provideHelper
25+ */
26+ public function testGetTreeWalker ($ options )
27+ {
28+ $ options = array_merge (array (
29+ 'dump_uuids ' => false ,
30+ 'ref_format ' => 'uuid ' ,
31+ 'show_props ' => false ,
32+ 'show_sys_nodes ' => false ,
33+ ), $ options );
34+
35+ $ tw = $ this ->helper ->getTreeWalker ($ this ->output , $ options );
1636 $ this ->assertInstanceOf (
1737 'PHPCR\Util\TreeWalker ' ,
1838 $ tw
1939 );
40+
41+ $ refl = new \ReflectionClass ($ tw );
42+ $ propVisitorProp = $ refl ->getProperty ('propertyVisitor ' );
43+ $ propVisitorProp ->setAccessible (true );
44+ $ propVisitor = $ propVisitorProp ->getValue ($ tw );
45+
46+ if ($ options ['show_props ' ] === true ) {
47+ $ this ->assertInstanceOf (
48+ 'PHPCR\Util\Console\Helper\TreeDumper\ConsoleDumperPropertyVisitor ' ,
49+ $ propVisitor
50+ );
51+ } else {
52+ $ this ->assertNull ($ propVisitor );
53+ }
2054 }
2155}
You can’t perform that action at this time.
0 commit comments