Skip to content

Commit 086c6a8

Browse files
committed
Drop support for PHP <7.2
1 parent 369c087 commit 086c6a8

7 files changed

Lines changed: 16 additions & 37 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ jobs:
1818
runs-on: ubuntu-20.04
1919
strategy:
2020
matrix:
21-
php: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
21+
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
2222
fail-fast: false
23-
env:
24-
MATRIX_PHP: ${{ matrix.php }}
2523

2624
steps:
2725
- name: Checkout
@@ -38,20 +36,13 @@ jobs:
3836
# PHP 7.1 development web server segfaults if timezone not set.
3937
ini-values: date.timezone=Europe/Paris, error_reporting=-1, display_errors=On
4038

41-
- name: Configure for PHP >= 7.1
42-
if: "${{ matrix.php >= '7.1' }}"
43-
run: |
44-
composer require --no-update --dev symfony/error-handler "^4.4 || ^5.0"
45-
4639
- name: Install dependencies
4740
run: |
4841
composer update --no-interaction --prefer-dist
4942
5043
- name: Setup Mink test server
51-
# PHP 7.1 development web server segfaults if USE_ZEND_ALLOC not set to 0.
5244
run: |
5345
mkdir ./logs
54-
export USE_ZEND_ALLOC=0
5546
./vendor/bin/mink-test-server &> ./logs/mink-test-server.log &
5647
5748
- name: Start Selenium

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919
}
2020
],
2121
"require": {
22-
"php": ">=5.4",
23-
"behat/mink": "~1.7@dev",
24-
"instaclick/php-webdriver": "~1.1"
22+
"php": ">=7.2",
23+
"ext-json": "*",
24+
"behat/mink": "^1.9@dev",
25+
"instaclick/php-webdriver": "^1.4"
2526
},
2627
"require-dev": {
27-
"mink/driver-testsuite": "dev-master"
28+
"mink/driver-testsuite": "dev-master",
29+
"phpunit/phpunit": "^8.5.22 || ^9.5.11",
30+
"symfony/error-handler": "^4.4 || ^5.0"
2831
},
2932

3033
"autoload": {

phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@
3030
<directory>./src</directory>
3131
</whitelist>
3232
</filter>
33+
34+
<listeners>
35+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
36+
</listeners>
3337
</phpunit>

src/Selenium2Driver.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use WebDriver\Exception\StaleElementReference;
1818
use WebDriver\Exception\UnknownCommand;
1919
use WebDriver\Exception\UnknownError;
20-
use WebDriver\Exception;
2120
use WebDriver\Key;
2221
use WebDriver\WebDriver;
2322

@@ -416,7 +415,7 @@ public function back()
416415
*/
417416
public function switchToWindow($name = null)
418417
{
419-
$this->wdSession->focusWindow($name ? $name : '');
418+
$this->wdSession->focusWindow($name ?: '');
420419
}
421420

422421
/**
@@ -800,7 +799,7 @@ private function clickOnElement(Element $element)
800799
} catch (UnknownCommand $e) {
801800
// If the Webdriver implementation does not support moveto (which is not part of the W3C WebDriver spec), proceed to the click
802801
} catch (UnknownError $e) {
803-
// Chromium driver sends back UnknowError (WebDriver\Exception with code 13)
802+
// Chromium driver sends back UnknownError (WebDriver\Exception with code 13)
804803
}
805804

806805
$element->click();
@@ -1226,17 +1225,10 @@ private function uploadFile($path)
12261225
if (empty($remotePath)) {
12271226
throw new UnknownError();
12281227
}
1229-
} catch (\Exception $e) {
1230-
// Catch any error so we can still clean up the temporary archive.
1231-
}
1232-
1233-
unlink($tempFilename);
1234-
1235-
if (isset($e)) {
1236-
throw $e;
1228+
} finally {
1229+
unlink($tempFilename);
12371230
}
12381231

12391232
return $remotePath;
12401233
}
1241-
12421234
}

tests/Custom/DesiredCapabilitiesTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@
44

55
use Behat\Mink\Driver\Selenium2Driver;
66
use Behat\Mink\Tests\Driver\TestCase;
7-
use Yoast\PHPUnitPolyfills\Polyfills\AssertIsType;
8-
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
97

108
class DesiredCapabilitiesTest extends TestCase
119
{
12-
use AssertIsType;
13-
use ExpectException;
14-
1510
public function testGetDesiredCapabilities()
1611
{
1712
$caps = array(

tests/Custom/TimeoutTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
namespace Behat\Mink\Tests\Driver\Custom;
44

55
use Behat\Mink\Tests\Driver\TestCase;
6-
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
76

87
class TimeoutTest extends TestCase
98
{
10-
use ExpectException;
11-
129
/**
1310
* @after
1411
*/

tests/Custom/WindowNameTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
namespace Behat\Mink\Tests\Driver\Custom;
44

55
use Behat\Mink\Tests\Driver\TestCase;
6-
use Yoast\PHPUnitPolyfills\Polyfills\AssertIsType;
76

87
class WindowNameTest extends TestCase
98
{
10-
use AssertIsType;
11-
129
public function testWindowNames()
1310
{
1411
$session = $this->getSession();

0 commit comments

Comments
 (0)