LazyClassDefinitionTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
cbo 3
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A getContainer() 0 6 1
A testLazyClassLoading() 0 5 1
1
<?php
2
3
namespace Fwk\Di\Definitions;
4
use Fwk\Di\Container;
5
6
/**
7
 * Test class for ClassDefinition.
8
 */
9
class LazyClassDefinitionTest extends \PHPUnit_Framework_TestCase {
10
11
    /**
12
     * @var ClassDefinition
13
     */
14
    protected $object;
15
16
    /**
17
     * Sets up the fixture, for example, opens a network connection.
18
     * This method is called before a test is executed.
19
     */
20
    protected function setUp()
21
    {
22
        $this->object = new LazyClassDefinition('\stdClass');
23
        
24
    }
25
    
26
    protected function getContainer()
27
    {
28
        $container = new Container();
29
30
        return $container;
31
    }
32
    
33
   public function testLazyClassLoading()
34
   {
35
       $class = $this->object->invoke($this->getContainer());
36
       $this->assertArrayHasKey('ProxyManager\Proxy\LazyLoadingInterface', class_implements($class));
37
   }
38
}