Skip to content

Commit 7152b55

Browse files
committed
Fix assertInternalType deprecation in phpunit 9
1 parent 166772e commit 7152b55

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Tests/CrawlerTest.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
class CrawlerTest extends TestCase
1819
{
20+
use ForwardCompatTestTrait;
21+
1922
public function testConstructor()
2023
{
2124
$crawler = new Crawler();
@@ -843,7 +846,7 @@ public function testChaining()
843846
public function testLinks()
844847
{
845848
$crawler = $this->createTestCrawler('http://example.com/bar/')->selectLink('Foo');
846-
$this->assertInternalType('array', $crawler->links(), '->links() returns an array');
849+
$this->assertIsArray($crawler->links(), '->links() returns an array');
847850

848851
$this->assertCount(4, $crawler->links(), '->links() returns an array');
849852
$links = $crawler->links();
@@ -855,7 +858,7 @@ public function testLinks()
855858
public function testImages()
856859
{
857860
$crawler = $this->createTestCrawler('http://example.com/bar/')->selectImage('Bar');
858-
$this->assertInternalType('array', $crawler->images(), '->images() returns an array');
861+
$this->assertIsArray($crawler->images(), '->images() returns an array');
859862

860863
$this->assertCount(4, $crawler->images(), '->images() returns an array');
861864
$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)