Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dependencies) Add Laravel 6 support #31

Merged
merged 1 commit into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
]
},
"require": {
"laravel/framework": "~5.3"
"laravel/framework": "~6.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support for Laravel 6

},
"require-dev": {
"mockery/mockery": "0.9.*",
"orchestra/testbench": "~3.1",
"phpunit/phpunit": "~4.7",
"satooshi/php-coveralls": "dev-master@dev",
"mockery/mockery": "1.3.*",
"orchestra/testbench": "4.*",
"phpunit/phpunit": "~8.0",
Comment on lines +17 to +19
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update dependencies to meet Laravel 6 needs

"php-coveralls/php-coveralls": "2.2.*",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

satooshi/php-coveralls is depreceted so replaced by the suggested replacement which worked out fine

"bugsnag/bugsnag-laravel": "^2.4"
},
"suggest": {
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntaxCheck is unrecognized on phpUnit 8

stopOnFailure="false">
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
Expand Down
21 changes: 9 additions & 12 deletions tests/ExceptionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function format(JsonResponse $response, Exception $e, array $reporterResp

class ExceptionHandlerTest extends TestCase {

public function setUp()
public function setUp() :void
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Match declaration of TestCase with PHPUnit 8

{
parent::setUp();

Expand Down Expand Up @@ -124,10 +124,9 @@ public function testReportInvalidReporterClass()

$property->setValue($handler, $config);

$this->setExpectedException(
\InvalidArgumentException::class,
'invalid: stdClass is not a valid reporter class.'
);
$this->expectException(\InvalidArgumentException::class);

$this->expectExceptionMessage('invalid: stdClass is not a valid reporter class.');
Comment on lines +127 to +129
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setExpectedException is no longer supported on phpUnit 8, so replaced by the equivalent code


$reflectionHandler->getMethod('report')
->invoke($handler, $exception);
Expand Down Expand Up @@ -156,13 +155,11 @@ public function testInvalidFormatterClass()

$property->setValue($handler, $config);

$this->setExpectedException(
\InvalidArgumentException::class,
sprintf(
"% is not a valid formatter class.",
get_class($formatter)
)
);
Comment on lines -159 to -165
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setExpectedException is no longer supported in phpUnit 8, so replaced by equivalent code

$this->expectException(\InvalidArgumentException::class);

$exceptionMessage = sprintf("% is not a valid formatter class.", get_class($formatter));

$this->expectExceptionMessage($exceptionMessage);

$method = $reflectionHandler->getMethod('generateExceptionResponse');

Expand Down
2 changes: 1 addition & 1 deletion tests/Formatters/ExceptionFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class ExceptionFormatterTest extends TestCase
{

public function setUp()
public function setUp() :void
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Match setUp declaration for phpUnit 8

{
parent::setUp();

Expand Down
6 changes: 3 additions & 3 deletions tests/Reporters/BugsnagReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ class BugsnagReporterTest extends TestCase

protected $client;

public function setUp()
public function setUp() :void
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Match setUp declaration for phpUnit 8

{
parent::setUp();

$this->client = $this->getMockBuilder(stdClass::class)
->setMethods(['notifyException'])
->getMock();

$this->app->instance(Client::class, $this->client);

$this->bugsnagReporter = new BugsnagReporter([]);
}

Expand Down