@@ 51-62 (lines=12) @@ | ||
48 | $this->assertEquals($expected, $actual); |
|
49 | } |
|
50 | ||
51 | public function testIsOkWithBadRole() |
|
52 | { |
|
53 | $expected = "Role must be a valid TSimpleIdentifier"; |
|
54 | $actual = null; |
|
55 | ||
56 | $foo = m::mock(EndAnonymousType::class)->makePartial(); |
|
57 | $foo->shouldReceive('isTSimpleIdentifierValid')->andReturn(true, true, true, false)->times(4); |
|
58 | $foo->setEntitySet("UnitPrice"); |
|
59 | $foo->setRole(" _ "); |
|
60 | $this->assertFalse($foo->isOK($actual)); |
|
61 | $this->assertEquals($expected, $actual); |
|
62 | } |
|
63 | } |
|
64 |
@@ 270-282 (lines=13) @@ | ||
267 | $this->assertEquals($expected, $actual); |
|
268 | } |
|
269 | ||
270 | public function testIsTFacetAttributeValidBadCollation() |
|
271 | { |
|
272 | $expected = "Collation must be a valid TCollationFacet:"; |
|
273 | $actual = null; |
|
274 | ||
275 | $foo = m::mock(TValueTermType::class)->makePartial(); |
|
276 | $foo->setNullable(true); |
|
277 | $foo->shouldReceive('isTCollationFacetValid')->andReturn(true, false)->twice(); |
|
278 | ||
279 | $foo->setCollation(' _ '); |
|
280 | $this->assertFalse($foo->isTFacetAttributesTraitValid($actual)); |
|
281 | $this->assertStringStartsWith($expected, $actual); |
|
282 | } |
|
283 | ||
284 | public function testIsTFacetAttributeValidBadMaxLength() |
|
285 | { |
|
@@ 284-296 (lines=13) @@ | ||
281 | $this->assertStringStartsWith($expected, $actual); |
|
282 | } |
|
283 | ||
284 | public function testIsTFacetAttributeValidBadMaxLength() |
|
285 | { |
|
286 | $expected = "Max length must be a valid TMaxLengthFacet: "; |
|
287 | $actual = null; |
|
288 | ||
289 | $foo = m::mock(TValueTermType::class)->makePartial(); |
|
290 | $foo->setNullable(true); |
|
291 | $foo->shouldReceive('isTMaxLengthFacetValid')->andReturn(true, false)->twice(); |
|
292 | ||
293 | $foo->setMaxLength(' _ '); |
|
294 | $this->assertFalse($foo->isTFacetAttributesTraitValid($actual)); |
|
295 | $this->assertStringStartsWith($expected, $actual); |
|
296 | } |
|
297 | ||
298 | public function testIsTFacetAttributeValidBadFixedLength() |
|
299 | { |
|
@@ 298-310 (lines=13) @@ | ||
295 | $this->assertStringStartsWith($expected, $actual); |
|
296 | } |
|
297 | ||
298 | public function testIsTFacetAttributeValidBadFixedLength() |
|
299 | { |
|
300 | $expected = "Fixed length must be a valid TFixedLengthFacet: "; |
|
301 | $actual = null; |
|
302 | ||
303 | $foo = m::mock(TValueTermType::class)->makePartial(); |
|
304 | $foo->setNullable(true); |
|
305 | $foo->shouldReceive('isTIsFixedLengthFacetTraitValid')->andReturn(true, false)->twice(); |
|
306 | ||
307 | $foo->setFixedLength(' _ '); |
|
308 | $this->assertFalse($foo->isTFacetAttributesTraitValid($actual)); |
|
309 | $this->assertStringStartsWith($expected, $actual); |
|
310 | } |
|
311 | ||
312 | public function testIsTFacetAttributeValidBadPrecision() |
|
313 | { |
|
@@ 312-324 (lines=13) @@ | ||
309 | $this->assertStringStartsWith($expected, $actual); |
|
310 | } |
|
311 | ||
312 | public function testIsTFacetAttributeValidBadPrecision() |
|
313 | { |
|
314 | $expected = "Precision must be a valid TPrecisionFacet: "; |
|
315 | $actual = null; |
|
316 | ||
317 | $foo = m::mock(TValueTermType::class)->makePartial(); |
|
318 | $foo->setNullable(true); |
|
319 | $foo->shouldReceive('isTPrecisionFacetValid')->andReturn(true, false)->twice(); |
|
320 | ||
321 | $foo->setPrecision(' _ '); |
|
322 | $this->assertFalse($foo->isTFacetAttributesTraitValid($actual)); |
|
323 | $this->assertStringStartsWith($expected, $actual); |
|
324 | } |
|
325 | ||
326 | public function testIsTFacetAttributeValidBadScale() |
|
327 | { |
|
@@ 326-338 (lines=13) @@ | ||
323 | $this->assertStringStartsWith($expected, $actual); |
|
324 | } |
|
325 | ||
326 | public function testIsTFacetAttributeValidBadScale() |
|
327 | { |
|
328 | $expected = "Scale must be a valid TScaleFacet: "; |
|
329 | $actual = null; |
|
330 | ||
331 | $foo = m::mock(TValueTermType::class)->makePartial(); |
|
332 | $foo->setNullable(true); |
|
333 | $foo->shouldReceive('isTScaleFacetValid')->andReturn(true, false)->twice(); |
|
334 | ||
335 | $foo->setScale(' _ '); |
|
336 | $this->assertFalse($foo->isTFacetAttributesTraitValid($actual)); |
|
337 | $this->assertStringStartsWith($expected, $actual); |
|
338 | } |
|
339 | ||
340 | public function testIsTFacetAttributeValidBadSRID() |
|
341 | { |
|
@@ 340-352 (lines=13) @@ | ||
337 | $this->assertStringStartsWith($expected, $actual); |
|
338 | } |
|
339 | ||
340 | public function testIsTFacetAttributeValidBadSRID() |
|
341 | { |
|
342 | $expected = "SRID must be a valid TSridFacet: "; |
|
343 | $actual = null; |
|
344 | ||
345 | $foo = m::mock(TValueTermType::class)->makePartial(); |
|
346 | $foo->setNullable(true); |
|
347 | $foo->shouldReceive('isTSridFacetValid')->andReturn(true, false)->twice(); |
|
348 | ||
349 | $foo->setSRID(' _ '); |
|
350 | $this->assertFalse($foo->isTFacetAttributesTraitValid($actual)); |
|
351 | $this->assertStringStartsWith($expected, $actual); |
|
352 | } |
|
353 | ||
354 | public function testIsTFacetAttributeValidBadUnicode() |
|
355 | { |
|
@@ 354-366 (lines=13) @@ | ||
351 | $this->assertStringStartsWith($expected, $actual); |
|
352 | } |
|
353 | ||
354 | public function testIsTFacetAttributeValidBadUnicode() |
|
355 | { |
|
356 | $expected = "Unicode must be a valid TUnicodeFacet: "; |
|
357 | $actual = null; |
|
358 | ||
359 | $foo = m::mock(TValueTermType::class)->makePartial(); |
|
360 | $foo->setNullable(true); |
|
361 | $foo->shouldReceive('isTIsUnicodeFacetTraitValid')->andReturn(true, false)->twice(); |
|
362 | ||
363 | $foo->setUnicode(' _ '); |
|
364 | $this->assertFalse($foo->isTFacetAttributesTraitValid($actual)); |
|
365 | $this->assertStringStartsWith($expected, $actual); |
|
366 | } |
|
367 | } |
|
368 |