Skip to content
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
6 changes: 2 additions & 4 deletions tests/Performance/MassivePayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

use Rollbar\Truncation\StringsStrategyTest;
use Rollbar\Truncation\FramesStrategyTest;

use Rollbar\Truncation\StringsStrategy;

class MassivePayload
{

public function executeProvider()
public function executeProvider(): array
{
$framesTest = new FramesStrategyTest();

Expand All @@ -25,7 +23,7 @@ public function executeProvider()
return $data;
}

public function generateStringData()
public function generateStringData(): array
{
$stringsTest = new StringsStrategyTest();

Expand Down
20 changes: 5 additions & 15 deletions tests/Performance/TestHelpers/Truncation.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php namespace Rollbar\Performance\TestHelpers;
<?php
namespace Rollbar\Performance\TestHelpers;

class Truncation extends \Rollbar\Truncation\Truncation
{
protected $memoryUsage = 0;
protected $timeUsage = 0;
protected $payloadSize = 0;
protected float $memoryUsage = 0;
protected float $timeUsage = 0;
protected float $payloadSize = 0;
protected string $lastRunOutput = "";
protected array $strategiesUsed = array();

Expand Down Expand Up @@ -33,17 +34,6 @@ public function truncate(\Rollbar\Payload\EncodedPayload $payload): \Rollbar\Pay
return $result;
}

public function needsTruncating(\Rollbar\Payload\EncodedPayload $payload, $strategy): bool
{
$result = parent::needsTruncating($payload, $strategy);

if ($result) {
$this->strategiesUsed []= is_string($strategy) ? $strategy : get_class($strategy);
}

return $result;
}

public function getLastRun(): string
{
return $this->lastRunOutput;
Expand Down
6 changes: 2 additions & 4 deletions tests/Performance/TruncationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@

namespace Rollbar\Performance;

use Rollbar\Performance\MassivePayload;
use Rollbar\Performance\TestHelpers\Truncation;
use Rollbar\Performance\TestHelpers\EncodedPayload;

use Rollbar\Truncation\StringsStrategyTest;
use Rollbar\Truncation\FramesStrategyTest;
use Rollbar\Truncation\MinBodyStrategyTest;

use Rollbar\Config;
use Rollbar\BaseRollbarTest;

class TruncationTest extends BaseRollbarTest
{

private Truncation $truncate;

public function setUp(): void
{
$config = new Config(array('access_token' => $this->getTestAccessToken()));
Expand Down