Skip to content

Commit

Permalink
Merge branch '2.8' into 3.1
Browse files Browse the repository at this point in the history
* 2.8:
  [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
  • Loading branch information
nicolas-grekas committed Aug 10, 2016
2 parents a763039 + acf5f70 commit 8ddac69
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Tests/Definition/ArrayNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,41 @@ public function getPreNormalizedNormalizedOrderedData()
),
);
}

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Child nodes must be named.
*/
public function testAddChildEmptyName()
{
$node = new ArrayNode('root');

$childNode = new ArrayNode('');
$node->addChild($childNode);
}

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage A child node named "foo" already exists.
*/
public function testAddChildNameAlreadyExists()
{
$node = new ArrayNode('root');

$childNode = new ArrayNode('foo');
$node->addChild($childNode);

$childNodeWithSameName = new ArrayNode('foo');
$node->addChild($childNodeWithSameName);
}

/**
* @expectedException \RuntimeException
* @expectedExceptionMessage The node at path "foo" has no default value.
*/
public function testGetDefaultValueWithoutDefaultValue()
{
$node = new ArrayNode('foo');
$node->getDefaultValue();
}
}

0 comments on commit 8ddac69

Please sign in to comment.