diff --git a/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit6/TestCompatibilityTrait.php b/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit6/TestCompatibilityTrait.php index 75e2d260d4..2362c58944 100644 --- a/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit6/TestCompatibilityTrait.php +++ b/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit6/TestCompatibilityTrait.php @@ -82,157 +82,143 @@ public static function assertNotEqualsCanonicalizing($expected, $actual, $messag } /** - * Forward compatibility for assertIsArray. + * Provides forward-compatibility for assertIsArray(). */ public static function assertIsArray($actual, $message = '') { static::assertInternalType('array', $actual, $message); } /** - * Forward compatibility for assertIsBool. + * Provides forward-compatibility for assertIsBool(). */ public static function assertIsBool($actual, $message = '') { static::assertInternalType('bool', $actual, $message); } /** - * Forward compatibility for assertIsFloat. + * Provides forward-compatibility for assertIsFloat(). */ public static function assertIsFloat($actual, $message = '') { static::assertInternalType('float', $actual, $message); } /** - * Forward compatibility for assertIsObject. + * Provides forward-compatibility for assertIsObject(). */ public static function assertIsInt($actual, $message = '') { static::assertInternalType('int', $actual, $message); } /** - * Forward compatibility for assertIsNumeric. + * Provides forward-compatibility for assertIsNumeric(). */ public static function assertIsNumeric($actual, $message = '') { static::assertInternalType('numeric', $actual, $message); } /** - * Forward compatibility for assertIsObject. + * Provides forward-compatibility for assertIsObject(). */ public static function assertIsObject($actual, $message = '') { static::assertInternalType('object', $actual, $message); } /** - * Forward compatibility for assertIsResource. + * Provides forward-compatibility for assertIsResource(). */ public static function assertIsResource($actual, $message = '') { static::assertInternalType('resource', $actual, $message); } /** - * Forward compatibility for assertIsString. + * Provides forward-compatibility for assertIsString(). */ public static function assertIsString($actual, $message = '') { static::assertInternalType('string', $actual, $message); } /** - * Forward compatibility for assertIsScalar. + * Provides forward-compatibility for assertIsScalar(). */ public static function assertIsScalar($actual, $message = '') { static::assertInternalType('scalar', $actual, $message); } /** - * Forward compatibility for assertIsCallable. + * Provides forward-compatibility for assertIsCallable(). */ public static function assertIsCallable($actual, $message = '') { static::assertInternalType('callable', $actual, $message); } /** - * Forward compatibility for assertIsIterable. - */ - public static function assertIsIterable($actual, $message = '') { - static::assertTrue(\is_iterable($actual), $message); - } - - /** - * Forward compatibility for assertIsNotArray. + * Provides forward-compatibility for assertIsNotArray(). */ public static function assertIsNotArray($actual, $message = '') { static::assertNotInternalType('array', $actual, $message); } /** - * Forward compatibility for assertIsNotBool. + * Provides forward-compatibility for assertIsNotBool(). */ public static function assertIsNotBool($actual, $message = '') { static::assertNotInternalType('bool', $actual, $message); } /** - * Forward compatibility for assertIsNotFloat. + * Provides forward-compatibility for assertIsNotFloat(). */ public static function assertIsNotFloat($actual, $message = '') { static::assertNotInternalType('float', $actual, $message); } /** - * Forward compatibility for assertIsNotObject. + * Provides forward-compatibility for assertIsNotObject(). */ public static function assertIsNotInt($actual, $message = '') { static::assertNotInternalType('int', $actual, $message); } /** - * Forward compatibility for assertIsNotNumeric. + * Provides forward-compatibility for assertIsNotNumeric(). */ public static function assertIsNotNumeric($actual, $message = '') { static::assertNotInternalType('numeric', $actual, $message); } /** - * Forward compatibility for assertIsNotObject. + * Provides forward-compatibility for assertIsNotObject(). */ public static function assertIsNotObject($actual, $message = '') { static::assertNotInternalType('object', $actual, $message); } /** - * Forward compatibility for assertIsNotResource. + * Provides forward-compatibility for assertIsNotResource(). */ public static function assertIsNotResource($actual, $message = '') { static::assertNotInternalType('resource', $actual, $message); } /** - * Forward compatibility for assertIsNotString. + * Provides forward-compatibility for assertIsNotString(). */ public static function assertIsNotString($actual, $message = '') { static::assertNotInternalType('string', $actual, $message); } /** - * Forward compatibility for assertIsNotScalar. + * Provides forward-compatibility for assertIsNotScalar(). */ public static function assertIsNotScalar($actual, $message = '') { static::assertNotInternalType('scalar', $actual, $message); } /** - * Forward compatibility for assertIsNotCallable. + * Provides forward-compatibility for assertIsNotCallable(). */ public static function assertIsNotCallable($actual, $message = '') { static::assertNotInternalType('callable', $actual, $message); } - /** - * Forward compatibility for assertIsNotIterable. - */ - public static function assertIsNotIterable($actual, $message = '') { - static::assertFalse(\is_iterable($actual), $message); - } - } diff --git a/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/TestCompatibilityTrait.php b/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/TestCompatibilityTrait.php index cab99335b0..77fdcdb0a5 100644 --- a/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/TestCompatibilityTrait.php +++ b/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/TestCompatibilityTrait.php @@ -82,157 +82,143 @@ public static function assertNotEqualsCanonicalizing($expected, $actual, string } /** - * Forward compatibility for assertIsArray. + * Provides forward-compatibility for assertIsArray(). */ public static function assertIsArray($actual, string $message = ''): void { static::assertInternalType('array', $actual, $message); } /** - * Forward compatibility for assertIsBool. + * Provides forward-compatibility for assertIsBool(). */ public static function assertIsBool($actual, string $message = ''): void { static::assertInternalType('bool', $actual, $message); } /** - * Forward compatibility for assertIsFloat. + * Provides forward-compatibility for assertIsFloat(). */ public static function assertIsFloat($actual, string $message = ''): void { static::assertInternalType('float', $actual, $message); } /** - * Forward compatibility for assertIsObject. + * Provides forward-compatibility for assertIsObject(). */ public static function assertIsInt($actual, string $message = ''): void { static::assertInternalType('int', $actual, $message); } /** - * Forward compatibility for assertIsNumeric. + * Provides forward-compatibility for assertIsNumeric(). */ public static function assertIsNumeric($actual, string $message = ''): void { static::assertInternalType('numeric', $actual, $message); } /** - * Forward compatibility for assertIsObject. + * Provides forward-compatibility for assertIsObject(). */ public static function assertIsObject($actual, string $message = ''): void { static::assertInternalType('object', $actual, $message); } /** - * Forward compatibility for assertIsResource. + * Provides forward-compatibility for assertIsResource(). */ public static function assertIsResource($actual, string $message = ''): void { static::assertInternalType('resource', $actual, $message); } /** - * Forward compatibility for assertIsString. + * Provides forward-compatibility for assertIsString(). */ public static function assertIsString($actual, string $message = ''): void { static::assertInternalType('string', $actual, $message); } /** - * Forward compatibility for assertIsScalar. + * Provides forward-compatibility for assertIsScalar(). */ public static function assertIsScalar($actual, string $message = ''): void { static::assertInternalType('scalar', $actual, $message); } /** - * Forward compatibility for assertIsCallable. + * Provides forward-compatibility for assertIsCallable(). */ public static function assertIsCallable($actual, string $message = ''): void { static::assertInternalType('callable', $actual, $message); } /** - * Forward compatibility for assertIsIterable. - */ - public static function assertIsIterable($actual, string $message = ''): void { - static::assertTrue(\is_iterable($actual), $message); - } - - /** - * Forward compatibility for assertIsNotArray. + * Provides forward-compatibility for assertIsNotArray(). */ public static function assertIsNotArray($actual, string $message = ''): void { static::assertNotInternalType('array', $actual, $message); } /** - * Forward compatibility for assertIsNotBool. + * Provides forward-compatibility for assertIsNotBool(). */ public static function assertIsNotBool($actual, string $message = ''): void { static::assertNotInternalType('bool', $actual, $message); } /** - * Forward compatibility for assertIsNotFloat. + * Provides forward-compatibility for assertIsNotFloat(). */ public static function assertIsNotFloat($actual, string $message = ''): void { static::assertNotInternalType('float', $actual, $message); } /** - * Forward compatibility for assertIsNotObject. + * Provides forward-compatibility for assertIsNotObject(). */ public static function assertIsNotInt($actual, string $message = ''): void { static::assertNotInternalType('int', $actual, $message); } /** - * Forward compatibility for assertIsNotNumeric. + * Provides forward-compatibility for assertIsNotNumeric(). */ public static function assertIsNotNumeric($actual, string $message = ''): void { static::assertNotInternalType('numeric', $actual, $message); } /** - * Forward compatibility for assertIsNotObject. + * Provides forward-compatibility for assertIsNotObject(). */ public static function assertIsNotObject($actual, string $message = ''): void { static::assertNotInternalType('object', $actual, $message); } /** - * Forward compatibility for assertIsNotResource. + * Provides forward-compatibility for assertIsNotResource(). */ public static function assertIsNotResource($actual, string $message = ''): void { static::assertNotInternalType('resource', $actual, $message); } /** - * Forward compatibility for assertIsNotString. + * Provides forward-compatibility for assertIsNotString(). */ public static function assertIsNotString($actual, string $message = ''): void { static::assertNotInternalType('string', $actual, $message); } /** - * Forward compatibility for assertIsNotScalar. + * Provides forward-compatibility for assertIsNotScalar(). */ public static function assertIsNotScalar($actual, string $message = ''): void { static::assertNotInternalType('scalar', $actual, $message); } /** - * Forward compatibility for assertIsNotCallable. + * Provides forward-compatibility for assertIsNotCallable(). */ public static function assertIsNotCallable($actual, string $message = ''): void { static::assertNotInternalType('callable', $actual, $message); } - /** - * Forward compatibility for assertIsNotIterable. - */ - public static function assertIsNotIterable($actual, string $message = ''): void { - static::assertFalse(\is_iterable($actual), $message); - } - } diff --git a/core/tests/Drupal/Tests/PhpunitCompatibilityTraitTest.php b/core/tests/Drupal/Tests/PhpunitCompatibilityTraitTest.php index ffad0e7777..c909c3ccc7 100644 --- a/core/tests/Drupal/Tests/PhpunitCompatibilityTraitTest.php +++ b/core/tests/Drupal/Tests/PhpunitCompatibilityTraitTest.php @@ -74,7 +74,6 @@ public function testAssertEqualsCanonicalizing() { * @covers ::assertIsString * @covers ::assertIsScalar * @covers ::assertIsCallable - * @covers ::assertIsIterable * @covers ::assertIsNotArray * @covers ::assertIsNotBool * @covers ::assertIsNotFloat @@ -85,7 +84,6 @@ public function testAssertEqualsCanonicalizing() { * @covers ::assertIsNotString * @covers ::assertIsNotScalar * @covers ::assertIsNotCallable - * @covers ::assertIsNotIterable */ public function testAssertIs() { $this->assertIsArray([]); @@ -98,7 +96,6 @@ public function testAssertIs() { $this->assertIsString(''); $this->assertIsScalar(1); $this->assertIsCallable(function () {}); - $this->assertIsIterable([]); $this->assertIsNotArray(1); $this->assertIsNotBool([]); $this->assertIsNotFloat(1); @@ -109,7 +106,6 @@ public function testAssertIs() { $this->assertIsNotString(1); $this->assertIsNotScalar([]); $this->assertIsNotCallable(1); - $this->assertIsNotIterable(1); } }