From 4ff740ba07240bd65fa661376472da575d1c5d11 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Thu, 18 Jan 2024 15:27:29 +0100 Subject: [PATCH] Change line length to match code standard --- tests/BaseTestCase.php | 3 ++- tests/DataSubBlockTest.php | 8 ++++++-- tests/FrameBlockTest.php | 9 ++++++--- tests/ImageDataTest.php | 9 ++++++--- tests/TableBasedImageEncoderTest.php | 6 ++++-- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/tests/BaseTestCase.php b/tests/BaseTestCase.php index e3da1a5..29f2ea7 100644 --- a/tests/BaseTestCase.php +++ b/tests/BaseTestCase.php @@ -46,7 +46,8 @@ protected function getTestImageData(): ImageData { $data = new ImageData(); $data->setLzwMinCodeSize(5); - $data->addBlock(new DataSubBlock("\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02")); + $data->addBlock(new DataSubBlock("\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97" . + "\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02")); $data->addBlock(new DataSubBlock("\x01\x01\x01\x01")); $data->addBlock(new DataSubBlock("\x01\x01\x01")); diff --git a/tests/DataSubBlockTest.php b/tests/DataSubBlockTest.php index 933f279..d97de14 100644 --- a/tests/DataSubBlockTest.php +++ b/tests/DataSubBlockTest.php @@ -25,12 +25,16 @@ public function testEncode(): void $block = new DataSubBlock('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); $result = $block->encode(); - $this->assertEquals("\x40\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78", $result); + $this->assertEquals("\x40\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78" . + "\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78" . + "\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78", $result); } public function testDecode(): void { - $source = "\x40\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78"; + $source = "\x40\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78" . + "\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78" . + "\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78\x78"; $block = DataSubBlock::decode($this->getTestHandle($source)); $this->assertInstanceOf(DataSubBlock::class, $block); diff --git a/tests/FrameBlockTest.php b/tests/FrameBlockTest.php index 22f299c..da61a3c 100644 --- a/tests/FrameBlockTest.php +++ b/tests/FrameBlockTest.php @@ -25,7 +25,8 @@ public function testEncode(): void $frame->setImageData( (new ImageData()) ->setLzwMinCodeSize(5) - ->addBlock(new DataSubBlock("\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02")) + ->addBlock(new DataSubBlock("\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A" . + "\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02")) ->addBlock(new DataSubBlock("\x01\x01\x01\x01")) ->addBlock(new DataSubBlock("\x01\x01\x01")) ); @@ -34,7 +35,8 @@ public function testEncode(): void // image descriptor "\x2C\x0A\x00\x0A\x00\x0A\x00\x0A\x00\x00", // imagedata - "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00", + "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F" . + "\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00", ]); $this->assertEquals($result, $frame->encode()); } @@ -57,7 +59,8 @@ public function testDecode(): void // image descriptor "\x2C\x0A\x00\x0A\x00\x0A\x00\x0A\x00\x00", // imagedata - "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00", + "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F" . + "\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00", ]); $block = FrameBlock::decode($this->getTestHandle($source)); diff --git a/tests/ImageDataTest.php b/tests/ImageDataTest.php index 4c3febd..65ca044 100644 --- a/tests/ImageDataTest.php +++ b/tests/ImageDataTest.php @@ -23,17 +23,20 @@ public function testEncoder() { $data = new ImageData(); $data->setLzwMinCodeSize(5); - $data->addBlock(new DataSubBlock("\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02")); + $data->addBlock(new DataSubBlock("\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A" . + "\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02")); $data->addBlock(new DataSubBlock("\x01\x01\x01\x01")); $data->addBlock(new DataSubBlock("\x01\x01\x01")); - $result = "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00"; + $result = "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF" . + "\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00"; $this->assertEquals($result, $data->encode()); } public function testDecode() { - $source = "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00"; + $source = "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F" . + "\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00"; $data = ImageData::decode($this->getTestHandle($source)); $this->assertInstanceOf(ImageData::class, $data); $this->assertEquals(5, $data->getLzwMinCodeSize()); diff --git a/tests/TableBasedImageEncoderTest.php b/tests/TableBasedImageEncoderTest.php index b0c1d12..ade916c 100644 --- a/tests/TableBasedImageEncoderTest.php +++ b/tests/TableBasedImageEncoderTest.php @@ -28,14 +28,16 @@ public function testEncode(): void $tbi->setImageData((new ImageData()) ->setLzwMinCodeSize(5) - ->addBlock(new DataSubBlock("\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02")) + ->addBlock(new DataSubBlock("\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF" . + "\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02")) ->addBlock(new DataSubBlock("\x01\x01\x01\x01")) ->addBlock(new DataSubBlock("\x01\x01\x01"))); $result = implode('', [ "\x2C\x0A\x00\x0A\x00\x0A\x00\x0A\x00\x00", "\x00\x00\x00\xff\x00\x00\xff\xff\x00\xff\xff\xff", - "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00" + "\x05\x24\x20\x20\x8E\x64\x69\x9E\x51\xA0\x46\x67\xEB\xBE\x70\x2C\x97\xE9\x3A\xDF\x78\xAE\xDF\x4F\xD4" . + "\x40\x8F\x9B\x43\x15\x70\xF0\x7C\xC0\x9D\xB2\x15\x02\x04\x01\x01\x01\x01\x03\x01\x01\x01\x00" ]); $this->assertEquals($result, $tbi->encode());