diff --git a/tests/unit/Converter/Anonymizer/AnonymizeDateTest.php b/tests/unit/Converter/Anonymizer/AnonymizeDateTest.php index 3a7ad29f..0a3c11be 100644 --- a/tests/unit/Converter/Anonymizer/AnonymizeDateTest.php +++ b/tests/unit/Converter/Anonymizer/AnonymizeDateTest.php @@ -24,6 +24,7 @@ public function testConverter(): void $date = '1990-12-31'; $value = $converter->convert($date); + $this->assertIsString($value); $this->assertDateIsAnonymized($value, $date, 'Y-m-d'); } @@ -37,6 +38,7 @@ public function testFormatParameter(): void $date = '31/12/1990'; $value = $converter->convert($date); + $this->assertIsString($value); $this->assertDateIsAnonymized($value, $date, $format); } diff --git a/tests/unit/Converter/Anonymizer/AnonymizeDateTimeTest.php b/tests/unit/Converter/Anonymizer/AnonymizeDateTimeTest.php index 91957185..7b58b7a9 100644 --- a/tests/unit/Converter/Anonymizer/AnonymizeDateTimeTest.php +++ b/tests/unit/Converter/Anonymizer/AnonymizeDateTimeTest.php @@ -19,6 +19,7 @@ public function testConverter(): void $date = '1990-12-31 12:05:41'; $value = $converter->convert($date); + $this->assertIsString($value); $this->assertDateIsAnonymized($value, $date, 'Y-m-d H:i:s'); } @@ -32,6 +33,7 @@ public function testFormatParameter(): void $date = '31/12/1990 12:05:41'; $value = $converter->convert($date); + $this->assertIsString($value); $this->assertDateIsAnonymized($value, $date, $format); } diff --git a/tests/unit/Converter/Generator/RandomDateTest.php b/tests/unit/Converter/Generator/RandomDateTest.php index c622791e..04a6156f 100644 --- a/tests/unit/Converter/Generator/RandomDateTest.php +++ b/tests/unit/Converter/Generator/RandomDateTest.php @@ -23,6 +23,7 @@ public function testConverter(): void $date = '1990-12-31'; $value = $converter->convert($date); + $this->assertIsString($value); $this->assertDateIsRandomized($value, $date, 'Y-m-d'); } @@ -36,6 +37,7 @@ public function testFormatParameter(): void $date = '31/12/1990'; $value = $converter->convert($date); + $this->assertIsString($value); $this->assertDateIsRandomized($value, $date, $format); } @@ -51,6 +53,7 @@ public function testYearParameters(): void $date = '1990-12-31'; $value = $converter->convert($date); + $this->assertIsString($value); $this->assertDateIsRandomized($value, $date, 'Y-m-d'); } @@ -66,6 +69,7 @@ public function testNullYears(): void $date = '1990-12-31'; $value = $converter->convert($date); + $this->assertIsString($value); $currentYear = (new DateTime())->format('Y'); $randomizedYear = (new DateTime($value))->format('Y'); diff --git a/tests/unit/Converter/Generator/RandomDateTimeTest.php b/tests/unit/Converter/Generator/RandomDateTimeTest.php index a4e5f499..4d3b2acb 100644 --- a/tests/unit/Converter/Generator/RandomDateTimeTest.php +++ b/tests/unit/Converter/Generator/RandomDateTimeTest.php @@ -22,6 +22,7 @@ public function testConverter(): void $date = '1990-12-31 12:05:41'; $value = $converter->convert($date); + $this->assertIsString($value); $this->assertDateIsRandomized($value, $date, 'Y-m-d H:i:s'); } @@ -35,6 +36,7 @@ public function testFormatParameter(): void $date = '31/12/1990 12:05:41'; $randomizedDate = $converter->convert($date); + $this->assertIsString($randomizedDate); $this->assertDateIsRandomized($randomizedDate, $date, $format); } @@ -50,6 +52,7 @@ public function testYearParameters(): void $date = '1990-12-31 12:05:41'; $randomizedDate = $converter->convert($date); + $this->assertIsString($randomizedDate); $this->assertDateIsRandomized($randomizedDate, $date, 'Y-m-d H:i:s'); } @@ -65,6 +68,7 @@ public function testNullYears(): void $date = '1990-12-31 12:05:41'; $randomizedDate = $converter->convert($date); + $this->assertIsString($randomizedDate); $currentYear = (new DateTime())->format('Y'); $randomizedYear = (new DateTime($randomizedDate))->format('Y'); diff --git a/tests/unit/Converter/Generator/RandomEmailTest.php b/tests/unit/Converter/Generator/RandomEmailTest.php index 089769fb..9ac6edfa 100644 --- a/tests/unit/Converter/Generator/RandomEmailTest.php +++ b/tests/unit/Converter/Generator/RandomEmailTest.php @@ -21,6 +21,7 @@ public function testConverter(): void $this->assertNotNull($value); $value = $converter->convert('user1@gmail.com'); + $this->assertIsString($value); $this->assertStringNotContainsString('user1', $value); $this->assertStringNotContainsString('@gmail.com', $value); $this->assertStringEndsWith('@example.org', $value); @@ -38,6 +39,7 @@ public function testCustomLength(): void ]); $value = $converter->convert('user1@example.org'); + $this->assertIsString($value); $this->assertStringEndsWith('@example.org', $value); $parts = explode('@', $value); diff --git a/tests/unit/Converter/Generator/RandomTextTest.php b/tests/unit/Converter/Generator/RandomTextTest.php index af9ce1ef..facdf44f 100644 --- a/tests/unit/Converter/Generator/RandomTextTest.php +++ b/tests/unit/Converter/Generator/RandomTextTest.php @@ -21,6 +21,7 @@ public function testConverter(): void $this->assertNotNull($value); $value = $converter->convert('user1'); + $this->assertIsString($value); $this->assertStringNotContainsString('user1', $value); $this->assertGreaterThanOrEqual(3, strlen($value)); } @@ -37,6 +38,7 @@ public function testCustomLength(): void ]); $value = $converter->convert('user1'); + $this->assertIsString($value); $this->assertSame(20, strlen($value)); } diff --git a/tests/unit/Converter/Proxy/JsonDataTest.php b/tests/unit/Converter/Proxy/JsonDataTest.php index 822ad1a8..44411fb4 100644 --- a/tests/unit/Converter/Proxy/JsonDataTest.php +++ b/tests/unit/Converter/Proxy/JsonDataTest.php @@ -29,6 +29,7 @@ public function testConverter(): void $this->assertNull($value); $value = $converter->convert($this->getJsonData()); + $this->assertIsString($value); $this->assertJson($this->getExpectedData(), $value); } diff --git a/tests/unit/Converter/Randomizer/RandomizeEmailTest.php b/tests/unit/Converter/Randomizer/RandomizeEmailTest.php index 589ac525..b37b603a 100644 --- a/tests/unit/Converter/Randomizer/RandomizeEmailTest.php +++ b/tests/unit/Converter/Randomizer/RandomizeEmailTest.php @@ -21,6 +21,7 @@ public function testConverter(): void $this->assertSame('', $value); $value = $converter->convert('user1@gmail.com'); + $this->assertIsString($value); $this->assertStringNotContainsString('user1', $value); $this->assertStringNotContainsString('@gmail.com', $value); $this->assertStringEndsWith('@example.org', $value); @@ -37,6 +38,7 @@ public function testCustomLength(): void ]); $value = $converter->convert('user1@example.org'); + $this->assertIsString($value); $this->assertStringEndsWith('@example.org', $value); $parts = explode('@', $value); diff --git a/tests/unit/Converter/Randomizer/RandomizeNumberTest.php b/tests/unit/Converter/Randomizer/RandomizeNumberTest.php index 21af41ea..016da44e 100644 --- a/tests/unit/Converter/Randomizer/RandomizeNumberTest.php +++ b/tests/unit/Converter/Randomizer/RandomizeNumberTest.php @@ -20,12 +20,13 @@ public function testConverter(): void $this->assertSame('', $value); $value = $converter->convert('+33601010101'); + $this->assertIsString($value); $this->assertStringStartsWith('+', $value); $this->assertSame(12, strlen($value)); // Assert that the part without the "+" is still a numeric value $valueWithoutPlus = substr($value, 1); - $this->assertTrue(is_numeric($valueWithoutPlus)); + $this->assertIsNumeric($valueWithoutPlus); $this->assertNotSame('33601010101', $valueWithoutPlus); } } diff --git a/tests/unit/Converter/Randomizer/RandomizeTextTest.php b/tests/unit/Converter/Randomizer/RandomizeTextTest.php index a2fe487d..1a7665e0 100644 --- a/tests/unit/Converter/Randomizer/RandomizeTextTest.php +++ b/tests/unit/Converter/Randomizer/RandomizeTextTest.php @@ -21,6 +21,7 @@ public function testConverter(): void $this->assertSame('', $value); $value = $converter->convert('user1'); + $this->assertIsString($value); $this->assertStringNotContainsString('user1', $value); } @@ -32,6 +33,7 @@ public function testCustomLength(): void $converter = $this->createConverter(RandomizeText::class, ['min_length' => 10]); $value = $converter->convert('user1'); + $this->assertIsString($value); $this->assertSame(10, strlen($value)); } diff --git a/tests/unit/Converter/Transformer/HashTest.php b/tests/unit/Converter/Transformer/HashTest.php index 75f8568b..7ffe7749 100644 --- a/tests/unit/Converter/Transformer/HashTest.php +++ b/tests/unit/Converter/Transformer/HashTest.php @@ -22,6 +22,7 @@ public function testConverter(): void $this->assertSame('', $value); $value = $converter->convert('user1'); + $this->assertIsString($value); $this->assertSame(40, strlen($value)); } @@ -33,6 +34,7 @@ public function testCustomAlgorithm(): void $converter = $this->createConverter(Hash::class, ['algorithm' => 'sha256']); $value = $converter->convert('user1'); + $this->assertIsString($value); $this->assertSame(64, strlen($value)); }