From ff3ae6e37143bfb716aa7bd482f38fd6c3d0b083 Mon Sep 17 00:00:00 2001 From: CSchlipp Date: Sat, 23 Sep 2023 15:25:23 +0200 Subject: [PATCH 1/3] Add PrintOptions Command --- src/Command/PrintOptions.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/Command/PrintOptions.php diff --git a/src/Command/PrintOptions.php b/src/Command/PrintOptions.php new file mode 100644 index 0000000..e876f31 --- /dev/null +++ b/src/Command/PrintOptions.php @@ -0,0 +1,29 @@ + GNU nano 4.8 test/vendor/ramytalal/label-printer/src/Command/PrintOptions.php +optimizeQuality = $optimizeQuality; + } + + /** + * @inheritdoc + */ + public function read() + { + return '^QS' . ($this->optimizeQuality ? '1' : '0'); + } +} + From a680995e63c86c8f96c506f5d339ddff34b52368 Mon Sep 17 00:00:00 2001 From: CSchlipp Date: Sat, 23 Sep 2023 15:29:41 +0200 Subject: [PATCH 2/3] Fix c&p error --- src/Command/PrintOptions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Command/PrintOptions.php b/src/Command/PrintOptions.php index e876f31..139f1a5 100644 --- a/src/Command/PrintOptions.php +++ b/src/Command/PrintOptions.php @@ -1,4 +1,3 @@ - GNU nano 4.8 test/vendor/ramytalal/label-printer/src/Command/PrintOptions.php Date: Sat, 23 Sep 2023 16:02:18 +0200 Subject: [PATCH 3/3] Add test for PrintOptions --- tests/Command/PrintOptionsTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/Command/PrintOptionsTest.php diff --git a/tests/Command/PrintOptionsTest.php b/tests/Command/PrintOptionsTest.php new file mode 100644 index 0000000..7911f49 --- /dev/null +++ b/tests/Command/PrintOptionsTest.php @@ -0,0 +1,20 @@ +assertEquals('5e515331', bin2hex($command->read())); + } + + public function testDisabled() + { + $command = new Command\PrintOptions(false); + + $this->assertEquals('5e515330', bin2hex($command->read())); + } +}