Code Duplication    Length = 32-34 lines in 2 locations

tests/v3/edm/TComplexTypePropertyTypeTest.php 1 location

@@ 8-41 (lines=34) @@
5
use AlgoWeb\ODataMetadata\MetadataV3\edm\TComplexTypePropertyType;
6
use AlgoWeb\ODataMetadata\Tests\TestCase;
7
8
class TComplexTypePropertyTypeTest extends TestCase
9
{
10
    public function testConcurrencyModeNonString()
11
    {
12
        $foo = new TComplexTypePropertyType();
13
14
        $mode = new \DateTime();
15
        $expected = "Input must be a string: AlgoWeb\\ODataMetadata\\MetadataV3\\edm\\TComplexTypePropertyType";
16
        $actual = null;
17
18
        try {
19
            $foo->isTConcurrencyModeValid($mode);
20
        } catch (\InvalidArgumentException $e) {
21
            $actual = $e->getMessage();
22
        }
23
        $this->assertEquals($expected, $actual);
24
    }
25
26
    public function testConcurrencyModeFixed()
27
    {
28
        $foo = new TComplexTypePropertyType();
29
30
        $mode = "Fixed";
31
        $this->assertTrue($foo->isTConcurrencyModeValid($mode));
32
    }
33
34
    public function testConcurrencyModeNone()
35
    {
36
        $foo = new TComplexTypePropertyType();
37
38
        $mode = "None";
39
        $this->assertTrue($foo->isTConcurrencyModeValid($mode));
40
    }
41
}
42

tests/v3/edm/TFunctionImportReturnTypeTypeTest.php 1 location

@@ 8-39 (lines=32) @@
5
use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionImportReturnTypeType;
6
use AlgoWeb\ODataMetadata\Tests\TestCase;
7
8
class TFunctionImportReturnTypeTypeTest extends TestCase
9
{
10
    public function testFunctionImportParameterAndReturnTypeNonString()
11
    {
12
        $expected = "Input must be a string: AlgoWeb\\ODataMetadata\\MetadataV3\\edm\\TFunctionImportReturnTypeType";
13
        $actual = null;
14
15
        $type = new \DateTime();
16
        $foo = new TFunctionImportReturnTypeType();
17
18
        try {
19
            $foo->isTFunctionImportParameterAndReturnTypeValid($type);
20
        } catch (\InvalidArgumentException $e) {
21
            $actual = $e->getMessage();
22
        }
23
        $this->assertEquals($expected, $actual);
24
    }
25
26
    public function testIsTPropertyTypeValidBlankString()
27
    {
28
        $type = " _ ";
29
        $foo = new TFunctionImportReturnTypeType();
30
        $this->assertFalse($foo->isTFunctionImportParameterAndReturnTypeValid($type));
31
    }
32
33
    public function testIsTPropertyTypeValidEDMSimpleType()
34
    {
35
        $type = "String";
36
        $foo = new TFunctionImportReturnTypeType();
37
        $this->assertTrue($foo->isTFunctionImportParameterAndReturnTypeValid($type));
38
    }
39
}
40