Skip to content

Commit

Permalink
minor #32857 [PhpUnitBridge] Fix deprecation assertInternalType - 4.3…
Browse files Browse the repository at this point in the history
… (jderusse)

This PR was merged into the 4.3 branch.

Discussion
----------

[PhpUnitBridge] Fix deprecation assertInternalType - 4.3

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32844
| License       | MIT
| Doc PR        | NA

This PR fixes PhpUnit deprecation :
> 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

follow #32846 for 4.3 branch

Commits
-------

aa58789 Fix assertInternalType deprecation in phpunit 9
  • Loading branch information
nicolas-grekas committed Aug 1, 2019
2 parents 0ebf7ee + aa58789 commit 1938a54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/Symfony/Component/Intl/Tests/CurrenciesTest.php
Expand Up @@ -11,13 +11,16 @@

namespace Symfony\Component\Intl\Tests;

use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Intl\Currencies;

/**
* @group intl-data
*/
class CurrenciesTest extends ResourceBundleTestCase
{
use ForwardCompatTestTrait;

// The below arrays document the state of the ICU data bundled with this package.

private static $currencies = [
Expand Down Expand Up @@ -693,7 +696,7 @@ public function testGetFractionDigits($currency)
*/
public function testGetRoundingIncrement($currency)
{
$this->assertInternalType('numeric', Currencies::getRoundingIncrement($currency));
$this->assertIsNumeric(Currencies::getRoundingIncrement($currency));
}

public function provideCurrenciesWithNumericEquivalent()
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Workflow/Tests/RegistryTest.php
Expand Up @@ -87,7 +87,7 @@ public function testGetWithNoMatch()
public function testAllWithOneMatchWithSuccess()
{
$workflows = $this->registry->all(new Subject1());
$this->assertInternalType('array', $workflows);
$this->assertIsArray($workflows);
$this->assertCount(1, $workflows);
$this->assertInstanceOf(Workflow::class, $workflows[0]);
$this->assertSame('workflow1', $workflows[0]->getName());
Expand All @@ -96,7 +96,7 @@ public function testAllWithOneMatchWithSuccess()
public function testAllWithMultipleMatchWithSuccess()
{
$workflows = $this->registry->all(new Subject2());
$this->assertInternalType('array', $workflows);
$this->assertIsArray($workflows);
$this->assertCount(2, $workflows);
$this->assertInstanceOf(Workflow::class, $workflows[0]);
$this->assertInstanceOf(Workflow::class, $workflows[1]);
Expand All @@ -107,7 +107,7 @@ public function testAllWithMultipleMatchWithSuccess()
public function testAllWithNoMatch()
{
$workflows = $this->registry->all(new \stdClass());
$this->assertInternalType('array', $workflows);
$this->assertIsArray($workflows);
$this->assertCount(0, $workflows);
}

Expand Down

0 comments on commit 1938a54

Please sign in to comment.