Completed
Push — master ( 0f28ca...ccc575 )
by Siad
17:36 queued 13s
created

DataTypeTest::testTooManyAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
class DataTypeTest extends \PHPUnit\Framework\TestCase
3
{
4
    protected function setUp(): void
5
    {
6
        $this->datatype = new DataType();
0 ignored issues
show
Bug Best Practice introduced by
The property datatype does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
7
    }
8
9
    /**
10
     * testTooManyAttributes
11
     *
12
     * @expectedException        BuildException
13
     * @expectedExceptionMessage You must not specify more than one attribute when using refid
14
     */
15
    public function testTooManyAttributes()
16
    {
17
        $ex = $this->datatype->tooManyAttributes();
18
        throw $ex;
19
    }
20
21
    /**
22
     * testNoChildrenAllowedException
23
     *
24
     * @expectedException        BuildException
25
     * @expectedExceptionMessage You must not specify nested elements when using refid
26
     */
27
    public function testNoChildrenAllowedException()
28
    {
29
        $ex = $this->datatype->noChildrenAllowed();
30
        throw $ex;
31
    }
32
33
    /**
34
     * testCircularReferenceException
35
     *
36
     * @expectedException        BuildException
37
     * @expectedExceptionMessage This data type contains a circular reference.
38
     */
39
    public function testCircularReferenceException()
40
    {
41
        $ex = $this->datatype->circularReference();
42
        throw $ex;
43
    }
44
45
    public function testToString()
46
    {
47
        $str = "";
48
        $str .= $this->datatype;
49
        $this->assertEquals("DataType", $str);
50
    }
51
}
52