Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"ext-dom": "*",
"ext-libxml": "*",
"php-webdriver/webdriver": "^1.8.2",
"symfony/browser-kit": "^6.4 || ^7.3 || ^8.0",
"symfony/dependency-injection": "^6.4 || ^7.3 || ^8.0",
"symfony/browser-kit": "^6.4 || ^7.3 || ^8.0 || ^8.0",
"symfony/dependency-injection": "^6.4 || ^7.3 || ^8.0 || ^8.0",
"symfony/deprecation-contracts": "^2.4 || ^3",
"symfony/dom-crawler": "^6.4 || ^7.3 || ^8.0",
"symfony/http-client": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.3 || ^8.0",
"symfony/process": "^6.4 || ^7.3 || ^8.0"
"symfony/dom-crawler": "^6.4 || ^7.3 || ^8.0 || ^8.0",
"symfony/http-client": "^6.4 || ^7.0 || ^8.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only needed change in this file.

"symfony/http-kernel": "^6.4 || ^7.3 || ^8.0 || ^8.0",
"symfony/process": "^6.4 || ^7.3 || ^8.0 || ^8.0"
},
"require-dev": {
"symfony/css-selector": "^6.4 || ^7.3 || ^8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
return new PantherCrawler($elements, $this->webDriver, $this->webDriver->getCurrentURL());
}

protected function doRequest($request)
protected function doRequest(object $request): void

Check failure on line 294 in src/Client.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Return type (void) of method Symfony\Component\Panther\Client::doRequest() should be compatible with return type (object) of method Symfony\Component\BrowserKit\AbstractBrowser<object,object>::doRequest()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
throw new LogicException('Not useful in WebDriver mode.');
}
Expand Down
2 changes: 2 additions & 0 deletions tests/AssertionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Symfony\Component\Panther\Tests;

use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\AbstractBrowser;

Expand All @@ -29,6 +30,7 @@
}
}

#[DataProvider('clientFactoryProvider')]

Check failure on line 33 in tests/AssertionsTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider clientFactoryProvider
*/
Expand Down
22 changes: 22 additions & 0 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Facebook\WebDriver\JavaScriptExecutor;
use Facebook\WebDriver\WebDriver;
use Facebook\WebDriver\WebDriverExpectedCondition;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\BrowserKit\AbstractBrowser;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\BrowserKit\CookieJar as BrowserKitCookieJar;
Expand Down Expand Up @@ -56,6 +57,7 @@
$client->waitFor('');
}

#[DataProvider('waitForDataProvider')]

Check failure on line 60 in tests/ClientTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider waitForDataProvider
*/
Expand Down Expand Up @@ -83,6 +85,7 @@
yield 'xpath expression' => ['locator' => '//*[@id="hello"]'];
}

#[DataProvider('waitForDataProvider')]

Check failure on line 88 in tests/ClientTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider waitForDataProvider
*/
Expand All @@ -95,6 +98,7 @@
$this->assertSame('Hello', $crawler->filter('#hello')->text(null, true));
}

#[DataProvider('waitForDataProvider')]

Check failure on line 101 in tests/ClientTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider waitForDataProvider
*/
Expand All @@ -107,6 +111,7 @@
$this->assertSame('', $crawler->filter('#hello')->text(null, true));
}

#[DataProvider('waitForDataProvider')]

Check failure on line 114 in tests/ClientTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider waitForDataProvider
*/
Expand All @@ -119,6 +124,7 @@
$this->assertSame('Hello new content', $crawler->filter('#hello')->text(null, true));
}

#[DataProvider('waitForDataProvider')]

Check failure on line 127 in tests/ClientTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider waitForDataProvider
*/
Expand All @@ -131,6 +137,7 @@
$this->assertSame('Hello', $crawler->filter('#hello')->text(null, true));
}

#[DataProvider('waitForDataProvider')]

Check failure on line 140 in tests/ClientTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider waitForDataProvider
*/
Expand All @@ -143,6 +150,7 @@
$this->assertTrue($crawler->filter('#hello')->isEnabled());
}

#[DataProvider('waitForDataProvider')]

Check failure on line 153 in tests/ClientTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider waitForDataProvider
*/
Expand All @@ -155,6 +163,7 @@
$this->assertFalse($crawler->filter('#hello')->isEnabled());
}

#[DataProvider('waitForDataProvider')]

Check failure on line 166 in tests/ClientTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist.
/**
* @dataProvider waitForDataProvider
*/
Expand All @@ -167,6 +176,7 @@
$this->assertSame('42', $crawler->filter('#hello')->getAttribute('data-old-price'));
}

#[DataProvider('waitForDataProvider')]
/**
* @dataProvider waitForDataProvider
*/
Expand All @@ -179,6 +189,7 @@
$this->assertSame('36', $crawler->filter('#hello')->getAttribute('data-old-price'));
}

#[DataProvider('waitForDataProvider')]
/**
* @dataProvider waitForDataProvider
*/
Expand Down Expand Up @@ -244,6 +255,7 @@
];
}

#[DataProvider('waitForExceptionsProvider')]
/**
* @dataProvider waitForExceptionsProvider
*/
Expand Down Expand Up @@ -287,6 +299,7 @@
$this->assertSame('P1', $innerText);
}

#[DataProvider('clientFactoryProvider')]
/**
* @dataProvider clientFactoryProvider
*/
Expand Down Expand Up @@ -318,6 +331,7 @@
$this->assertSame('Hello', $refreshedCrawler->filter('h1')->text(null, true));
}

#[DataProvider('clientFactoryProvider')]
/**
* @dataProvider clientFactoryProvider
*/
Expand All @@ -336,6 +350,7 @@
$this->assertSame(self::$baseUri.'/basic.html#e12', $crawler->getUri());
}

#[DataProvider('clientFactoryProvider')]
/**
* @dataProvider clientFactoryProvider
*/
Expand Down Expand Up @@ -391,6 +406,7 @@
$this->assertSame('I1: n/a', $crawler->filter('#result')->text(null, true));
}

#[DataProvider('clientFactoryProvider')]
/**
* @dataProvider clientFactoryProvider
*/
Expand All @@ -417,6 +433,7 @@
$this->assertSame('I1: Reclus', $crawler->filter('#result')->text(null, true));
}

#[DataProvider('clientFactoryProvider')]
/**
* @dataProvider clientFactoryProvider
*/
Expand Down Expand Up @@ -444,6 +461,7 @@
$this->assertSame(self::$baseUri.'/link.html', $crawler->getUri());
}

#[DataProvider('clientFactoryProvider')]
/**
* @dataProvider clientFactoryProvider
*/
Expand Down Expand Up @@ -496,6 +514,7 @@
$this->assertNull($cookieJar->get('foo'));
}

#[DataProvider('clientFactoryProvider')]
/**
* @dataProvider clientFactoryProvider
*/
Expand All @@ -506,6 +525,7 @@
$this->assertEquals($expectedPort, mb_substr(self::$baseUri, -4));
}

#[DataProvider('clientFactoryProvider')]
/**
* @dataProvider clientFactoryProvider
*/
Expand Down Expand Up @@ -593,6 +613,7 @@
]);
}

#[DataProvider('providePrefersReducedMotion')]
/**
* @dataProvider providePrefersReducedMotion
*/
Expand All @@ -605,6 +626,7 @@
$this->assertStringEndsWith('#clicked', $client->getCurrentURL());
}

#[DataProvider('providePrefersReducedMotion')]
/**
* @dataProvider providePrefersReducedMotion
*/
Expand Down
Loading
Loading