@@ -73,9 +73,10 @@ public function setUp()
73
73
* @param string $path
74
74
* @param array $data
75
75
* @param string|array $expected
76
+ * @param string $expectedPath
76
77
* @dataProvider getDataProvider
77
78
*/
78
- public function testGet ($ path , $ data , $ expected )
79
+ public function testGet ($ path , $ data , $ expected, $ expectedPath )
79
80
{
80
81
$ this ->readerMock ->expects ($ this ->once ())
81
82
->method ('load ' )
@@ -89,6 +90,7 @@ public function testGet($path, $data, $expected)
89
90
->willReturn ($ this ->dataObjectMock );
90
91
$ this ->dataObjectMock ->expects ($ this ->once ())
91
92
->method ('getData ' )
93
+ ->with ($ expectedPath )
92
94
->willReturn ($ expected );
93
95
94
96
$ this ->assertEquals ($ expected , $ this ->source ->get ($ path ));
@@ -100,8 +102,10 @@ public function testGet($path, $data, $expected)
100
102
public function getDataProvider ()
101
103
{
102
104
return [
103
- 'simple path ' => ['path ' , ['configType ' => 'value ' ], 'value ' ],
104
- 'empty path ' => ['' , [], []]
105
+ 'simple path ' => ['path ' , ['configType ' => 'value ' ], 'value ' , 'configType/path ' ],
106
+ 'empty path ' => ['' , [], [], 'configType ' ],
107
+ 'null path ' => [null , [], [], 'configType ' ],
108
+ 'leading path ' => ['/path ' , [], [], 'configType/path ' ]
105
109
];
106
110
}
107
111
0 commit comments