| @@ 22-29 (lines=8) @@ | ||
| 19 | ||
| 20 | class GetOptionTraitTest extends TestCase |
|
| 21 | { |
|
| 22 | public function testGetOptionWillReturnTheOption() |
|
| 23 | { |
|
| 24 | $fake = new FakeGetOption(); |
|
| 25 | $fake->setOptions([ |
|
| 26 | 'name' => 'value', |
|
| 27 | ]); |
|
| 28 | static::assertEquals('value', $fake->checkGetOption('name')); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function testGetOptionWillReturnADefaultValueIfTheValueDoesNotExist() |
|
| 32 | { |
|
| @@ 37-44 (lines=8) @@ | ||
| 34 | static::assertEquals('default', $fake->checkGetOption('name', 'default')); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function testRequireOptionWillReturnAnOptionIfItExists() |
|
| 38 | { |
|
| 39 | $fake = new FakeGetOption(); |
|
| 40 | $fake->setOptions([ |
|
| 41 | 'name' => 'value', |
|
| 42 | ]); |
|
| 43 | static::assertEquals('value', $fake->checkRequireOption('name')); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testRequireOptionWillThrowAnExceptionIfTheOptionDoesNotExist() |
|
| 47 | { |
|