Completed
Push — master ( e8ad81...cc5898 )
by Alex
05:32
created

testIsEDMSimpleTypeValidNonString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 10
nc 2
nop 0
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\Tests\v3\edm;
4
5
use AlgoWeb\ODataMetadata\MetadataV3\edm\TEnumTypeType;
6
use AlgoWeb\ODataMetadata\Tests\TestCase;
7
8
class TEnumTypeTypeTest extends TestCase
9
{
10
    public function testIsEDMSimpleTypeValidNonString()
11
    {
12
        $expected = "Input must be a string: AlgoWeb\\ODataMetadata\\MetadataV3\\edm\\TEnumTypeType";
13
        $actual = null;
14
15
        $type = new \DateTime();
16
        $foo = new TEnumTypeType();
17
18
        try {
19
            $foo->isEDMSimpleTypeValid($type);
20
        } catch (\InvalidArgumentException $e) {
21
            $actual = $e->getMessage();
22
        }
23
        $this->assertEquals($expected, $actual);
24
    }
25
26
    public function testIsTPropertyTypeValidNonString()
27
    {
28
        $expected = "Input must be a string: AlgoWeb\\ODataMetadata\\MetadataV3\\edm\\TEnumTypeType";
29
        $actual = null;
30
31
        $type = new \DateTime();
32
        $foo = new TEnumTypeType();
33
34
        try {
35
            $foo->isTPropertyTypeValid($type);
36
        } catch (\InvalidArgumentException $e) {
37
            $actual = $e->getMessage();
38
        }
39
        $this->assertEquals($expected, $actual);
40
    }
41
42
    public function testIsTPropertyTypeValidBlankString()
43
    {
44
        $type = " _ ";
45
        $foo = new TEnumTypeType();
46
        $this->assertFalse($foo->isTPropertyTypeValid($type));
47
    }
48
}
49