Test Failed
Pull Request — master (#2834)
by Grégoire
07:06
created

TypeRegistryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRegisteredTypeCanBeRetrieved() 0 8 1
1
<?php
2
3
namespace Doctrine\Tests\DBAL\Types;
4
5
use Doctrine\DBAL\Platforms\AbstractPlatform;
6
use Doctrine\DBAL\Types\Type;
7
use Doctrine\DBAL\Types\TypeRegistry;
8
9
class TypeRegistryTest extends \Doctrine\Tests\DbalTestCase
10
{
11
    public function testRegisteredTypeCanBeRetrieved()
12
    {
13
        $class = DummyType::class;
14
        $this->assertFalse(TypeRegistry::hasType($class));
15
        TypeRegistry::addType($class);
16
        $this->assertTrue(TypeRegistry::hasType($class));
17
        $this->assertInstanceOf(\stdClass::class, TypeRegistry::getType($class));
18
    }
19
}
20
21
class DummyType extends Type
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
22
{
23
    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
24
    {
25
        return 'whatever';
26
    }
27
28
    public function getName()
29
    {
30
        'dummy';
31
    }
32
}
33