Skip to content

Commit 5e54ee9

Browse files
Merge branch '4.4'
* 4.4: Fix assertInternalType deprecation in phpunit 9 Micro-typo fix add parameter type declarations to private methods
2 parents 702a180 + ab1bc1d commit 5e54ee9

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

FormFieldRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private static function create(string $base, array $values)
157157
*
158158
* @return array The list of fields as [string] Fully qualified name => (mixed) value)
159159
*/
160-
private function walk(array $array, string $base = '', array &$output = [])
160+
private function walk(array $array, ?string $base = '', array &$output = [])
161161
{
162162
foreach ($array as $k => $v) {
163163
$path = empty($base) ? $k : sprintf('%s[%s]', $base, $k);

Tests/AbstractCrawlerTest.php

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

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\DomCrawler\Crawler;
1617

1718
abstract class AbstractCrawlerTest extends TestCase
1819
{
20+
use ForwardCompatTestTrait;
21+
1922
abstract public function getDoctype(): string;
2023

2124
protected function createCrawler($node = null, string $uri = null, string $baseHref = null)
@@ -795,7 +798,7 @@ public function testChaining()
795798
public function testLinks()
796799
{
797800
$crawler = $this->createTestCrawler('http://example.com/bar/')->selectLink('Foo');
798-
$this->assertInternalType('array', $crawler->links(), '->links() returns an array');
801+
$this->assertIsArray($crawler->links(), '->links() returns an array');
799802

800803
$this->assertCount(4, $crawler->links(), '->links() returns an array');
801804
$links = $crawler->links();
@@ -807,7 +810,7 @@ public function testLinks()
807810
public function testImages()
808811
{
809812
$crawler = $this->createTestCrawler('http://example.com/bar/')->selectImage('Bar');
810-
$this->assertInternalType('array', $crawler->images(), '->images() returns an array');
813+
$this->assertIsArray($crawler->images(), '->images() returns an array');
811814

812815
$this->assertCount(4, $crawler->images(), '->images() returns an array');
813816
$images = $crawler->images();

Tests/Field/FileFormFieldTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111

1212
namespace Symfony\Component\DomCrawler\Tests\Field;
1313

14+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1415
use Symfony\Component\DomCrawler\Field\FileFormField;
1516

1617
class FileFormFieldTest extends FormFieldTestCase
1718
{
19+
use ForwardCompatTestTrait;
20+
1821
public function testInitialize()
1922
{
2023
$node = $this->createNode('input', '', ['type' => 'file']);
@@ -55,7 +58,7 @@ public function testSetValue($method)
5558

5659
$this->assertEquals(basename(__FILE__), $value['name'], "->$method() sets the name of the file field");
5760
$this->assertEquals('', $value['type'], "->$method() sets the type of the file field");
58-
$this->assertInternalType('string', $value['tmp_name'], "->$method() sets the tmp_name of the file field");
61+
$this->assertIsString($value['tmp_name'], "->$method() sets the tmp_name of the file field");
5962
$this->assertFileExists($value['tmp_name'], "->$method() creates a copy of the file at the tmp_name path");
6063
$this->assertEquals(0, $value['error'], "->$method() sets the error of the file field");
6164
$this->assertEquals(filesize(__FILE__), $value['size'], "->$method() sets the size of the file field");

0 commit comments

Comments
 (0)