@@ 12-25 (lines=14) @@ | ||
9 | ||
10 | class AssociationSetAnonymousTypeTest extends TestCase |
|
11 | { |
|
12 | public function testSetBadName() |
|
13 | { |
|
14 | $expected = "Name must be a valid TSimpleIdentifier"; |
|
15 | $actual = null; |
|
16 | ||
17 | $foo = new AssociationSetAnonymousType(); |
|
18 | ||
19 | try { |
|
20 | $foo->setName(" _ "); |
|
21 | } catch (\InvalidArgumentException $e) { |
|
22 | $actual = $e->getMessage(); |
|
23 | } |
|
24 | $this->assertEquals($expected, $actual); |
|
25 | } |
|
26 | ||
27 | public function testSetBadAssociation() |
|
28 | { |
|
@@ 27-40 (lines=14) @@ | ||
24 | $this->assertEquals($expected, $actual); |
|
25 | } |
|
26 | ||
27 | public function testSetBadAssociation() |
|
28 | { |
|
29 | $expected = "Association must be a valid TQualifiedName"; |
|
30 | $actual = null; |
|
31 | ||
32 | $foo = new AssociationSetAnonymousType(); |
|
33 | ||
34 | try { |
|
35 | $foo->setAssociation(" _ "); |
|
36 | } catch (\InvalidArgumentException $e) { |
|
37 | $actual = $e->getMessage(); |
|
38 | } |
|
39 | $this->assertEquals($expected, $actual); |
|
40 | } |
|
41 | ||
42 | public function testAddBadEnd() |
|
43 | { |
|
@@ 91-99 (lines=9) @@ | ||
88 | $this->assertFalse($foo->issetEnd(0)); |
|
89 | } |
|
90 | ||
91 | public function testIsOKNewObject() |
|
92 | { |
|
93 | $expected = "Name must be a valid TSimpleIdentifier"; |
|
94 | $actual = null; |
|
95 | ||
96 | $foo = new AssociationSetAnonymousType(); |
|
97 | $this->assertFalse($foo->isOK($actual)); |
|
98 | $this->assertEquals($expected, $actual); |
|
99 | } |
|
100 | ||
101 | public function testIsOKMissingAssociation() |
|
102 | { |
|
@@ 101-110 (lines=10) @@ | ||
98 | $this->assertEquals($expected, $actual); |
|
99 | } |
|
100 | ||
101 | public function testIsOKMissingAssociation() |
|
102 | { |
|
103 | $expected = "Association must be a valid TQualifiedName"; |
|
104 | $actual = null; |
|
105 | ||
106 | $foo = new AssociationSetAnonymousType(); |
|
107 | $foo->setName('UnitPrice'); |
|
108 | $this->assertFalse($foo->isOK($actual)); |
|
109 | $this->assertEquals($expected, $actual); |
|
110 | } |
|
111 | ||
112 | public function testTooManyEnds() |
|
113 | { |
@@ 136-145 (lines=10) @@ | ||
133 | $this->assertTrue(true); |
|
134 | } |
|
135 | ||
136 | public function testSetHigherDataThanDefaultMaxServiceVersionNotOK() |
|
137 | { |
|
138 | $expected = "Data service version cannot be greater than maximum service version"; |
|
139 | $actual = null; |
|
140 | ||
141 | $foo = new TDataServicesType(); |
|
142 | $foo->setDataServiceVersion('4.0'); |
|
143 | $this->assertFalse($foo->isOK($actual)); |
|
144 | $this->assertEquals($expected, $actual); |
|
145 | } |
|
146 | ||
147 | public function testIsOKWhenSchemaNotOk() |
|
148 | { |
@@ 111-120 (lines=10) @@ | ||
108 | $this->assertEquals($expected, $actual); |
|
109 | } |
|
110 | ||
111 | public function testIsObjectWithoutDataServiceOK() |
|
112 | { |
|
113 | $expected = "Data service type cannot be null"; |
|
114 | $actual = null; |
|
115 | $foo = new TEdmxType(); |
|
116 | $foo->setVersion("1.5"); |
|
117 | ||
118 | $this->assertFalse($foo->isOK($actual)); |
|
119 | $this->assertEquals($expected, $actual); |
|
120 | } |
|
121 | ||
122 | public function testIsObjectWithBadDataServiceOK() |
|
123 | { |