Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
benpoulson committed Jan 10, 2024
1 parent cf767c9 commit 13ee0bb
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions tests/PerfDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,4 @@ public function testSetThrowsExceptionWhenPerformanceDataIsEmpty(): void
[]
);
}

/**
* @covers ::set
*/
public function testSetThrowsExceptionWhenFailsToCompressPerformanceData(): void
{
$model = $this->getMockBuilder(Model::class)->getMock();
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('Failed to compress performance data.');

$perfData = new class extends PerfData {
public function set($model, string $key, mixed $value, array $attributes)
{
// Make gzcompress return false to simulate a failure
$serialized = serialize($value);
return @gzcompress($serialized, -1); // Invalid level
}
};
$perfData->set(
$model,
'someKey',
['foo' => 'bar'],
[]
);
}
}

0 comments on commit 13ee0bb

Please sign in to comment.