Skip to content

Commit

Permalink
Merge d503c69 into 10cc2b6
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Mar 7, 2021
2 parents 10cc2b6 + d503c69 commit 1dd956b
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
- Show test duration in timeline tooltips.

### Changed
- Require PHP 7.3+ and Symfony 4 components.
- Update to namespaced PHPUnit 7.0.
- Require PHP 7.3+ and Symfony 5 components.
- Update to namespaced PHPUnit. Set minimal required version to PHPUnit 8.5.12.
- 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.
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"ondram/ci-detector": "^4.0",
"php-webdriver/webdriver": "^1.10.0",
"phpdocumentor/reflection-docblock": "^5.2",
"phpunit/phpunit": "^7.5.20",
"phpunit/phpunit": "^8.5.14",
"roave/better-reflection": "^4.3",
"symfony/console": "^5.2",
"symfony/event-dispatcher": "^5.2",
Expand All @@ -55,7 +55,6 @@
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^0.12.80",
"phpstan/phpstan-phpunit": "^0.12.17",
"phpunit/php-code-coverage": "^6.1",
"symfony/var-dumper": "^5.2"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Console/Command/RunCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ protected function getSeleniumAdapterMock()

$seleniumAdapterMock->expects($this->any())
->method('getLastError')
->willReturn(null);
->willReturn('');

$seleniumAdapterMock->expects($this->any())
->method('isSeleniumServer')
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Listener/SnapshotListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function provideTestWithDataSet(): array
$dummyException,
'FooBarTest',
'testFooBar',
0,
'0',
['foo', 'bar'],
'FooBarTest-testFooBar-with-data-set-0',
],
Expand Down
2 changes: 1 addition & 1 deletion src-tests/MockAbstractTestCaseWithNameTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Lmc\Steward;

use Lmc\Steward\Test\AbstractTestCase;
use PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount;

trait MockAbstractTestCaseWithNameTrait
{
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Process/ProcessSetCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function testShouldThrowExceptionIfAddingClassWithNameMismatchingTheFileN
$files = $this->findDummyTests('WrongClassTest.php', 'InvalidTests');

$this->expectException(RuntimeException::class);
$this->expectExceptionMessageRegExp(
$this->expectExceptionMessageMatches(
'/Error loading class "Lmc\\\\Steward\\\\Process\\\\Fixtures\\\\InvalidTests\\\\ReallyWrongClassTest"'
. ' from file ".*WrongClassTest.php"/'
);
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Publisher/AbstractCloudPublisherTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testShouldThrowExceptionIfPublishToApiFailed(): void
->willReturn('omg wtf');

$this->expectException(\RuntimeException::class);
$this->expectExceptionMessageRegExp(
$this->expectExceptionMessageMatches(
'/Error publishing results of test testBar to API "https:\/\/.*": omg wtf/'
);

Expand Down
2 changes: 1 addition & 1 deletion src-tests/Selenium/CapabilitiesResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testShouldResolveExtraDesiredCapabilitiesOnCiServer(): void
]
);

$ciMock = $this->createConfiguredMock(Jenkins::class, ['getBuildNumber' => 1337, 'getCiName' => 'Jenkins']);
$ciMock = $this->createConfiguredMock(Jenkins::class, ['getBuildNumber' => '1337', 'getCiName' => 'Jenkins']);
$ciDetectorMock = $this->createConfiguredMock(
CiDetector::class,
['isCiDetected' => true, 'detect' => $ciMock]
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Selenium/DownloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function testShouldThrowExceptionIfFileCannotBeDownloaded(): void
$this->mockGetHeadersToReturnHeader('HTTP/1.0 404 Not Found');

$this->expectException(\RuntimeException::class);
$this->expectExceptionMessageRegExp('/Error downloading file "[^"]+" \(HTTP\/1\.0 404 Not Found\)/');
$this->expectExceptionMessageMatches('/Error downloading file "[^"]+" \(HTTP\/1\.0 404 Not Found\)/');

$downloader->download();
}
Expand Down
2 changes: 1 addition & 1 deletion src-tests/Selenium/SeleniumServerAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function testShouldThrowExceptionWhenGettingCloudServiceNameButTheServerR
->willReturn('THIS IS NOT JSON');

$this->expectException(\RuntimeException::class);
$this->expectExceptionMessageRegExp(
$this->expectExceptionMessageMatches(
'/^Unable to connect to remote server: error parsing server JSON response \(.+\)$/'
);

Expand Down
4 changes: 2 additions & 2 deletions src-tests/Utils/Annotations/ClassParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testShouldThrowExceptionForMultipleClassesInOneFile(): void
$file = $this->createFileInfo('MultipleClassesInFile.php');

$this->expectException(RuntimeException::class);
$this->expectExceptionMessageRegExp(
$this->expectExceptionMessageMatches(
'/^File ".+MultipleClassesInFile.php" contains definition of 2 classes\./'
);
ClassParser::readClassNameFromFile($file);
Expand All @@ -37,7 +37,7 @@ public function testShouldThrowExceptionForNoClassInOneFile(): void
$file = $this->createFileInfo('NoClassInFile.php');

$this->expectException(RuntimeException::class);
$this->expectExceptionMessageRegExp('/^No class found in file ".+NoClassInFile.php"/');
$this->expectExceptionMessageMatches('/^No class found in file ".+NoClassInFile.php"/');
ClassParser::readClassNameFromFile($file);
}

Expand Down

0 comments on commit 1dd956b

Please sign in to comment.