From 9399629c6eed79da4be18fd22adf83ef36c2d2e0 Mon Sep 17 00:00:00 2001 From: volkovs Date: Thu, 25 Oct 2018 15:03:54 +0300 Subject: [PATCH] update phpunit (fixes #40, via #39) --- composer.json | 4 ++-- src/Yandex/Allure/Adapter/AllureAdapter.php | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index bcc0406..b9f6388 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,8 @@ "source": "https://github.com/allure-framework/allure-phpunit" }, "require": { - "php": ">=7.0.0", - "phpunit/phpunit": ">=6.0.0", + "php": ">=7.1.0", + "phpunit/phpunit": ">=7.0.0", "mikey179/vfsStream": "1.*", "allure-framework/allure-php-api": "~1.1.0" }, diff --git a/src/Yandex/Allure/Adapter/AllureAdapter.php b/src/Yandex/Allure/Adapter/AllureAdapter.php index d038bab..e39dd44 100644 --- a/src/Yandex/Allure/Adapter/AllureAdapter.php +++ b/src/Yandex/Allure/Adapter/AllureAdapter.php @@ -90,7 +90,7 @@ public function prepareOutputDirectory($outputDirectory, $deletePreviousResults) * @param Exception $e * @param float $time */ - public function addError(Test $test, Exception $e, $time) + public function addError(Test $test, \Throwable $e, float $time): void { $event = new TestCaseBrokenEvent(); Allure::lifecycle()->fire($event->withException($e)->withMessage($e->getMessage())); @@ -103,7 +103,7 @@ public function addError(Test $test, Exception $e, $time) * @param \PHPUnit\Framework\Warning $e * @param float $time */ - public function addWarning(Test $test, Warning $e, $time) + public function addWarning(Test $test, Warning $e, float $time): void { // TODO: Implement addWarning() method. } @@ -115,7 +115,7 @@ public function addWarning(Test $test, Warning $e, $time) * @param AssertionFailedError $e * @param float $time */ - public function addFailure(Test $test, AssertionFailedError $e, $time) + public function addFailure(Test $test, AssertionFailedError $e, float $time): void { $event = new TestCaseFailedEvent(); @@ -139,7 +139,7 @@ public function addFailure(Test $test, AssertionFailedError $e, $time) * @param Exception $e * @param float $time */ - public function addIncompleteTest(Test $test, Exception $e, $time) + public function addIncompleteTest(Test $test, \Throwable $e, float $time): void { $event = new TestCasePendingEvent(); Allure::lifecycle()->fire($event->withException($e)); @@ -153,7 +153,7 @@ public function addIncompleteTest(Test $test, Exception $e, $time) * @param float $time * @since Method available since Release 4.0.0 */ - public function addRiskyTest(Test $test, Exception $e, $time) + public function addRiskyTest(Test $test, \Throwable $e, float $time): void { $this->addIncompleteTest($test, $e, $time); } @@ -166,7 +166,7 @@ public function addRiskyTest(Test $test, Exception $e, $time) * @param float $time * @since Method available since Release 3.0.0 */ - public function addSkippedTest(Test $test, Exception $e, $time) + public function addSkippedTest(Test $test, \Throwable $e, float $time): void { $shouldCreateStartStopEvents = false; if ($test instanceof TestCase){ @@ -191,7 +191,7 @@ public function addSkippedTest(Test $test, Exception $e, $time) * @param TestSuite $suite * @since Method available since Release 2.2.0 */ - public function startTestSuite(TestSuite $suite) + public function startTestSuite(TestSuite $suite): void { if ($suite instanceof DataProviderTestSuite) { return; @@ -218,7 +218,7 @@ public function startTestSuite(TestSuite $suite) * @param TestSuite $suite * @since Method available since Release 2.2.0 */ - public function endTestSuite(TestSuite $suite) + public function endTestSuite(TestSuite $suite): void { if ($suite instanceof DataProviderTestSuite) { return; @@ -232,7 +232,7 @@ public function endTestSuite(TestSuite $suite) * * @param Test $test */ - public function startTest(Test $test) + public function startTest(Test $test): void { if ($test instanceof TestCase) { $testName = $test->getName(); @@ -256,7 +256,7 @@ public function startTest(Test $test) * @param float $time * @throws \Exception */ - public function endTest(Test $test, $time) + public function endTest(Test $test, float $time): void { if ($test instanceof TestCase) { Allure::lifecycle()->fire(new TestCaseFinishedEvent());