File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -161,4 +161,41 @@ public function getPreNormalizedNormalizedOrderedData()
161161 ),
162162 );
163163 }
164+
165+ /**
166+ * @expectedException \InvalidArgumentException
167+ * @expectedExceptionMessage Child nodes must be named.
168+ */
169+ public function testAddChildEmptyName ()
170+ {
171+ $ node = new ArrayNode ('root ' );
172+
173+ $ childNode = new ArrayNode ('' );
174+ $ node ->addChild ($ childNode );
175+ }
176+
177+ /**
178+ * @expectedException \InvalidArgumentException
179+ * @expectedExceptionMessage A child node named "foo" already exists.
180+ */
181+ public function testAddChildNameAlreadyExists ()
182+ {
183+ $ node = new ArrayNode ('root ' );
184+
185+ $ childNode = new ArrayNode ('foo ' );
186+ $ node ->addChild ($ childNode );
187+
188+ $ childNodeWithSameName = new ArrayNode ('foo ' );
189+ $ node ->addChild ($ childNodeWithSameName );
190+ }
191+
192+ /**
193+ * @expectedException \RuntimeException
194+ * @expectedExceptionMessage The node at path "foo" has no default value.
195+ */
196+ public function testGetDefaultValueWithoutDefaultValue ()
197+ {
198+ $ node = new ArrayNode ('foo ' );
199+ $ node ->getDefaultValue ();
200+ }
164201}
You can’t perform that action at this time.
0 commit comments