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

Fix test failures in 1.x #510

Merged
merged 8 commits into from
Jan 6, 2021
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: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM shivammathur/node:xenial

VOLUME [ "/opt/rollbar/rollbar-php" ]
WORKDIR /opt/rollbar/rollbar-php
ENTRYPOINT [ "/bin/bash" ]

RUN apt-get update \
&& apt-get install -y ca-certificates git vim tree

RUN spc --php-version "5.6" --extensions "curl" --coverage "xdebug"
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,29 @@
},

"require": {
"php": ">=5.5.0 <7.0",
"ext-curl": "*",
"psr/log": "^1",
"monolog/monolog": "^1"
},

"require-dev": {
"phpunit/phpunit": "4.8.*",
"mockery/mockery": "0.9.*",
"squizlabs/php_codesniffer": "2.*",
"codeclimate/php-test-reporter": "dev-master",
"packfire/php5.3-compat": "*",
"phpmd/phpmd" : "@stable"
"phpunit/phpunit": "4.8.36",
"mockery/mockery": "0.9.11",
"squizlabs/php_codesniffer": "^3",
"codeclimate/php-test-reporter": "^0.4",
"phpmd/phpmd" : "^2.9"
},

"suggest": {
"packfire/php5.3-compat": "for backward compatibility with PHP 5.3",
"fluent/logger": "Needed to use the 'fluent' handler for fluentd support"
},

"scripts": {
"docker-build": "docker build -t rollbar/rollbar-php:1 .",
"docker-run": "docker run -it -v \"${PWD}\":/opt/rollbar/rollbar-php rollbar/rollbar-php:1",
"test": [
"phpunit --coverage-clover build/logs/clover.xml --testsuite 'Rollbar Test Suite'",
"phpunit --coverage-clover build/logs/clover.xml --coverage-html build/logs/coverage --testsuite 'Rollbar Test Suite'",
"phpcs --standard=PSR1,PSR2 src tests"
],
"fix": "phpcbf --standard=PSR1,PSR2 src tests",
Expand Down
2 changes: 1 addition & 1 deletion src/DataBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ private function stripShutdownFrames($backTrace)
if ($fatalHandlerMethod ||
$fatalHandlerClassAndFunction ||
$errorHandlerMethod ||
$errorHandlerClassAndFunction ) {
$errorHandlerClassAndFunction) {
return array_slice($backTrace, $index+1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/RollbarHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* !!! DEPRECATED AS OF 8/4/2018 !!!
*
*
* Please, do not use this class anymore to use Rollbar with Monolog anymore.
* The Monolog library includes a dedicated handler now here:
* https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/RollbarHandler.php
Expand Down
5 changes: 4 additions & 1 deletion src/Senders/CurlSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public function send(EncodedPayload $payload, $accessToken)
curl_close($handle);

$data = $payload->data();
$uuid = $data['data']['uuid'];
$uuid = null;
if (isset($data['data']['uuid'])) {
$uuid = $data['data']['uuid'];
}

return new Response($statusCode, $result, $uuid);
}
Expand Down
95 changes: 0 additions & 95 deletions tests/Monolog/Handler/RollbarHandlerTest.php

This file was deleted.

3 changes: 2 additions & 1 deletion tests/Truncation/TruncationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public function truncateProvider()
$frames[$key] = $stringValue;
}

$frames = &$framesTestData['truncate middle using trace_chain key'][0]['data']['body']['trace_chain']['frames'];
$frames_body = &$framesTestData['truncate middle using trace_chain key'][0]['data']['body'];
$frames = $frames_body['trace_chain'][0]['frames'];
foreach ($frames as $key => $data) {
$frames[$key] = $stringValue;
}
Expand Down
14 changes: 0 additions & 14 deletions tests/VerboseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ public function testRollbarConfigInternalCheckIgnoredShouldSuppress()
$errorReporting = \error_reporting();

$this->configurableObjectVerbosityTest(

$config,
function () use ($config) {
// logic under test
Expand Down Expand Up @@ -401,7 +400,6 @@ public function testRollbarConfigInternalCheckIgnoredLevelTooLow()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config) {
// logic under test
Expand Down Expand Up @@ -436,7 +434,6 @@ public function testRollbarConfigShouldIgnoreErrorErrorReporting()
$errorReporting = \error_reporting();

$this->configurableObjectVerbosityTest(

$config,
function () use ($config) {
// logic under test
Expand Down Expand Up @@ -478,7 +475,6 @@ public function testRollbarConfigShouldIgnoreErrorIncludedErrno()
$errorReporting = \error_reporting();

$this->configurableObjectVerbosityTest(

$config,
function () use ($config) {
// logic under test
Expand Down Expand Up @@ -521,7 +517,6 @@ public function testRollbarConfigShouldIgnoreErrorErrorSampleRates()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config) {
// logic under test
Expand Down Expand Up @@ -556,7 +551,6 @@ public function testRollbarConfigShouldIgnoreException()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config) {
// logic under test
Expand Down Expand Up @@ -591,7 +585,6 @@ public function testRollbarConfigCheckIgnored()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config, $unitTest) {
// logic under test
Expand Down Expand Up @@ -639,7 +632,6 @@ public function testRollbarConfigCheckIgnoredException()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config, $unitTest) {
// logic under test
Expand Down Expand Up @@ -674,7 +666,6 @@ public function testRollbarConfigCheckIgnoredPayloadLevelTooLow()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config, $unitTest) {
// logic under test
Expand Down Expand Up @@ -712,7 +703,6 @@ public function testRollbarConfigCheckIgnoredFilter()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config, $unitTest) {
// logic under test
Expand Down Expand Up @@ -747,7 +737,6 @@ public function testRollbarConfigSendTransmit()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config, $unitTest) {
// logic under test
Expand Down Expand Up @@ -782,7 +771,6 @@ public function testRollbarConfigSendBatchTransmit()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config) {
// logic under test
Expand Down Expand Up @@ -817,7 +805,6 @@ public function testRollbarConfigHandleResponse()
));

$this->configurableObjectVerbosityTest(

$config,
function () use ($config, $unitTest) {
// logic under test
Expand Down Expand Up @@ -855,7 +842,6 @@ public function testRollbarTruncation()
));

$this->configurableObjectVerbosityTest(

$rollbarLogger,
function () use ($rollbarLogger) {
// logic under test
Expand Down