| @@ 25-38 (lines=14) @@ | ||
| 22 | $this->assertTrue($foo->getNullable()); |
|
| 23 | } |
|
| 24 | ||
| 25 | public function testSetBadMaxLength() |
|
| 26 | { |
|
| 27 | $expected = 'Input must be numeric'; |
|
| 28 | $actual = null; |
|
| 29 | ||
| 30 | $foo = new TValueTermType(); |
|
| 31 | ||
| 32 | try { |
|
| 33 | $foo->setMaxLength(" _ "); |
|
| 34 | } catch (\InvalidArgumentException $e) { |
|
| 35 | $actual = $e->getMessage(); |
|
| 36 | } |
|
| 37 | $this->assertEquals($expected, $actual); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testSetGetMaxLengthRoundTrip() |
|
| 41 | { |
|
| @@ 59-72 (lines=14) @@ | ||
| 56 | $this->assertNull($foo->getMaxLength()); |
|
| 57 | } |
|
| 58 | ||
| 59 | public function testSetBadFixedLength() |
|
| 60 | { |
|
| 61 | $expected = 'Fixed length must be a valid TFixedLengthFacet'; |
|
| 62 | $actual = null; |
|
| 63 | ||
| 64 | $foo = new TValueTermType(); |
|
| 65 | ||
| 66 | try { |
|
| 67 | $foo->setFixedLength(" _ "); |
|
| 68 | } catch (\InvalidArgumentException $e) { |
|
| 69 | $actual = $e->getMessage(); |
|
| 70 | } |
|
| 71 | $this->assertEquals($expected, $actual); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function testSetGetFixedLengthRoundTrip() |
|
| 75 | { |
|
| @@ 74-84 (lines=11) @@ | ||
| 71 | $this->assertEquals($expected, $actual); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function testSetGetFixedLengthRoundTrip() |
|
| 75 | { |
|
| 76 | $expected = true; |
|
| 77 | $actual = null; |
|
| 78 | ||
| 79 | $foo = new TValueTermType(); |
|
| 80 | $foo->setFixedLength($expected); |
|
| 81 | $actual = $foo->getFixedLength(); |
|
| 82 | ||
| 83 | $this->assertEquals($expected, $actual); |
|
| 84 | } |
|
| 85 | ||
| 86 | public function testSetBadPrecision() |
|
| 87 | { |
|
| @@ 86-99 (lines=14) @@ | ||
| 83 | $this->assertEquals($expected, $actual); |
|
| 84 | } |
|
| 85 | ||
| 86 | public function testSetBadPrecision() |
|
| 87 | { |
|
| 88 | $expected = 'Input must be numeric'; |
|
| 89 | $actual = null; |
|
| 90 | ||
| 91 | $foo = new TValueTermType(); |
|
| 92 | ||
| 93 | try { |
|
| 94 | $foo->setPrecision(" _ "); |
|
| 95 | } catch (\InvalidArgumentException $e) { |
|
| 96 | $actual = $e->getMessage(); |
|
| 97 | } |
|
| 98 | $this->assertEquals($expected, $actual); |
|
| 99 | } |
|
| 100 | ||
| 101 | public function testSetGetPrecisionRoundTrip() |
|
| 102 | { |
|
| @@ 120-133 (lines=14) @@ | ||
| 117 | $this->assertNull($foo->getPrecision()); |
|
| 118 | } |
|
| 119 | ||
| 120 | public function testSetBadScale() |
|
| 121 | { |
|
| 122 | $expected = 'Input must be numeric'; |
|
| 123 | $actual = null; |
|
| 124 | ||
| 125 | $foo = new TValueTermType(); |
|
| 126 | ||
| 127 | try { |
|
| 128 | $foo->setScale(" _ "); |
|
| 129 | } catch (\InvalidArgumentException $e) { |
|
| 130 | $actual = $e->getMessage(); |
|
| 131 | } |
|
| 132 | $this->assertEquals($expected, $actual); |
|
| 133 | } |
|
| 134 | ||
| 135 | public function testSetGetScaleRoundTrip() |
|
| 136 | { |
|
| @@ 154-167 (lines=14) @@ | ||
| 151 | $this->assertNull($foo->getScale()); |
|
| 152 | } |
|
| 153 | ||
| 154 | public function testSetBadUnicode() |
|
| 155 | { |
|
| 156 | $expected = 'Unicode must be a valid TUnicodeFacet'; |
|
| 157 | $actual = null; |
|
| 158 | ||
| 159 | $foo = new TValueTermType(); |
|
| 160 | ||
| 161 | try { |
|
| 162 | $foo->setUnicode(" _ "); |
|
| 163 | } catch (\InvalidArgumentException $e) { |
|
| 164 | $actual = $e->getMessage(); |
|
| 165 | } |
|
| 166 | $this->assertEquals($expected, $actual); |
|
| 167 | } |
|
| 168 | ||
| 169 | public function testSetGetUnicodeRoundTrip() |
|
| 170 | { |
|
| @@ 169-179 (lines=11) @@ | ||
| 166 | $this->assertEquals($expected, $actual); |
|
| 167 | } |
|
| 168 | ||
| 169 | public function testSetGetUnicodeRoundTrip() |
|
| 170 | { |
|
| 171 | $expected = true; |
|
| 172 | $actual = null; |
|
| 173 | ||
| 174 | $foo = new TValueTermType(); |
|
| 175 | $foo->setUnicode($expected); |
|
| 176 | $actual = $foo->getUnicode(); |
|
| 177 | ||
| 178 | $this->assertEquals($expected, $actual); |
|
| 179 | } |
|
| 180 | ||
| 181 | public function testSetBadCollation() |
|
| 182 | { |
|
| @@ 208-221 (lines=14) @@ | ||
| 205 | $this->assertEquals($expected, $actual); |
|
| 206 | } |
|
| 207 | ||
| 208 | public function testSetBadSRID() |
|
| 209 | { |
|
| 210 | $expected = 'Input must be numeric'; |
|
| 211 | $actual = null; |
|
| 212 | ||
| 213 | $foo = new TValueTermType(); |
|
| 214 | ||
| 215 | try { |
|
| 216 | $foo->setSRID(" _ "); |
|
| 217 | } catch (\InvalidArgumentException $e) { |
|
| 218 | $actual = $e->getMessage(); |
|
| 219 | } |
|
| 220 | $this->assertEquals($expected, $actual); |
|
| 221 | } |
|
| 222 | ||
| 223 | public function testSetGetSRIDRoundTrip() |
|
| 224 | { |
|
| @@ 235-247 (lines=13) @@ | ||
| 232 | $this->assertEquals($expected, $actual); |
|
| 233 | } |
|
| 234 | ||
| 235 | public function testSetNullSRID() |
|
| 236 | { |
|
| 237 | $expected = 'Input must be a string'; |
|
| 238 | $actual = null; |
|
| 239 | ||
| 240 | $foo = new TValueTermType(); |
|
| 241 | try { |
|
| 242 | $foo->setSRID(null); |
|
| 243 | } catch (\InvalidArgumentException $e) { |
|
| 244 | $actual = $e->getMessage(); |
|
| 245 | } |
|
| 246 | $this->assertEquals($expected, $actual); |
|
| 247 | } |
|
| 248 | ||
| 249 | public function testIsTFacetAttributeValidNewCreation() |
|
| 250 | { |
|