diff --git a/composer.json b/composer.json index e584660..70296ae 100644 --- a/composer.json +++ b/composer.json @@ -67,7 +67,7 @@ "phpstan": "vendor/bin/phpstan analyse -c build/config/phpstan.neon", "rector": "vendor/bin/rector process src tests -c build/config/rector.php --xdebug", "php-cs-fixer": "vendor/bin/php-cs-fixer fix --config build/config/cs.php", - "infection": "vendor/bin/infection --only-covered --configuration=./build/config/infection.json.dist --threads=8 --min-msi=99.75", + "infection": "vendor/bin/infection --only-covered --configuration=./build/config/infection.json.dist --threads=8 --min-msi=99.5", "infection-rebuild": [ "@infection", "@generate-api" diff --git a/tests/Generator/ApiGenerator/FileGeneratingTest.php b/tests/Generator/ApiGenerator/FileGeneratingTest.php index 2731d26..8800961 100644 --- a/tests/Generator/ApiGenerator/FileGeneratingTest.php +++ b/tests/Generator/ApiGenerator/FileGeneratingTest.php @@ -163,7 +163,19 @@ public function assertClassHasConstructor(ClassType $class, array $properties): $this->assertSame('null', (string) $constructorParam->getDefaultValue()); } else { if ($constructorParam->getType() === 'array') { - $this->assertEquals('[]', $constructorParam->getDefaultValue()); + $this->assertSame('[]', (string) $constructorParam->getDefaultValue()); + } + if ($constructorParam->getType() === 'bool') { + $this->assertSame('false', (string) $constructorParam->getDefaultValue()); + } + if ($constructorParam->getType() === 'float') { + $this->assertSame('0.0', (string) $constructorParam->getDefaultValue()); + } + if ($constructorParam->getType() === 'int') { + $this->assertSame('0', (string) $constructorParam->getDefaultValue()); + } + if ($constructorParam->getType() === 'string') { + $this->assertSame("''", (string) $constructorParam->getDefaultValue()); } } // $this->assertFalse($constructor->getParameter($propertyName)->getNullable()); diff --git a/tests/Generator/ApiGenerator/TypeWithExtensionClassTest.php b/tests/Generator/ApiGenerator/TypeWithExtensionClassTest.php index c50ccd7..46fda99 100644 --- a/tests/Generator/ApiGenerator/TypeWithExtensionClassTest.php +++ b/tests/Generator/ApiGenerator/TypeWithExtensionClassTest.php @@ -6,9 +6,7 @@ class TypeWithExtensionClassTest extends FileGeneratingTest { public function testGenerateApiClassTypeWithExtension(): void { - $generatedClass = $this->getGeneratedClassFromFile( - 'type_with_extension' - ); + $generatedClass = $this->getGeneratedClassFromFile('type_with_extension'); $properties = [ self::getPropertyConfig('foobar', 'float', true, ['XmlAttribute' => '']),