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

GetAllTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetAllThrowsExceptionWhenKeyDoesNotExist() 0 5 1
A testGetAllReturnsAllValuesForSpecifiedKey() 0 7 1
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