diff --git a/src/NotEmpty.php b/src/NotEmpty.php index 54456f280..ee6293550 100644 --- a/src/NotEmpty.php +++ b/src/NotEmpty.php @@ -90,7 +90,7 @@ public function __construct($options = null) $detected = 0; $found = false; foreach ($options as $option) { - if (in_array($option, $this->constants)) { + if (in_array($option, $this->constants, true)) { $found = true; $detected += array_search($option, $this->constants); } diff --git a/test/NotEmptyTest.php b/test/NotEmptyTest.php index 44a73acd0..2319d8697 100644 --- a/test/NotEmptyTest.php +++ b/test/NotEmptyTest.php @@ -589,6 +589,12 @@ public function testEqualsMessageTemplates() $this->assertAttributeEquals($validator->getOption('messageTemplates'), 'messageTemplates', $validator); } + + public function testTypeAutoDetectionHasNoSideEffect() + { + $validator = new NotEmpty(array('translatorEnabled' => true)); + $this->assertEquals(493, $validator->getType()); + } } class ClassTest2