[OptionsResolver] Fix Options::has() when the value is null
This commit is contained in:
parent
6b39ebc4f8
commit
a47922b4bf
@ -247,7 +247,7 @@ class Options implements \ArrayAccess, \Iterator, \Countable
|
||||
*/
|
||||
public function has($option)
|
||||
{
|
||||
return isset($this->options[$option]);
|
||||
return array_key_exists($option, $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -462,4 +462,11 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertEquals($expectedResult, iterator_to_array($this->options, true));
|
||||
}
|
||||
|
||||
public function testHasWithNullValue()
|
||||
{
|
||||
$this->options->set('foo', null);
|
||||
|
||||
$this->assertTrue($this->options->has('foo'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user