Completed
Pull Request — master (#8)
by Martin
04:36
created

ModuleTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 24
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A itRegistersTestAspectViaConfiguration() 0 16 1
1
<?php
2
3
namespace Go\ZF2\GoAopModule\Tests\Integration;
4
5
use Go\Core\AspectContainer;
6
use Go\Core\GoAspectContainer;
7
use Go\ZF2\GoAopModule\Tests\Aspect\TestAspect;
8
use PHPUnit\Framework\TestCase;
9
use Zend\Mvc\Application;
10
11
/**
12
 * @package Go\ZF2\GoAopModule\Tests\Integration
13
 */
14
class ModuleTest extends TestCase
15
{
16
    const APPLICATION_CONFIG_PATH = __DIR__ . '/../resources/application_config.php';
17
18
    /**
19
     * @test
20
     */
21
    public function itRegistersTestAspectViaConfiguration()
22
    {
23
        $configuration = require static::APPLICATION_CONFIG_PATH;
24
        $application = Application::init($configuration);
25
26
        /** @var GoAspectContainer $container */
27
        $container = $application->getServiceManager()->get(AspectContainer::class);
28
29
        $aspect = $container->getAspect(TestAspect::class);
30
31
        $this->assertInstanceOf(
32
            TestAspect::class,
33
            $aspect,
34
            'aspect should be instance of registered test aspect class'
35
        );
36
    }
37
}