AbstractXmlDriverTests   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 33
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createDriver() 0 10 1
A testLoadMetadataForClass() 0 13 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche/Metadata component.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Cubiche\Core\Metadata\Tests\Units\Driver;
13
14
use Cubiche\Core\Metadata\Locator\DefaultFileLocator;
15
use Cubiche\Core\Metadata\Tests\Fixtures\Driver\XmlDriver;
16
17
/**
18
 * AbstractXmlDriverTests class.
19
 *
20
 * Generated by TestGenerator on 2017-05-16 at 13:17:21.
21
 */
22
class AbstractXmlDriverTests extends DriverTestCase
23
{
24
    /**
25
     * @return XmlDriver
26
     */
27
    protected function createDriver()
28
    {
29
        $mappingDirectory = __DIR__.'/../../Fixtures/mapping';
30
31
        return new XmlDriver(
32
            new DefaultFileLocator([
33
                $mappingDirectory => 'Cubiche\Core\Metadata\Tests',
34
            ])
35
        );
36
    }
37
38
    /**
39
     * Test loadMetadataForClass method.
40
     */
41
    public function testLoadMetadataForClass()
42
    {
43
        parent::testLoadMetadataForClass();
44
45
        $this
46
            ->given($driver = $this->createDriver())
47
            ->then()
48
                ->variable($driver->loadMetadataForClass('Cubiche\Foo\Bar\Tests\Blog'))
49
                    ->isNull()
50
                ->variable($driver->loadMetadataForClass('Address'))
51
                    ->isNull()
52
        ;
53
    }
54
}
55