Skip to content

Commit

Permalink
add tests for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
hackzilla committed Jul 23, 2016
1 parent 88df7c8 commit 562df90
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Tests/Generator/RequirementPasswordGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ public function lengthProvider()
);
}

public function testGeneratePasswordNonIntException()
{
$this->setExpectedException('\InvalidArgumentException');
$this->_object->generatePasswords('A');
}

public function testGeneratePasswordNegativeIntException()
{
$this->setExpectedException('\InvalidArgumentException');
$this->_object->generatePasswords(-1);
}

/**
* @dataProvider getterSetterProvider
*
Expand Down Expand Up @@ -285,6 +297,18 @@ public function minMaxProvider()
);
}

public function testSetMinimumCountException()
{
$this->setExpectedException('\InvalidArgumentException');
$this->_object->setMinimumCount(RequirementPasswordGenerator::OPTION_UPPER_CASE, 'A');
}

public function testSetMaximumCountException()
{
$this->setExpectedException('\InvalidArgumentException');
$this->_object->setMaximumCount(RequirementPasswordGenerator::OPTION_UPPER_CASE, 'A');
}

public function testValidLimits()
{
$this->_object
Expand Down

0 comments on commit 562df90

Please sign in to comment.