@@ 389-404 (lines=16) @@ | ||
386 | $this->assertEquals($expected, $actual); |
|
387 | } |
|
388 | ||
389 | public function testCreateSingletonEmptyName() |
|
390 | { |
|
391 | $returnType = m::mock(TEntityTypeType::class); |
|
392 | $this->assertTrue($returnType instanceof TEntityTypeType, get_class($returnType)); |
|
393 | $foo = new MetadataManager(); |
|
394 | ||
395 | $expected = 'Name must be a non-empty string'; |
|
396 | $actual = null; |
|
397 | ||
398 | try { |
|
399 | $foo->createSingleton(null, $returnType); |
|
400 | } catch (\InvalidArgumentException $e) { |
|
401 | $actual = $e->getMessage(); |
|
402 | } |
|
403 | $this->assertEquals($expected, $actual); |
|
404 | } |
|
405 | ||
406 | public function testCreateSingletonNonStringName() |
|
407 | { |
|
@@ 406-421 (lines=16) @@ | ||
403 | $this->assertEquals($expected, $actual); |
|
404 | } |
|
405 | ||
406 | public function testCreateSingletonNonStringName() |
|
407 | { |
|
408 | $returnType = m::mock(TEntityTypeType::class); |
|
409 | $this->assertTrue($returnType instanceof TEntityTypeType, get_class($returnType)); |
|
410 | $foo = new MetadataManager(); |
|
411 | ||
412 | $expected = 'Name must be a non-empty string'; |
|
413 | $actual = null; |
|
414 | ||
415 | try { |
|
416 | $foo->createSingleton($returnType, $returnType); |
|
417 | } catch (\InvalidArgumentException $e) { |
|
418 | $actual = $e->getMessage(); |
|
419 | } |
|
420 | $this->assertEquals($expected, $actual); |
|
421 | } |
|
422 | ||
423 | public function testCreateSingletonSuccessful() |
|
424 | { |