@@ 28-44 (lines=17) @@ | ||
25 | use FileCompare; |
|
26 | use PhpunitFatalErrorHandling; |
|
27 | ||
28 | public function testEmptyClassGenerator() |
|
29 | { |
|
30 | $namespace = 'TestNamespace'; |
|
31 | $className = 'EmptyClass'; |
|
32 | $gClassgen = new ClassGenerator($namespace, $className); |
|
33 | $gClassgen->setLogger($this->logger); |
|
34 | $config = new ClassConfig(); |
|
35 | $properties = []; // 'fields', 'extend', 'implements' |
|
36 | $typesReferenceArray = []; //dipendenza dei field da altre classi |
|
37 | $typesDescArray = []; //descrizione delle classi da cui dipendono i field |
|
38 | $gClassgen->generateClassType($properties, $typesReferenceArray, $typesDescArray, $config); |
|
39 | // $actual = $gClassgen->toString(); |
|
40 | // $expected = file_get_contents(__DIR__.'/../Resources/php/EmptyClass.php'); |
|
41 | // $this->assertSame($actual, $expected, 'Classe EmptyClass invalid'); |
|
42 | $resourcesDir = __DIR__.'/../Resources/php'; |
|
43 | $this->compareFileGenerated($resourcesDir, $namespace, $className, $gClassgen); |
|
44 | } |
|
45 | ||
46 | public function testFirstClassGenerator() |
|
47 | { |
|
@@ 560-575 (lines=16) @@ | ||
557 | $this->compareFileGenerated($resourcesDir, $namespace, $className, $gClassgen); |
|
558 | } |
|
559 | ||
560 | public function testSingleton() |
|
561 | { |
|
562 | $namespace = 'TestNamespace'; |
|
563 | $className = 'SingletonClass'; |
|
564 | $gClassgen = new ClassGenerator($namespace, $className); |
|
565 | $gClassgen->setLogger($this->logger); |
|
566 | $config = new ClassConfig(); |
|
567 | $config->isSingleton = true; |
|
568 | $properties = []; |
|
569 | $typesReferenceArray = []; |
|
570 | $typesDescArray = []; |
|
571 | $gClassgen->generateClassType($properties, $typesReferenceArray, $typesDescArray, $config); |
|
572 | $resourcesDir = __DIR__.'/../Resources/php'; |
|
573 | ||
574 | $this->compareFileGenerated($resourcesDir, $namespace, $className, $gClassgen); |
|
575 | } |
|
576 | ||
577 | public function testInterface() |
|
578 | { |