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

DummyType::getSQLDeclaration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
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