Skip to content

Commit

Permalink
Merge pull request #256 from OndraM/feature/dependency-update
Browse files Browse the repository at this point in the history
Update dependencies and codestyle
  • Loading branch information
OndraM committed Nov 26, 2020
2 parents 1dea09a + 24372b2 commit 2628812
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 29 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
@@ -1,7 +1,6 @@
language: php

php:
- '7.1'
- '7.2'
- '7.3'
- '7.4'
Expand All @@ -16,7 +15,7 @@ env:
matrix:
include:
- name: 'Lowest dependencies'
php: 7.1
php: 7.2
env: dependencies="--prefer-lowest --prefer-stable"
- name: 'Codestyle and static analysis'
php: 7.4
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Expand Up @@ -8,9 +8,9 @@
- Show test duration in timeline tooltips.

### Changed
- Require PHP 7.1+ and Symfony 4 components.
- Require PHP 7.2+ and Symfony 4 components.
- Update to namespaced PHPUnit 7.0.
- Use php-webdriver 1.8 with W3C WebDriver support.
- Use php-webdriver 1.8+ with W3C WebDriver support.
- Methods now uses strict type-hints and return type-hints. Inherited classes and interfaces (eg. `CustomCapabilitiesResolverInterface`, `OptimizeOrderInterface` etc.) may require to be changed in accordance with this.
- Simplified and improved test output.
- `RunTestsProcessEvent` (dispatched from `run` command when initializing PHPUnit processes) now contains array of environment variables instead of ProcessBuilder. Use `setEnvironmentVars()` method to change the variables passed to the process.
Expand All @@ -25,7 +25,7 @@
- `--xdebug` option did not have any effect unless passed as the last option.
- Properly auto-detect port 443 (not 80) when https server URL is used as `--server-url`.
- Do not start browser for test skipped because it was depending on some already failed test (using `@depends` annotation).
- Parsing of latest Selenium server version in `install` command.
- Parsing of the latest Selenium server version in `install` command.

### Removed
- `TestUtils` class which was already deprecated in 2.1.
Expand Down
5 changes: 2 additions & 3 deletions README.md
@@ -1,11 +1,10 @@
# Steward: easy and robust testing with Selenium WebDriver + PHPUnit

