Passed
Push — main ( b1d2fe...fd90d3 )
by Dylan
02:25
created

ConnectorTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testServiceFactory() 0 13 3
1
<?php
2
3
namespace Lifeboat\Tests;
4
5
use Lifeboat\App;
6
use Lifeboat\Client;
7
use Lifeboat\Exceptions\BadMethodException;
8
use Lifeboat\Exceptions\InvalidArgumentException;
9
use Lifeboat\Factory\ClassMap;
10
use Lifeboat\Utils\Utils;
11
12
class ConnectorTest extends TestCase {
13
14
    /**
15
     * @test
16
     * @covers \Lifeboat\Connector::__get
17
     */
18
    public function testServiceFactory()
19
    {
20
        $client = new Client('mock', 'mock');
21
22
        foreach (ClassMap::SERVICES as $service => $class) {
23
            $this->assertInstanceOf($class, $client->$service);
24
        }
25
26
        try {
27
            $client->not_existant;
0 ignored issues
show
Bug Best Practice introduced by
The property not_existant does not exist on Lifeboat\Client. Since you implemented __get, consider adding a @property annotation.
Loading history...
28
29
            $this->fail('Connector::__get should have thrown an error for a service that does not exist');
30
        } catch (BadMethodException $e) {}
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
31
    }
32
}
33