diff --git a/tests/Unit/Shared/Infrastructure/AbstractDatabaseSettingsRepositoryTestCase.php b/tests/Unit/Shared/Infrastructure/AbstractDatabaseSettingsRepositoryTestCase.php index 7ce7b93..1d8be13 100644 --- a/tests/Unit/Shared/Infrastructure/AbstractDatabaseSettingsRepositoryTestCase.php +++ b/tests/Unit/Shared/Infrastructure/AbstractDatabaseSettingsRepositoryTestCase.php @@ -245,35 +245,35 @@ public static function wrongSettingsValueDataProvider(): \Generator yield [ 'method' => 'getInteger', 'type' => FieldType::NUMBER, - 'value' => 'any', + 'possibleValue' => 'any', 'expectedException' => WrongSettingValueException::class ]; yield [ 'method' => 'getInteger', 'type' => FieldType::NUMBER, - 'value' => null, + 'possibleValue' => null, 'expectedException' => WrongSettingValueException::class ]; yield [ 'method' => 'getInteger', 'type' => FieldType::NUMBER, - 'value' => 1.123, + 'possibleValue' => 1.123, 'expectedException' => WrongSettingValueException::class ]; yield [ 'method' => 'getInteger', 'type' => FieldType::NUMBER, - 'value' => '1.123', + 'possibleValue' => '1.123', 'expectedException' => WrongSettingValueException::class ]; yield [ 'method' => 'getFloat', 'type' => FieldType::NUMBER, - 'value' => 'any', + 'possibleValue' => 'any', 'expectedException' => WrongSettingValueException::class ]; @@ -281,84 +281,84 @@ public static function wrongSettingsValueDataProvider(): \Generator 'method' => 'getCollection', 'type' => FieldType::ARRAY, 'possibleValue' => false, - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'empty string instead of collection' => [ 'method' => 'getCollection', 'type' => FieldType::ARRAY, 'possibleValue' => '', - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'string instead of collection' => [ 'method' => 'getCollection', 'type' => FieldType::ARRAY, 'possibleValue' => 'some string', - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'integer instead of collection' => [ 'method' => 'getCollection', 'type' => FieldType::ARRAY, 'possibleValue' => 123, - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'float instead of collection' => [ 'method' => 'getCollection', 'type' => FieldType::ARRAY, 'possibleValue' => 1.23, - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'null instead of collection' => [ 'method' => 'getCollection', 'type' => FieldType::ARRAY, 'possibleValue' => false, - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'empty string instead of assoc collection' => [ 'method' => 'getAssocCollection', 'type' => FieldType::ASSOCIATIVE_ARRAY, 'possibleValue' => '', - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'false as the error result of unserialize in assoc collection' => [ 'method' => 'getAssocCollection', 'type' => FieldType::ASSOCIATIVE_ARRAY, 'possibleValue' => false, - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'string instead of assoc collection' => [ 'method' => 'getAssocCollection', 'type' => FieldType::ASSOCIATIVE_ARRAY, 'possibleValue' => 'some string', - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'integer instead of assoc collection' => [ 'method' => 'getAssocCollection', 'type' => FieldType::ASSOCIATIVE_ARRAY, 'possibleValue' => 123, - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'float instead of assoc collection' => [ 'method' => 'getAssocCollection', 'type' => FieldType::ASSOCIATIVE_ARRAY, 'possibleValue' => 1.23, - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; yield 'null instead of assoc collection' => [ 'method' => 'getAssocCollection', 'type' => FieldType::ASSOCIATIVE_ARRAY, 'possibleValue' => false, - 'expectedResult' => WrongSettingValueException::class + 'expectedException' => WrongSettingValueException::class ]; } } diff --git a/tests/Unit/Shared/Service/JsonCollectionEncodingServiceTest.php b/tests/Unit/Shared/Service/JsonCollectionEncodingServiceTest.php index e9fd32e..5883a43 100644 --- a/tests/Unit/Shared/Service/JsonCollectionEncodingServiceTest.php +++ b/tests/Unit/Shared/Service/JsonCollectionEncodingServiceTest.php @@ -48,17 +48,17 @@ public static function jsonDecodeCollectionDataProvider(): \Generator { yield [ 'value' => '', - 'result' => [] + 'expectedResult' => [] ]; yield [ 'value' => '["apple","banana"]', - 'result' => ["apple", "banana"] + 'expectedResult' => ["apple", "banana"] ]; yield [ 'value' => '{"name":"John","age":30}', - 'result' => ["name" => "John", "age" => 30] + 'expectedResult' => ["name" => "John", "age" => 30] ]; } diff --git a/tests/Unit/Shop/Infrastructure/ShopSettingRepositoryGettersTest.php b/tests/Unit/Shop/Infrastructure/ShopSettingRepositoryGettersTest.php index 445b13c..8a97a94 100644 --- a/tests/Unit/Shop/Infrastructure/ShopSettingRepositoryGettersTest.php +++ b/tests/Unit/Shop/Infrastructure/ShopSettingRepositoryGettersTest.php @@ -58,14 +58,14 @@ public function testGetShopSetting($method, $type, $possibleValue, $expectedResu public function testGetShopSettingWrongData( string $method, string $type, - $value, + mixed $possibleValue, string $expectedException ): void { $shopSettingDaoStub = $this->createStub(ShopConfigurationSettingDaoInterface::class); $shopSettingDaoStub->method('get')->willReturn( $this->createConfiguredMock(ShopConfigurationSetting::class, [ 'getType' => $type, - 'getValue' => $value + 'getValue' => $possibleValue ]) ); @@ -82,42 +82,42 @@ public static function wrongSettingsTypeDataProvider(): \Generator yield [ 'method' => 'getInteger', 'type' => 'wrong', - 'value' => 'any', + 'possibleValue' => 'any', 'expectedException' => WrongSettingTypeException::class ]; yield [ 'method' => 'getFloat', 'type' => 'wrong', - 'value' => 'any', + 'possibleValue' => 'any', 'expectedException' => WrongSettingTypeException::class ]; yield [ 'method' => 'getBoolean', 'type' => 'wrong', - 'value' => 'any', + 'possibleValue' => 'any', 'expectedException' => WrongSettingTypeException::class ]; yield [ 'method' => 'getString', 'type' => 'wrong', - 'value' => 'any', + 'possibleValue' => 'any', 'expectedException' => WrongSettingTypeException::class ]; yield [ 'method' => 'getSelect', 'type' => 'wrong', - 'value' => 'any', + 'possibleValue' => 'any', 'expectedException' => WrongSettingTypeException::class ]; yield [ 'method' => 'getCollection', 'type' => 'wrong', - 'value' => 'any', + 'possibleValue' => 'any', 'expectedException' => WrongSettingTypeException::class ]; } diff --git a/tests/Unit/Theme/Infrastructure/ThemeSettingRepositoryGettersTest.php b/tests/Unit/Theme/Infrastructure/ThemeSettingRepositoryGettersTest.php index deeccdb..1356cb3 100644 --- a/tests/Unit/Theme/Infrastructure/ThemeSettingRepositoryGettersTest.php +++ b/tests/Unit/Theme/Infrastructure/ThemeSettingRepositoryGettersTest.php @@ -14,6 +14,7 @@ use OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactoryInterface; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Enum\FieldType; use OxidEsales\GraphQL\ConfigurationAccess\Theme\Exception\NoSettingsFoundForThemeException; +use TheCodingMachine\GraphQLite\Types\ID; /** * @covers \OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepository @@ -48,7 +49,7 @@ public function testGetThemeSetting(string $method, string $type, mixed $possibl public function testGetThemeSettingWrongData( string $method, string $type, - mixed $value, + mixed $possibleValue, string $expectedException ): void { $name = uniqid(); @@ -57,7 +58,7 @@ public function testGetThemeSettingWrongData( $sut->expects($this->once()) ->method('getSettingValue') ->with($name, $type, 'awesomeTheme') - ->willReturn($value); + ->willReturn($possibleValue); $this->expectException($expectedException); $sut->$method($name, 'awesomeTheme'); @@ -78,16 +79,13 @@ public function testGetNoThemeSetting(string $repositoryMethod): void public static function noSettingExceptionDataProvider(): \Generator { - yield 'getInteger' => ['repositoryMethod' => 'getInteger', 'fieldType' => FieldType::NUMBER]; - yield 'getFloat' => ['repositoryMethod' => 'getFloat', 'fieldType' => FieldType::NUMBER]; - yield 'getBoolean' => ['repositoryMethod' => 'getBoolean', 'fieldType' => FieldType::BOOLEAN]; - yield 'getString' => ['repositoryMethod' => 'getString', 'fieldType' => FieldType::STRING]; - yield 'getSelect' => ['repositoryMethod' => 'getSelect', 'fieldType' => FieldType::SELECT]; - yield 'getCollection' => ['repositoryMethod' => 'getCollection', 'fieldType' => FieldType::ARRAY]; - yield 'getAssocCollection' => [ - 'repositoryMethod' => 'getAssocCollection', - 'fieldType' => FieldType::ASSOCIATIVE_ARRAY - ]; + yield 'getInteger' => ['repositoryMethod' => 'getInteger']; + yield 'getFloat' => ['repositoryMethod' => 'getFloat']; + yield 'getBoolean' => ['repositoryMethod' => 'getBoolean']; + yield 'getString' => ['repositoryMethod' => 'getString']; + yield 'getSelect' => ['repositoryMethod' => 'getSelect']; + yield 'getCollection' => ['repositoryMethod' => 'getCollection']; + yield 'getAssocCollection' => ['repositoryMethod' => 'getAssocCollection']; } public function testGetSettingsList(): void diff --git a/tests/phpintegration.xml b/tests/phpintegration.xml deleted file mode 100644 index cd3ed77..0000000 --- a/tests/phpintegration.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - ../src - - - - - Integration - - -