Skip to content

Commit

Permalink
Closes #3495
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 25, 2019
1 parent aee3690 commit 00b3aa0
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 276 deletions.
1 change: 1 addition & 0 deletions ChangeLog-9.0.md
Expand Up @@ -15,6 +15,7 @@ All notable changes of the PHPUnit 9.0 release series are documented in this fil
* Implemented [#3339](https://github.com/sebastianbergmann/phpunit/issues/3339): Remove assertions (and helper methods) that operate on (non-public) attributes
* Implemented [#3342](https://github.com/sebastianbergmann/phpunit/issues/3342): Remove optional parameters of `assertEquals()` and `assertNotEquals()`
* Implemented [#3426](https://github.com/sebastianbergmann/phpunit/issues/3426): Clean up `assertContains()` and `assertNotContains()`
* Implemented [#3495](https://github.com/sebastianbergmann/phpunit/issues/3495): Remove `assertArraySubset()`

[9.0.0]: https://github.com/sebastianbergmann/phpunit/compare/8.5...master

38 changes: 0 additions & 38 deletions src/Framework/Assert.php
Expand Up @@ -14,7 +14,6 @@
use DOMDocument;
use DOMElement;
use PHPUnit\Framework\Constraint\ArrayHasKey;
use PHPUnit\Framework\Constraint\ArraySubset;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\Constraint\ClassHasAttribute;
use PHPUnit\Framework\Constraint\ClassHasStaticAttribute;
Expand Down Expand Up @@ -102,43 +101,6 @@ public static function assertArrayHasKey($key, $array, string $message = ''): vo
static::assertThat($array, $constraint, $message);
}

/**
* Asserts that an array has a specified subset.
*
* @param array|ArrayAccess $subset
* @param array|ArrayAccess $array
*
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws Exception
*
* @codeCoverageIgnore
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/3494
*/
public static function assertArraySubset($subset, $array, bool $checkForObjectIdentity = false, string $message = ''): void
{
self::createWarning('assertArraySubset() is deprecated and will be removed in PHPUnit 9.');

if (!(\is_array($subset) || $subset instanceof ArrayAccess)) {
throw InvalidArgumentException::create(
1,
'array or ArrayAccess'
);
}

if (!(\is_array($array) || $array instanceof ArrayAccess)) {
throw InvalidArgumentException::create(
2,
'array or ArrayAccess'
);
}

$constraint = new ArraySubset($subset, $checkForObjectIdentity);

static::assertThat($array, $constraint, $message);
}

/**
* Asserts that an array does not have a specified key.
*
Expand Down
20 changes: 0 additions & 20 deletions src/Framework/Assert/Functions.php
Expand Up @@ -81,26 +81,6 @@ function assertArrayHasKey($key, $array, string $message = ''): void
Assert::assertArrayHasKey(...\func_get_args());
}

/**
* Asserts that an array has a specified subset.
*
* @param array|ArrayAccess $subset
* @param array|ArrayAccess $array
*
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws Exception
*
* @codeCoverageIgnore
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/3494
* @see Assert::assertArraySubset
*/
function assertArraySubset($subset, $array, bool $checkForObjectIdentity = false, string $message = ''): void
{
Assert::assertArraySubset(...\func_get_args());
}

/**
* Asserts that an array does not have a specified key.
*
Expand Down
129 changes: 0 additions & 129 deletions src/Framework/Constraint/ArraySubset.php

This file was deleted.

89 changes: 0 additions & 89 deletions tests/unit/Framework/Constraint/ArraySubsetTest.php

This file was deleted.

0 comments on commit 00b3aa0

Please sign in to comment.