Skip to content

Commit 489c16a

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix assertInternalType deprecation in phpunit 9 Micro-typo fix
2 parents 251a686 + 87e0acc commit 489c16a

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Tests/ContainerBuilderTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
use PHPUnit\Framework\TestCase;
1919
use Psr\Container\ContainerInterface as PsrContainerInterface;
20+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
2021
use Symfony\Component\Config\Resource\ComposerResource;
2122
use Symfony\Component\Config\Resource\DirectoryResource;
2223
use Symfony\Component\Config\Resource\FileResource;
@@ -48,6 +49,8 @@
4849

4950
class ContainerBuilderTest extends TestCase
5051
{
52+
use ForwardCompatTestTrait;
53+
5154
public function testDefaultRegisteredDefinitions()
5255
{
5356
$builder = new ContainerBuilder();
@@ -171,7 +174,7 @@ public function testGetCreatesServiceBasedOnDefinition()
171174
$builder = new ContainerBuilder();
172175
$builder->register('foo', 'stdClass');
173176

174-
$this->assertInternalType('object', $builder->get('foo'), '->get() returns the service definition associated with the id');
177+
$this->assertIsObject($builder->get('foo'), '->get() returns the service definition associated with the id');
175178
}
176179

177180
public function testGetReturnsRegisteredService()
@@ -681,7 +684,7 @@ public function testResolveEnvValuesWithArray()
681684
$container->resolveEnvPlaceholders('%dummy%', true);
682685
$container->resolveEnvPlaceholders('%dummy2%', true);
683686

684-
$this->assertInternalType('array', $container->resolveEnvPlaceholders('%dummy2%', true));
687+
$this->assertIsArray($container->resolveEnvPlaceholders('%dummy2%', true));
685688

686689
foreach ($dummyArray as $key => $value) {
687690
$this->assertArrayHasKey($key, $container->resolveEnvPlaceholders('%dummy2%', true));

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ public function testAnonymousServices()
632632

633633
// Anonymous service in a callable
634634
$factory = $definition->getFactory();
635-
$this->assertInternalType('array', $factory);
635+
$this->assertIsArray($factory);
636636
$this->assertInstanceOf(Reference::class, $factory[0]);
637637
$this->assertTrue($container->has((string) $factory[0]));
638638
$this->assertRegExp('/^\.\d+_Quz~[._A-Za-z0-9]{7}$/', (string) $factory[0]);

Tests/ParameterBag/EnvPlaceholderParameterBagTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\ParameterBag;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
1617

1718
class EnvPlaceholderParameterBagTest extends TestCase
1819
{
20+
use ForwardCompatTestTrait;
21+
1922
/**
2023
* @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
2124
*/
@@ -42,7 +45,7 @@ public function testMergeWillNotDuplicateIdenticalParameters()
4245
$placeholder = array_values($placeholderForVariable)[0];
4346

4447
$this->assertCount(1, $placeholderForVariable);
45-
$this->assertInternalType('string', $placeholder);
48+
$this->assertIsString($placeholder);
4649
$this->assertContains($envVariableName, $placeholder);
4750
}
4851

@@ -65,7 +68,7 @@ public function testMergeWhereFirstBagIsEmptyWillWork()
6568
$placeholder = array_values($placeholderForVariable)[0];
6669

6770
$this->assertCount(1, $placeholderForVariable);
68-
$this->assertInternalType('string', $placeholder);
71+
$this->assertIsString($placeholder);
6972
$this->assertContains($envVariableName, $placeholder);
7073
}
7174

0 commit comments

Comments
 (0)