Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Update InArray.php #4047

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/Zend/Validator/InArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class InArray extends AbstractValidator
*/
public function getHaystack()
{
if ($this->haystack == null) {
if ($this->haystack === null) {
throw new Exception\RuntimeException('haystack option is mandatory');
}
return $this->haystack;
Expand Down
10 changes: 0 additions & 10 deletions tests/ZendTest/Validator/InArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ public function testGetHaystack()
$this->assertEquals(array(1, 2, 3), $this->validator->getHaystack());
}

public function testSetEmptyHaystack()
{
$this->validator->setHaystack(array());
$this->setExpectedException(
'Zend\Validator\Exception\RuntimeException',
'haystack option is mandatory'
);
$this->validator->getHaystack();
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing this; the parameter value should be changed to "null".

* Ensures that getStrict() returns expected default value
*
Expand Down