[![Latest Stable Version](https://img.shields.io/packagist/v/lmc/steward.svg?style=flat-square)](https://packagist.org/packages/lmc/steward)
[![Travis Build Status](https://img.shields.io/travis/lmc-eu/steward.svg?style=flat-square)](https://travis-ci.org/lmc-eu/steward)
[![AppVeyor Build Status](https://img.shields.io/appveyor/ci/lmc-eu/steward.svg?style=flat-square)](https://ci.appveyor.com/project/lmc-eu/steward)
[![Travis Build Status](https://img.shields.io/travis/com/lmc-eu/steward/main.svg?style=flat-square&label=Travis)](https://travis-ci.com/github/lmc-eu/steward)
[![AppVeyor Build Status](https://img.shields.io/appveyor/ci/lmc-eu/steward/main.svg?style=flat-square&label=AppVeyor)](https://ci.appveyor.com/project/lmc-eu/steward)
[![Coverage Status](https://img.shields.io/coveralls/lmc-eu/steward/main.svg?style=flat-square)](https://coveralls.io/r/lmc-eu/steward?branch=main)
[![Total Downloads](https://img.shields.io/packagist/dt/lmc/steward.svg?style=flat-square)](https://packagist.org/packages/lmc/steward)
[![License](https://img.shields.io/packagist/l/lmc/steward.svg?style=flat-square)](https://packagist.org/packages/lmc/steward)

Steward is a set of libraries made to simplify writing and running robust functional system tests in
[PHPUnit](https://phpunit.de/) using [Selenium WebDriver](http://www.seleniumhq.org/).
Expand Down
20 changes: 13 additions & 7 deletions composer.json
Expand Up @@ -9,13 +9,17 @@
],
"license": "MIT",
"authors": [
{
"name": "Ondřej Machulda",
"email": "ondrej.machulda@gmail.com"
},
{
"name": "LMC s.r.o.",
"homepage": "https://github.com/lmc-eu"
}
],
"require": {
"php": "^7.1",
"php": "^7.2",
"ext-SimpleXML": "*",
"ext-curl": "*",
"ext-dom": "*",
Expand All @@ -31,7 +35,7 @@
"nette/reflection": "^2.4.2",
"ondram/ci-detector": "^3.1",
"php-webdriver/webdriver": "^1.8.1",
"phpunit/phpunit": "^7.4.4",
"phpunit/phpunit": "^7.5",
"symfony/console": "^4.0",
"symfony/event-dispatcher": "^4.0",
"symfony/filesystem": "^4.0",
Expand All @@ -44,12 +48,13 @@
},
"require-dev": {
"ergebnis/composer-normalize": "^2.2",
"jakub-onderka/php-parallel-lint": "^1.0.0",
"lmc/coding-standard": "^1.0.0",
"lmc/coding-standard": "^2.1",
"php-coveralls/php-coveralls": "^2.0",
"php-mock/php-mock-phpunit": "^2.1.2",
"phpstan/phpstan-phpunit": "^0.11.2",
"phpstan/phpstan-shim": "^0.11.19",
"php-parallel-lint/php-parallel-lint": "^1.0.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.11",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpunit/php-code-coverage": "^6.0",
"symfony/var-dumper": "^4.0"
},
Expand Down Expand Up @@ -91,12 +96,13 @@
"@test"
],
"analyze": [
"vendor/bin/phpstan.phar analyze -c phpstan.neon --ansi --level 4 ./src ./src-tests"
"vendor/bin/phpstan analyze -c phpstan.neon --ansi"
],
"codestyle:check": [
"vendor/bin/ecs check src/ src-tests/ --ansi"
],
"codestyle:fix": [
"@composer normalize",
"vendor/bin/ecs check src/ src-tests/ --ansi --fix"
],
"lint": [
Expand Down
7 changes: 5 additions & 2 deletions easy-coding-standard.yaml
@@ -1,11 +1,14 @@
imports:
- { resource: '%vendor_dir%/lmc/coding-standard/easy-coding-standard.yaml' }
- { resource: 'vendor/lmc/coding-standard/easy-coding-standard.yaml' }

parameters:
skip:
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff:
- 'src/bootstrap.php'
- 'src-tests/bootstrap.php'
- 'src-tests/ConfigHelper.php'
- 'src-tests/ConfigProviderTest.php'
- 'src/bootstrap.php'
- 'src/Component/Legacy.php'
- 'src/Listener/TestStartLogListener.php'
- 'src/Listener/TestStatusListener.php'
- 'src/Test/AbstractTestCase.php'
Expand Down
16 changes: 8 additions & 8 deletions phpstan.neon
@@ -1,20 +1,20 @@
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon

parameters:
ignoreErrors:
- '#Constructor of class .+ImplementsCapabilitiesResolverInterface has an unused parameter \$config#'
- '#Lmc\\Steward\\ConfigProviderHelper::__construct\(\) does not call parent constructor from Lmc\\Steward\\ConfigProvider#'
- '#Constructor of class Lmc\\Steward\\Selenium\\Fixtures\\CapabilitiesResolverFixture has an unused parameter \$config#'
- '#Call to an undefined method Lmc\\Steward\\Component\\Fixtures\\MockComponent::notExisting\(\)#'
- "#Property Lmc\\\\Steward\\\\Test\\\\AbstractTestCase::\\$wd \\(Facebook\\\\WebDriver\\\\Remote\\\\RemoteWebDriver\\) does not accept Lmc\\\\Steward\\\\WebDriver\\\\NullWebDriver#"
# PHPStan does not like the singleton methods
- "#Property Lmc\\\\Steward\\\\Listener\\\\WebDriverListener::\\$config \\(Lmc\\\\Steward\\\\ConfigProvider\\) does not accept object.#" # https://github.com/phpstan/phpstan/issues/1301
- "#^Offset [0-9]+ does not exist on array\\(\\).$#" # https://github.com/phpstan/phpstan-phpunit/issues/25
- message: '#should return .+ but return statement is missing#'
path: 'src/WebDriver/NullWebDriver.php'
- message: '#Variable \$e might not be defined.#'
path: 'src/Listener/WebDriverListener.php'
excludes_analyse:
- '%rootDir%/../../../src-tests/Process/Fixtures/InvalidTests/WrongClassTest.php'
- '%rootDir%/../../../src-tests/Test/SyntaxSugarTraitTest.php'
- '%rootDir%/../../../src-tests/ConfigProviderTest.php'
bootstrap: %rootDir%/../../../src-tests/bootstrap.php
bootstrapFiles:
- '%rootDir%/../../../src-tests/bootstrap.php'
level: 4
paths:
- src/
- src-tests/
2 changes: 1 addition & 1 deletion src-tests/Console/Command/InstallCommandTest.php
Expand Up @@ -261,7 +261,7 @@ public function testShouldDispatchEventsOnExecute(): void
* Get Downloader mock mocking isAlreadyDownloaded and download method to act like file is being downloaded
*
* @param int|bool $expectedFileSize
* @return Downloader|MockObject $downloaderMock
* @return Downloader|MockObject
*/
protected function getDownloadMock($expectedFileSize = 123): MockObject
{
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Selenium/DownloaderTest.php
Expand Up @@ -109,7 +109,7 @@ public function testShouldNotIncludeInvalidVersionsInAvailableVersions(): void
public function testShouldReadLatestVersionFromTheStorageUrl(): void
{
$latestVersion = Downloader::getLatestVersion();
$this->assertInternalType('string', $latestVersion);
$this->assertIsString($latestVersion);
$this->assertRegExp('/^\d+\.\d+\.\d+.*$/', $latestVersion);

$downloader = new Downloader(__DIR__ . '/Fixtures');
Expand Down
4 changes: 2 additions & 2 deletions src/Listener/TestStatusListener.php
Expand Up @@ -24,10 +24,10 @@ class TestStatusListener implements TestListener
{
use TestListenerDefaultImplementation;

/** @var AbstractPublisher[] $publishers */
/** @var AbstractPublisher[] */
protected $publishers = [];

/** @var \DateTimeInterface $startDate */
/** @var \DateTimeImmutable */
protected $startDate;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Listener/WebDriverListener.php
Expand Up @@ -120,6 +120,7 @@ public function endTest(Test $test, float $time): void
);

ob_start(); // Capture any output from commands bellow to make them appended to output of the test.

try {
// Workaround for PhantomJS 1.x - see https://github.com/detro/ghostdriver/issues/343
// Should be removed with PhantomJS 2
Expand Down

0 comments on commit 2628812

Please sign in to comment.