From 1c8b76330e52fd4559c77d9271470f2d3317d95e Mon Sep 17 00:00:00 2001 From: Patrick Organ Date: Sat, 22 Jun 2024 10:43:34 -0400 Subject: [PATCH] update unit tests --- tests/Unit/ResourceLimitsTest.php | 36 +++++++++---------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/tests/Unit/ResourceLimitsTest.php b/tests/Unit/ResourceLimitsTest.php index 52c38f7..84a0864 100644 --- a/tests/Unit/ResourceLimitsTest.php +++ b/tests/Unit/ResourceLimitsTest.php @@ -5,56 +5,40 @@ it('sets the area resource limit', function () { $pdf = new Pdf($this->testFile); - $im = $pdf->resourceLimit(ResourceLimitType::Area, 1024 * 1024 * 16) + $im = $pdf->resourceLimit(ResourceLimitType::Area, 1024 * 1024 * 128) ->getImageData($this->testFile, 1); - expect((int) $im::getResourceLimit(ResourceLimitType::Area->value))->toBe((int) 1024 * 1024 * 16); + expect((int) $im::getResourceLimit(ResourceLimitType::Area->value))->toBe((int) 1024 * 1024 * 128); }); it('sets the disk resource limit', function () { $pdf = new Pdf($this->testFile); - $im = $pdf->resourceLimit(ResourceLimitType::Disk, 1024 * 1024) + $im = $pdf->resourceLimit(ResourceLimitType::Disk, 1024 * 1024 * 128) ->getImageData($this->testFile, 1); - expect((int) $im::getResourceLimit(ResourceLimitType::Disk->value))->toBe((int) 1024 * 1024); -}); - -it('sets the file resource limit', function () { - $pdf = new Pdf($this->testFile); - $im = $pdf->resourceLimit(ResourceLimitType::File, 5) - ->getImageData($this->testFile, 1); - - expect((int) $im::getResourceLimit(ResourceLimitType::File->value))->toBe((int) 5); + expect((int) $im::getResourceLimit(ResourceLimitType::Disk->value))->toBe((int) 1024 * 1024 * 128); }); it('sets the map resource limit', function () { $pdf = new Pdf($this->testFile); - $im = $pdf->resourceLimit(ResourceLimitType::Map, 1024 * 1024 * 16) + $im = $pdf->resourceLimit(ResourceLimitType::Map, 1024 * 1024 * 128) ->getImageData($this->testFile, 1); - expect((int) $im::getResourceLimit(ResourceLimitType::Map->value))->toBe((int) 1024 * 1024 * 16); + expect((int) $im::getResourceLimit(ResourceLimitType::Map->value))->toBe((int) 1024 * 1024 * 128); }); it('sets the memory resource limit', function () { $pdf = new Pdf($this->testFile); - $im = $pdf->resourceLimit(ResourceLimitType::Memory, 1024 * 1024 * 32) + $im = $pdf->resourceLimit(ResourceLimitType::Memory, 1024 * 1024 * 128) ->getImageData($this->testFile, 1); - expect((int) $im::getResourceLimit(ResourceLimitType::Memory->value))->toBe((int) 1024 * 1024 * 32); + expect((int) $im::getResourceLimit(ResourceLimitType::Memory->value))->toBe((int) 1024 * 1024 * 128); }); it('sets the time resource limit', function () { $pdf = new Pdf($this->testFile); - $im = $pdf->resourceLimit(ResourceLimitType::Time, 10) - ->getImageData($this->testFile, 1); - - expect((int) $im::getResourceLimit(ResourceLimitType::Time->value))->toBe((int) 10); -}); - -it('sets the throttle resource limit', function () { - $pdf = new Pdf($this->testFile); - $im = $pdf->resourceLimit(ResourceLimitType::Throttle, 10) + $im = $pdf->resourceLimit(ResourceLimitType::Time, 30) ->getImageData($this->testFile, 1); - expect((int) $im::getResourceLimit(ResourceLimitType::Throttle->value))->toBe((int) 10); + expect((int) $im::getResourceLimit(ResourceLimitType::Time->value))->toBe((int) 30); });