Skip to content

Commit

Permalink
Closes #3369
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 19, 2018
1 parent bb1d5aa commit eb66a56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
1 change: 1 addition & 0 deletions ChangeLog-8.0.md
Expand Up @@ -8,6 +8,7 @@ All notable changes of the PHPUnit 8.0 release series are documented in this fil

* Implemented [#3288](https://github.com/sebastianbergmann/phpunit/issues/3288): The `void_return` fixer of php-cs-fixer is now in effect
* Implemented [#3341](https://github.com/sebastianbergmann/phpunit/issues/3341): Deprecate optional parameters of `assertEquals()` and `assertNotEquals()`
* Implemented [#3369](https://github.com/sebastianbergmann/phpunit/issues/3369): Deprecate `assertInternalType()` and `assertNotInternalType()`

### Removed

Expand Down
4 changes: 4 additions & 0 deletions src/Framework/Assert.php
Expand Up @@ -1581,6 +1581,8 @@ public static function assertAttributeNotInstanceOf(string $expected, string $at
*/
public static function assertInternalType(string $expected, $actual, string $message = ''): void
{
self::createWarning('assertInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(), assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(), assertIsResource(), assertIsString(), assertIsScalar(), assertIsCallable(), or assertIsIterable() instead.');

static::assertThat(
$actual,
new IsType($expected),
Expand Down Expand Up @@ -1749,6 +1751,8 @@ public static function assertIsIterable($actual, string $message = ''): void
*/
public static function assertNotInternalType(string $expected, $actual, string $message = ''): void
{
self::createWarning('assertNotInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertIsNotArray(), assertIsNotBool(), assertIsNotFloat(), assertIsNotInt(), assertIsNotNumeric(), assertIsNotObject(), assertIsNotResource(), assertIsNotString(), assertIsNotScalar(), assertIsNotCallable(), or assertIsNotIterable() instead.');

static::assertThat(
$actual,
new LogicalNot(
Expand Down
27 changes: 0 additions & 27 deletions tests/unit/Framework/AssertTest.php
Expand Up @@ -2431,24 +2431,6 @@ public function testAssertAttributeNotInstanceOf(): void
$this->assertAttributeNotInstanceOf(\Exception::class, 'a', $o);
}

public function testAssertInternalType(): void
{
$this->assertInternalType('integer', 1);

$this->expectException(AssertionFailedError::class);

$this->assertInternalType('string', 1);
}

public function testAssertInternalTypeDouble(): void
{
$this->assertInternalType('double', 1.0);

$this->expectException(AssertionFailedError::class);

$this->assertInternalType('double', 1);
}

public function testAssertAttributeInternalType(): void
{
$o = new \stdClass;
Expand All @@ -2457,15 +2439,6 @@ public function testAssertAttributeInternalType(): void
$this->assertAttributeInternalType('integer', 'a', $o);
}

public function testAssertNotInternalType(): void
{
$this->assertNotInternalType('string', 1);

$this->expectException(AssertionFailedError::class);

$this->assertNotInternalType('integer', 1);
}

public function testAssertAttributeNotInternalType(): void
{
$o = new \stdClass;
Expand Down

0 comments on commit eb66a56

Please sign in to comment.