Skip to content

Commit acf5f70

Browse files
Merge branch '2.7' into 2.8
* 2.7: [travis] fix after box updates Console: Fix indentation of Help: section of txt usage help [Intl] Update ICU data to 57.1 [Config] Improved test Added class existence check if is_subclass_of() fails in compiler passes
2 parents 4275ef5 + 51bba5f commit acf5f70

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Tests/Definition/ArrayNodeTest.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,41 @@ public function getPreNormalizedNormalizedOrderedData()
173173
),
174174
);
175175
}
176+
177+
/**
178+
* @expectedException \InvalidArgumentException
179+
* @expectedExceptionMessage Child nodes must be named.
180+
*/
181+
public function testAddChildEmptyName()
182+
{
183+
$node = new ArrayNode('root');
184+
185+
$childNode = new ArrayNode('');
186+
$node->addChild($childNode);
187+
}
188+
189+
/**
190+
* @expectedException \InvalidArgumentException
191+
* @expectedExceptionMessage A child node named "foo" already exists.
192+
*/
193+
public function testAddChildNameAlreadyExists()
194+
{
195+
$node = new ArrayNode('root');
196+
197+
$childNode = new ArrayNode('foo');
198+
$node->addChild($childNode);
199+
200+
$childNodeWithSameName = new ArrayNode('foo');
201+
$node->addChild($childNodeWithSameName);
202+
}
203+
204+
/**
205+
* @expectedException \RuntimeException
206+
* @expectedExceptionMessage The node at path "foo" has no default value.
207+
*/
208+
public function testGetDefaultValueWithoutDefaultValue()
209+
{
210+
$node = new ArrayNode('foo');
211+
$node->getDefaultValue();
212+
}
176213
}

0 commit comments

Comments
 (0)