Passed
Push — master ( 639b92...a2ec98 )
by Donald
13:52
created

testGetAllThrowsExceptionWhenKeyDoesNotExist()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace Chekote\NounStore\Store;
2
3
use OutOfBoundsException;
4
5
/**
6
 * @covers Store::getAll()
7
 */
8
class GetAllTest extends StoreTest
9
{
10
    /**
11
     * Tests that Store::getAll throws exception when the specified $key does not exist.
12
     */
13
    public function testGetAllThrowsExceptionWhenKeyDoesNotExist()
14
    {
15
        $this->expectException(OutOfBoundsException::class);
16
17
        $this->assertEquals(null, $this->store->getAll('Thing'));
18
    }
19
20
    /**
21
     * Tests that Store::getAll returns all values for specified key.
22
     */
23
    public function testGetAllReturnsAllValuesForSpecifiedKey()
24
    {
25
        $values = $this->store->getAll(self::KEY);
26
27
        $this->assertCount(2, $values);
28
        $this->assertEquals(self::FIRST_VALUE, $values[0]);
29
        $this->assertEquals(self::SECOND_VALUE, $values[1]);
30
    }
31
}
32