NullTypeTest::invalidValidateValuesProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\Annotations\Metadata\Type;
6
7
use Doctrine\Annotations\Metadata\Type\NullType;
8
use Doctrine\Annotations\Metadata\Type\Type;
9
use stdClass;
10
11
final class NullTypeTest extends TypeTest
12
{
13
    protected function createType() : Type
14
    {
15
        return new NullType();
16
    }
17
18
    public function testDescribe() : void
19
    {
20
        self::assertSame('null', $this->getType()->describe());
21
    }
22
23
    /**
24
     * @return null[]
25
     */
26
    public function validValidateValuesProvider() : iterable
27
    {
28
        yield [null];
0 ignored issues
show
Bug Best Practice introduced by
The expression yield array(null) returns the type Generator which is incompatible with the documented return type array<mixed,null>.
Loading history...
29
    }
30
31
    /**
32
     * @return mixed[][]
33
     */
34
    public function invalidValidateValuesProvider() : iterable
35
    {
36
        yield [0];
0 ignored issues
show
Bug Best Practice introduced by
The expression yield array(0) returns the type Generator which is incompatible with the documented return type array<mixed,array<mixed,mixed>>.
Loading history...
37
        yield [false];
38
        yield [0.0];
39
        yield [''];
40
        yield [123];
41
        yield [[]];
42
        yield [new stdClass()];
43
    }
44
45
    public function testAcceptsNull() : void
46
    {
47
        self::assertTrue($this->getType()->acceptsNull());
48
    }
49
}
50