Skip to content

Commit f850bea

Browse files
authored
Merge branch 'main' into feature/allow-running-headfull-tests
2 parents e92669b + 71c4c6a commit f850bea

24 files changed

+49
-59
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ then start the local PHP server which will serve the test pages and then run the
6161

6262
```sh
6363
export BROWSER_NAME="htmlunit" # see below for other browsers
64-
java -jar selenium-server-standalone-X.X.X.jar -log selenium.log &
64+
java -jar selenium-server-X.XX.0.jar standalone --log selenium.log &
6565
php -S localhost:8000 -t tests/functional/web/ &
6666
# Use following to run both unit and functional tests
6767
composer all

.github/workflows/tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
strategy:
4848
matrix:
49-
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
49+
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
5050
dependencies: ['']
5151
include:
5252
- { php-version: '7.3', dependencies: '--prefer-lowest' }
@@ -82,7 +82,7 @@ jobs:
8282
functional-tests:
8383
runs-on: ${{ matrix.os }}
8484
env:
85-
SELENIUM_SERVER_DOWNLOAD_URL: https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.15.0/selenium-server-4.15.0.jar
85+
SELENIUM_SERVER_DOWNLOAD_URL: https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.26.0/selenium-server-4.26.0.jar
8686

8787
strategy:
8888
fail-fast: false
@@ -127,7 +127,7 @@ jobs:
127127
run: |
128128
google-chrome --version
129129
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \
130-
chromedriver --port=4444 --url-base=/wd/hub &> ./logs/chromedriver.log &
130+
chromedriver --port=4444 &> ./logs/chromedriver.log &
131131
132132
- name: Start GeckoDriver
133133
if: ${{ !matrix.selenium-server && matrix.browser == 'firefox' }}

.php-cs-fixer.dist.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
'no_whitespace_before_comma_in_array' => ['after_heredoc' => true],
7878
'no_whitespace_in_blank_line' => true,
7979
'non_printable_character' => true,
80+
'nullable_type_declaration' => [
81+
'syntax' => 'question_mark',
82+
],
83+
'nullable_type_declaration_for_default_null_value' => true,
8084
'object_operator_without_whitespace' => true,
8185
'ordered_class_elements' => true,
8286
'ordered_imports' => true,

example.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
require_once('vendor/autoload.php');
1212

13-
// This is where Selenium server 2/3 listens by default. For Selenium 4, Chromedriver or Geckodriver, use http://localhost:4444/
14-
$host = 'http://localhost:4444/wd/hub';
13+
// This is where Selenium, Chromedriver and Geckodriver 4 listens by default. For Selenium 2/3, use http://localhost:4444/wd/hub
14+
$host = 'http://localhost:4444/';
1515

1616
$capabilities = DesiredCapabilities::chrome();
1717

lib/Chrome/ChromeDriver.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ class ChromeDriver extends LocalWebDriver
2121
* @todo Remove $service parameter. Use `ChromeDriver::startUsingDriverService` to pass custom $service instance.
2222
* @return static
2323
*/
24-
public static function start(DesiredCapabilities $desired_capabilities = null, ChromeDriverService $service = null)
25-
{
24+
public static function start(
25+
?DesiredCapabilities $desired_capabilities = null,
26+
?ChromeDriverService $service = null
27+
) {
2628
if ($service === null) { // TODO: Remove the condition (always create default service)
2729
$service = ChromeDriverService::createDefaultService();
2830
}
@@ -40,7 +42,7 @@ public static function start(DesiredCapabilities $desired_capabilities = null, C
4042
*/
4143
public static function startUsingDriverService(
4244
ChromeDriverService $service,
43-
DesiredCapabilities $capabilities = null
45+
?DesiredCapabilities $capabilities = null
4446
) {
4547
if ($capabilities === null) {
4648
$capabilities = DesiredCapabilities::chrome();

lib/Exception/Internal/DriverServerDiedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
class DriverServerDiedException extends \RuntimeException implements PhpWebDriverExceptionInterface
1111
{
12-
public function __construct(\Exception $previous = null)
12+
public function __construct(?\Exception $previous = null)
1313
{
1414
parent::__construct('The driver server has died.', 0, $previous);
1515
}

lib/Firefox/FirefoxDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FirefoxDriver extends LocalWebDriver
2626
*
2727
* @return static
2828
*/
29-
public static function start(DesiredCapabilities $capabilities = null)
29+
public static function start(?DesiredCapabilities $capabilities = null)
3030
{
3131
$service = FirefoxDriverService::createDefaultService();
3232

@@ -43,7 +43,7 @@ public static function start(DesiredCapabilities $capabilities = null)
4343
*/
4444
public static function startUsingDriverService(
4545
FirefoxDriverService $service,
46-
DesiredCapabilities $capabilities = null
46+
?DesiredCapabilities $capabilities = null
4747
) {
4848
if ($capabilities === null) {
4949
$capabilities = DesiredCapabilities::firefox();

lib/Interactions/Internal/WebDriverKeysRelatedAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract class WebDriverKeysRelatedAction
2727
public function __construct(
2828
WebDriverKeyboard $keyboard,
2929
WebDriverMouse $mouse,
30-
WebDriverLocatable $location_provider = null
30+
?WebDriverLocatable $location_provider = null
3131
) {
3232
$this->keyboard = $keyboard;
3333
$this->mouse = $mouse;

lib/Interactions/Internal/WebDriverMouseAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class WebDriverMouseAction
1919
*/
2020
protected $locationProvider;
2121

22-
public function __construct(WebDriverMouse $mouse, WebDriverLocatable $location_provider = null)
22+
public function __construct(WebDriverMouse $mouse, ?WebDriverLocatable $location_provider = null)
2323
{
2424
$this->mouse = $mouse;
2525
$this->locationProvider = $location_provider;

lib/Interactions/Internal/WebDriverMoveToOffsetAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class WebDriverMoveToOffsetAction extends WebDriverMouseAction implements WebDri
2323
*/
2424
public function __construct(
2525
WebDriverMouse $mouse,
26-
WebDriverLocatable $location_provider = null,
26+
?WebDriverLocatable $location_provider = null,
2727
$x_offset = null,
2828
$y_offset = null
2929
) {

0 commit comments

Comments
 (0)