| @@ 11-25 (lines=15) @@ | ||
| 8 | ||
| 9 | class EntitySetAnonymousTypeTest extends TestCase |
|
| 10 | { |
|
| 11 | public function testSetBadName() |
|
| 12 | { |
|
| 13 | $expected = "Name must be a valid TSimpleIdentifier"; |
|
| 14 | $actual = null; |
|
| 15 | ||
| 16 | $foo = new EntitySetAnonymousType(); |
|
| 17 | $name = " _ "; |
|
| 18 | ||
| 19 | try { |
|
| 20 | $foo->setName($name); |
|
| 21 | } catch (\InvalidArgumentException $e) { |
|
| 22 | $actual = $e->getMessage(); |
|
| 23 | } |
|
| 24 | $this->assertEquals($expected, $actual); |
|
| 25 | } |
|
| 26 | ||
| 27 | public function testSetBadEntityType() |
|
| 28 | { |
|
| @@ 27-41 (lines=15) @@ | ||
| 24 | $this->assertEquals($expected, $actual); |
|
| 25 | } |
|
| 26 | ||
| 27 | public function testSetBadEntityType() |
|
| 28 | { |
|
| 29 | $expected = "Entity type must be a valid TQualifiedName"; |
|
| 30 | $actual = null; |
|
| 31 | ||
| 32 | $foo = new EntitySetAnonymousType(); |
|
| 33 | $name = " _ "; |
|
| 34 | ||
| 35 | try { |
|
| 36 | $foo->setEntityType($name); |
|
| 37 | } catch (\InvalidArgumentException $e) { |
|
| 38 | $actual = $e->getMessage(); |
|
| 39 | } |
|
| 40 | $this->assertEquals($expected, $actual); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function testSetBadGetterAccess() |
|
| 44 | { |
|
| @@ 43-57 (lines=15) @@ | ||
| 40 | $this->assertEquals($expected, $actual); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function testSetBadGetterAccess() |
|
| 44 | { |
|
| 45 | $expected = "Getter access must be a valid TAccess"; |
|
| 46 | $actual = null; |
|
| 47 | ||
| 48 | $foo = new EntitySetAnonymousType(); |
|
| 49 | $name = " _ "; |
|
| 50 | ||
| 51 | try { |
|
| 52 | $foo->setGetterAccess($name); |
|
| 53 | } catch (\InvalidArgumentException $e) { |
|
| 54 | $actual = $e->getMessage(); |
|
| 55 | } |
|
| 56 | $this->assertEquals($expected, $actual); |
|
| 57 | } |
|
| 58 | ||
| 59 | public function testIsTEntitySetAttributesOKBadName() |
|
| 60 | { |
|
| @@ 164-177 (lines=14) @@ | ||
| 161 | $this->assertEquals($expected, $actual); |
|
| 162 | } |
|
| 163 | ||
| 164 | public function testSetNameBadData() |
|
| 165 | { |
|
| 166 | $expected = "Name must be a valid TSimpleIdentifier"; |
|
| 167 | $actual = null; |
|
| 168 | ||
| 169 | $foo = new FunctionImportAnonymousType(); |
|
| 170 | ||
| 171 | try { |
|
| 172 | $foo->setName(" _ "); |
|
| 173 | } catch (\InvalidArgumentException $e) { |
|
| 174 | $actual = $e->getMessage(); |
|
| 175 | } |
|
| 176 | $this->assertEquals($expected, $actual); |
|
| 177 | } |
|
| 178 | ||
| 179 | public function testIsTFunctionImportAttributesValid() |
|
| 180 | { |
|
| @@ 12-26 (lines=15) @@ | ||
| 9 | ||
| 10 | class TAssociationEndTypeTest extends TestCase |
|
| 11 | { |
|
| 12 | public function testBadMultiplicity() |
|
| 13 | { |
|
| 14 | $expected = "Multiplicity must be a valid TMultiplicity"; |
|
| 15 | $actual = null; |
|
| 16 | ||
| 17 | $foo = new TAssociationEndType(); |
|
| 18 | $mult = 'abc'; |
|
| 19 | ||
| 20 | try { |
|
| 21 | $foo->setMultiplicity($mult); |
|
| 22 | } catch (\InvalidArgumentException $e) { |
|
| 23 | $actual = $e->getMessage(); |
|
| 24 | } |
|
| 25 | $this->assertEquals($expected, $actual); |
|
| 26 | } |
|
| 27 | ||
| 28 | public function testAddToOnDeleteBadData() |
|
| 29 | { |
|
| @@ 11-24 (lines=14) @@ | ||
| 8 | ||
| 9 | class TEntityTypeTypeTest extends TestCase |
|
| 10 | { |
|
| 11 | public function testSetBaseTypeBadData() |
|
| 12 | { |
|
| 13 | $expected = "Base type must be a valid TQualifiedName"; |
|
| 14 | $actual = null; |
|
| 15 | $foo = new TEntityTypeType(); |
|
| 16 | $baseType = " _ "; |
|
| 17 | ||
| 18 | try { |
|
| 19 | $foo->setBaseType($baseType); |
|
| 20 | } catch (\InvalidArgumentException $e) { |
|
| 21 | $actual = $e->getMessage(); |
|
| 22 | } |
|
| 23 | $this->assertEquals($expected, $actual); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testIsDerivableTypeAttributesValidNewCreation() |
|
| 27 | { |
|
| @@ 26-38 (lines=13) @@ | ||
| 23 | $this->assertEquals($expected, $actual); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testIsDerivableTypeAttributesValidNewCreation() |
|
| 27 | { |
|
| 28 | $expected = "Name cannot be null: AlgoWeb\\ODataMetadata\\MetadataV3\\edm\\TEntityTypeType"; |
|
| 29 | $actual = null; |
|
| 30 | $foo = new TEntityTypeType(); |
|
| 31 | ||
| 32 | try { |
|
| 33 | $foo->isTDerivableTypeAttributesValid($actual); |
|
| 34 | } catch (\InvalidArgumentException $e) { |
|
| 35 | $actual = $e->getMessage(); |
|
| 36 | } |
|
| 37 | $this->assertEquals($expected, $actual); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testIsDerivableTypeAttributesValidNameGoodBaseTypeNotGood() |
|
| 41 | { |
|
| @@ 61-75 (lines=15) @@ | ||
| 58 | $this->assertStringEndsWith($expectedEnds, $actual); |
|
| 59 | } |
|
| 60 | ||
| 61 | public function testSetNameNull() |
|
| 62 | { |
|
| 63 | $expected = "Name cannot be null"; |
|
| 64 | $actual = null; |
|
| 65 | $name = null; |
|
| 66 | ||
| 67 | $foo = new TEntityTypeType(); |
|
| 68 | ||
| 69 | try { |
|
| 70 | $foo->setName($name); |
|
| 71 | } catch (\InvalidArgumentException $e) { |
|
| 72 | $actual = $e->getMessage(); |
|
| 73 | } |
|
| 74 | $this->assertEquals($expected, $actual); |
|
| 75 | } |
|
| 76 | ||
| 77 | public function testSetNameNonString() |
|
| 78 | { |
|
| @@ 77-91 (lines=15) @@ | ||
| 74 | $this->assertEquals($expected, $actual); |
|
| 75 | } |
|
| 76 | ||
| 77 | public function testSetNameNonString() |
|
| 78 | { |
|
| 79 | $expected = "Name must be a valid TSimpleIdentifier"; |
|
| 80 | $actual = null; |
|
| 81 | $name = new \DateTime(); |
|
| 82 | ||
| 83 | $foo = new TEntityTypeType(); |
|
| 84 | ||
| 85 | try { |
|
| 86 | $foo->setName($name); |
|
| 87 | } catch (\InvalidArgumentException $e) { |
|
| 88 | $actual = $e->getMessage(); |
|
| 89 | } |
|
| 90 | $this->assertEquals($expected, $actual); |
|
| 91 | } |
|
| 92 | ||
| 93 | public function testIsTTypeAttributesValidNameNotSimpleIdentifier() |
|
| 94 | { |
|