| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Chekote\NounStore\Store; |
||
| 8 | class HasTest extends StoreTest |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Tests that InvalidArgumentException is thrown if Store::has is called with the nth parameter |
||
| 12 | * and the key also contains an nth value, but they do not match. |
||
| 13 | */ |
||
| 14 | public function testHasThrowsInvalidArgumentExceptionWithMismatchedNthInKeyAndParam() |
||
| 15 | { |
||
| 16 | $this->expectException(InvalidArgumentException::class); |
||
| 17 | |||
| 18 | $this->store->has('1st Thing', 1); |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Tests that store::has returns true if nth value in key is found in store. |
||
| 23 | */ |
||
| 24 | public function testHasWithExistingNthKeyReturnsTrue() |
||
| 25 | { |
||
| 26 | $this->assertTrue($this->store->has('1st ' . self::KEY)); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Tests that store::has returns false if nth value in key is not found in store. |
||
| 31 | */ |
||
| 32 | public function testHasWithMissingNthKeyReturnsFalse() |
||
| 33 | { |
||
| 34 | $this->assertFalse($this->store->has('3rd ' . self::KEY)); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Tests that store::has returns true if nth param value is found in store. |
||
| 39 | */ |
||
| 40 | public function testHasWithExistingNthParameterReturnsTrue() |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Tests that store::has returns false if nth param value is not found in store. |
||
| 47 | */ |
||
| 48 | public function testHasWithMissingNthParameterReturnsFalse() |
||
| 51 | } |
||
| 52 | } |
||
| 53 |