@@ 15-26 (lines=12) @@ | ||
12 | */ |
|
13 | class ClientRepository extends atoum |
|
14 | { |
|
15 | public function testGetReturnsClient() |
|
16 | { |
|
17 | $this |
|
18 | ->given($clients = ['my_client' => $this->newClient()]) |
|
19 | ->and($this->newTestedInstance($clients)) |
|
20 | ->if($client = $this->testedInstance->get('my_client')) |
|
21 | ->then |
|
22 | ->object($client) |
|
23 | ->isIdenticalTo($clients['my_client']) |
|
24 | ; |
|
25 | ||
26 | } |
|
27 | ||
28 | private function newClient() |
|
29 | { |
|
@@ 36-46 (lines=11) @@ | ||
33 | return new Client(); |
|
34 | } |
|
35 | ||
36 | public function testGetReturnsNullIfNotSets() |
|
37 | { |
|
38 | $this |
|
39 | ->given($clients = ['my_client' => $this->newClient()]) |
|
40 | ->and($this->newTestedInstance($clients)) |
|
41 | ->if($client = $this->testedInstance->get('not_a_client')) |
|
42 | ->then |
|
43 | ->variable($client) |
|
44 | ->isNull() |
|
45 | ; |
|
46 | } |
|
47 | } |