diff --git a/test/StringPrefixTest.php b/test/StringPrefixTest.php index a537547d..396a81d0 100644 --- a/test/StringPrefixTest.php +++ b/test/StringPrefixTest.php @@ -8,6 +8,7 @@ namespace ZendTest\Filter; use PHPUnit\Framework\TestCase; +use stdClass; use Zend\Filter\Exception\InvalidArgumentException; use Zend\Filter\StringPrefix as StringPrefixFilter; @@ -56,17 +57,17 @@ public function testWithoutPrefix() public function invalidPrefixesDataProvider() { return [ - [1], - [1.00], - [true], - [null], - [[]], - [fopen('php://memory', 'rb+')], - [ + 'int' => [1], + 'float' => [1.00], + 'true' => [true], + 'null' => [null], + 'empty array' => [[]], + 'resource' => [fopen('php://memory', 'rb+')], + 'array with callable' => [ function () { }, ], - [new \stdClass()], + 'object' => [new stdClass()], ]; } @@ -93,6 +94,6 @@ public function testNonScalarInput() $prefix = 'ABC123'; $filter->setPrefix($prefix); - $this->assertInstanceOf(\stdClass::class, $filter(new \stdClass())); + $this->assertInstanceOf(stdClass::class, $filter(new stdClass())); } } diff --git a/test/StringSuffixTest.php b/test/StringSuffixTest.php index 39a23b81..09f9ec4b 100644 --- a/test/StringSuffixTest.php +++ b/test/StringSuffixTest.php @@ -8,6 +8,7 @@ namespace ZendTest\Filter; use PHPUnit\Framework\TestCase; +use stdClass; use Zend\Filter\Exception\InvalidArgumentException; use Zend\Filter\StringSuffix as StringSuffixFilter; @@ -56,17 +57,17 @@ public function testWithoutSuffix() public function invalidSuffixesDataProvider() { return [ - [1], - [1.00], - [true], - [null], - [[]], - [fopen('php://memory', 'rb+')], - [ + 'int' => [1], + 'float' => [1.00], + 'true' => [true], + 'null' => [null], + 'empty array' => [[]], + 'resource' => [fopen('php://memory', 'rb+')], + 'array with callable' => [ function () { }, ], - [new \stdClass()], + 'object' => [new stdClass()], ]; } @@ -93,6 +94,6 @@ public function testNonScalarInput() $suffix = 'ABC123'; $filter->setSuffix($suffix); - $this->assertInstanceOf(\stdClass::class, $filter(new \stdClass())); + $this->assertInstanceOf(stdClass::class, $filter(new stdClass())); } }