Skip to content

Commit d844855

Browse files
author
Andrew Carter
committed
Increased test coverage of damon options object
1 parent 1604389 commit d844855

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/DaemonOptionsTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,26 @@ public function testDaemonOptions()
3030
$this->assertEquals($memoryLimit, $options->getOption(DaemonOptions::MEMORY_LIMIT));
3131
$this->assertEquals($timeLimit, $options->getOption(DaemonOptions::TIME_LIMIT));
3232
}
33+
34+
/**
35+
* Test that an InvalidArgumentException is thrown when the object is
36+
* constructed with an unknown option.
37+
*
38+
* @expectedException \InvalidArgumentException
39+
*/
40+
public function testUnknownOptionInConstructor()
41+
{
42+
new DaemonOptions(['hello' => 'world']);
43+
}
44+
45+
/**
46+
* Test that an InvalidArgumentException is thrown when ::getOption is
47+
* called with an unknown option.
48+
*
49+
* @expectedException \InvalidArgumentException
50+
*/
51+
public function testGetUnknownOption()
52+
{
53+
(new DaemonOptions())->getOption('hello');
54+
}
3355
}

0 commit comments

Comments
 (0)