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

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/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
6 changes: 3 additions & 3 deletions test/InArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public function testGetHaystack()
$this->assertEquals(array(1, 2, 3), $this->validator->getHaystack());
}

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

/**
Expand Down

0 comments on commit a7c0820

Please sign in to comment.