Completed
Pull Request — master (#107)
by Alex
05:30
created

testConcurrencyModeNonString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 10

Duplication

Lines 15
Ratio 100 %

Importance

Changes 0
Metric Value
dl 15
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\TComplexTypePropertyType;
6
use AlgoWeb\ODataMetadata\Tests\TestCase;
7
8 View Code Duplication
class TComplexTypePropertyTypeTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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