File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/Symfony/Component/Config Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class EnumNode extends ScalarNode
22
22
{
23
23
private $ values ;
24
24
25
- public function __construct (string $ name , NodeInterface $ parent = null , array $ values = array ())
25
+ public function __construct (? string $ name , NodeInterface $ parent = null , array $ values = array ())
26
26
{
27
27
$ values = array_unique ($ values );
28
28
if (empty ($ values )) {
Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ public function testConstructionWithOneDistinctValue()
43
43
$ this ->assertSame ('foo ' , $ node ->finalize ('foo ' ));
44
44
}
45
45
46
+ public function testConstructionWithNullName ()
47
+ {
48
+ $ node = new EnumNode (null , null , array ('foo ' ));
49
+ $ this ->assertSame ('foo ' , $ node ->finalize ('foo ' ));
50
+ }
51
+
46
52
/**
47
53
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
48
54
* @expectedExceptionMessage The value "foobar" is not allowed for path "foo". Permissible values: "foo", "bar"
You can’t perform that action at this time.
0 commit comments