AbstractYamlDriverTests   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 32
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 12 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\Exception\MappingException;
15
use Cubiche\Core\Metadata\Locator\DefaultFileLocator;
16
use Cubiche\Core\Metadata\Tests\Fixtures\Driver\YamlDriver;
17
18
/**
19
 * AbstractYamlDriverTests class.
20
 *
21
 * Generated by TestGenerator on 2017-05-16 at 13:17:21.
22
 */
23
class AbstractYamlDriverTests extends DriverTestCase
24
{
25
    /**
26
     * @return YamlDriver
27
     */
28
    protected function createDriver()
29
    {
30
        $mappingDirectory = __DIR__.'/../../Fixtures/mapping';
31
32
        return new YamlDriver(
33
            new DefaultFileLocator([
34
                $mappingDirectory => 'Cubiche\Core\Metadata\Tests\Fixtures',
35
            ])
36
        );
37
    }
38
39
    /**
40
     * Test loadMetadataForClass method.
41
     */
42
    public function testLoadMetadataForClass()
43
    {
44
        parent::testLoadMetadataForClass();
45
46
        $this
47
            ->given($driver = $this->createDriver())
48
            ->then()
49
                ->exception(function () use ($driver) {
50
                    $driver->loadMetadataForClass('Cubiche\Core\Metadata\Tests\Fixtures\Venue');
51
                })->isInstanceOf(MappingException::class)
52
        ;
53
    }
54
}
55