From 15d2b5f7dd2b1c8aaeae903622cfa58337c3fcdf Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 25 Dec 2018 16:17:19 +0100 Subject: [PATCH] Implement more unit tests --- .../Database/DatabaseExceptionFactory.php | 4 +- Event/EventManager.php | 8 +- Router/Router.php | 7 +- Utils/Barcode/C128Abstract.php | 10 +- Utils/Barcode/C25.php | 6 +- Utils/Barcode/OrientationType.php | 2 +- Utils/TestUtils.php | 16 +- tests/Event/EventManagerTest.php | 11 ++ tests/Event/events.php | 13 ++ tests/Utils/Barcode/C128AbstractTest.php | 57 ++++++ tests/Utils/Barcode/C128aTest.php | 30 ++- tests/Utils/Barcode/C128bTest.php | 30 ++- tests/Utils/Barcode/C128cTest.php | 30 ++- tests/Utils/Barcode/C25Test.php | 38 +++- tests/Utils/Barcode/C39Test.php | 30 ++- tests/Utils/Barcode/CodebarTest.php | 30 ++- tests/Utils/Barcode/c128a.jpg | Bin 0 -> 3001 bytes tests/Utils/Barcode/c128a.png | Bin 156 -> 156 bytes tests/Utils/Barcode/c128a_vertical.png | Bin 0 -> 197 bytes tests/Utils/Barcode/c128b.jpg | Bin 0 -> 3115 bytes tests/Utils/Barcode/c128b.png | Bin 157 -> 155 bytes tests/Utils/Barcode/c128b_vertical.png | Bin 0 -> 204 bytes tests/Utils/Barcode/c128c.jpg | Bin 0 -> 1541 bytes tests/Utils/Barcode/c128c.png | Bin 127 -> 129 bytes tests/Utils/Barcode/c128c_vertical.png | Bin 0 -> 153 bytes tests/Utils/Barcode/c25.jpg | Bin 0 -> 1878 bytes tests/Utils/Barcode/c25.png | Bin 135 -> 134 bytes tests/Utils/Barcode/c25_vertical.png | Bin 0 -> 150 bytes tests/Utils/Barcode/c39.jpg | Bin 0 -> 2865 bytes tests/Utils/Barcode/c39.png | Bin 153 -> 153 bytes tests/Utils/Barcode/c39_vertical.png | Bin 0 -> 180 bytes tests/Utils/Barcode/ccodebar_vertical.png | Bin 0 -> 147 bytes tests/Utils/Barcode/codebar.jpg | Bin 0 -> 1676 bytes tests/Utils/Barcode/codebar.png | Bin 131 -> 131 bytes tests/Utils/Converter/MeasurementTest.php | 176 ++++++++++++++++++ tests/Utils/TestUtilsClass.php | 22 +++ tests/Utils/TestUtilsTest.php | 19 +- 37 files changed, 487 insertions(+), 52 deletions(-) create mode 100644 tests/Event/events.php create mode 100644 tests/Utils/Barcode/C128AbstractTest.php create mode 100644 tests/Utils/Barcode/c128a.jpg create mode 100644 tests/Utils/Barcode/c128a_vertical.png create mode 100644 tests/Utils/Barcode/c128b.jpg create mode 100644 tests/Utils/Barcode/c128b_vertical.png create mode 100644 tests/Utils/Barcode/c128c.jpg create mode 100644 tests/Utils/Barcode/c128c_vertical.png create mode 100644 tests/Utils/Barcode/c25.jpg create mode 100644 tests/Utils/Barcode/c25_vertical.png create mode 100644 tests/Utils/Barcode/c39.jpg create mode 100644 tests/Utils/Barcode/c39_vertical.png create mode 100644 tests/Utils/Barcode/ccodebar_vertical.png create mode 100644 tests/Utils/Barcode/codebar.jpg create mode 100644 tests/Utils/TestUtilsClass.php diff --git a/DataStorage/Database/DatabaseExceptionFactory.php b/DataStorage/Database/DatabaseExceptionFactory.php index eb4e35ceb..b500edb6e 100644 --- a/DataStorage/Database/DatabaseExceptionFactory.php +++ b/DataStorage/Database/DatabaseExceptionFactory.php @@ -27,7 +27,7 @@ use phpOMS\DataStorage\Database\Schema\Exception\TableException; class DatabaseExceptionFactory { /** - * Constructor. + * Create exception class string based on exception. * * @param \PDOException $e Exception * @@ -46,7 +46,7 @@ class DatabaseExceptionFactory } /** - * Constructor. + * Create exception message based on exception. * * @param \PDOException $e Exception * diff --git a/Event/EventManager.php b/Event/EventManager.php index 735f121bb..68da33bf4 100644 --- a/Event/EventManager.php +++ b/Event/EventManager.php @@ -62,13 +62,9 @@ final class EventManager public function __construct(Dispatcher $dispatcher = null) { $this->dispatcher = $dispatcher ?? new class { - public function dispatch($func, $data) + public function dispatch($func, ...$data) { - if (\is_array($data)) { - $func(...$data); - } else { - $func($data); - } + $func(...$data); } }; } diff --git a/Router/Router.php b/Router/Router.php index 8c6ef1af7..1a2458b69 100644 --- a/Router/Router.php +++ b/Router/Router.php @@ -95,11 +95,8 @@ final class Router foreach ($this->routes as $route => $destination) { foreach ($destination as $d) { if ($this->match($route, $d['verb'], $request, $verb)) { - if (!isset($d['permission']) - || !isset($account) - || (isset($d['permission']) - && isset($account) - && $account->hasPermission($d['permission']['type'], $orgId, $app, $d['permission']['module'], $d['permission']['state'])) + if (!isset($d['permission'], $account) + || $account->hasPermission($d['permission']['type'], $orgId, $app, $d['permission']['module'], $d['permission']['state']) ) { $bound[] = ['dest' => $d['dest']]; } else { diff --git a/Utils/Barcode/C128Abstract.php b/Utils/Barcode/C128Abstract.php index 938bdf11c..9db537a9a 100644 --- a/Utils/Barcode/C128Abstract.php +++ b/Utils/Barcode/C128Abstract.php @@ -129,7 +129,7 @@ abstract class C128Abstract */ public function __construct(string $content = '', int $width = 100, int $height = 20, int $orientation = OrientationType::HORIZONTAL) { - $this->content = $content; + $this->setContent($content); $this->setDimension($width, $height); $this->setOrientation($orientation); } @@ -345,7 +345,7 @@ abstract class C128Abstract $location + $this->margin, 0 + $this->margin, $cur_size + $this->margin, - $dimensions['height'] - $this->margin, + $dimensions['height'] - $this->margin - 1, ($position % 2 == 0 ? $white : $black) ); } else { @@ -353,7 +353,7 @@ abstract class C128Abstract $image, 0 + $this->margin, $location + $this->margin, - $dimensions['width'] - $this->margin, + $dimensions['width'] - $this->margin - 1, $cur_size + $this->margin, ($position % 2 == 0 ? $white : $black) ); @@ -401,11 +401,11 @@ abstract class C128Abstract $dimensions = ['width' => 0, 'height' => 0]; if ($this->orientation === OrientationType::HORIZONTAL) { - $dimensions['width'] = $codeLength + $this->margin * 2; + $dimensions['width'] = $codeLength + $this->margin * 2 + 1; $dimensions['height'] = $this->dimension['height']; } else { $dimensions['width'] = $this->dimension['width']; - $dimensions['height'] = $codeLength + $this->margin; + $dimensions['height'] = $codeLength + $this->margin * 2 + 1; } return $dimensions; diff --git a/Utils/Barcode/C25.php b/Utils/Barcode/C25.php index 0a8ac763f..440edb6bd 100644 --- a/Utils/Barcode/C25.php +++ b/Utils/Barcode/C25.php @@ -74,10 +74,6 @@ class C25 extends C128Abstract */ public function __construct(string $content = '', int $width = 100, int $height = 20, int $orientation = OrientationType::HORIZONTAL) { - if (!ctype_digit($content)) { - throw new \InvalidArgumentException($content); - } - parent::__construct($content, $width, $height, $orientation); } @@ -92,7 +88,7 @@ class C25 extends C128Abstract */ public function setContent(string $content) : void { - if (!ctype_digit($content)) { + if (!\ctype_digit($content)) { throw new \InvalidArgumentException($content); } diff --git a/Utils/Barcode/OrientationType.php b/Utils/Barcode/OrientationType.php index a47dd3982..ae6bbc454 100644 --- a/Utils/Barcode/OrientationType.php +++ b/Utils/Barcode/OrientationType.php @@ -17,7 +17,7 @@ namespace phpOMS\Utils\Barcode; use phpOMS\Stdlib\Base\Enum; /** - * Account type enum. + * Orientation type enum. * * @package phpOMS\Utils\Barcode * @license OMS License 1.0 diff --git a/Utils/TestUtils.php b/Utils/TestUtils.php index ef17ce2e3..42774c520 100644 --- a/Utils/TestUtils.php +++ b/Utils/TestUtils.php @@ -40,17 +40,17 @@ final class TestUtils /** * Set private object member * - * @param object|string $obj Object to modify - * @param string $name Member name to modify - * @param mixed $value Value to set + * @param object $obj Object to modify + * @param string $name Member name to modify + * @param mixed $value Value to set * * @return bool The function returns true after setting the member * * @since 1.0.0 */ - public static function setMember($obj, string $name, $value) : bool + public static function setMember(object $obj, string $name, $value) : bool { - $reflectionClass = new \ReflectionClass(\is_string($obj) ? $obj : \get_class($obj)); + $reflectionClass = new \ReflectionClass(\get_class($obj)); if (!$reflectionClass->hasProperty($name)) { return false; @@ -62,11 +62,7 @@ final class TestUtils $reflectionProperty->setAccessible(true); } - if (\is_string($obj)) { - $reflectionProperty->setValue($value); - } elseif (\is_object($obj)) { - $reflectionProperty->setValue($obj, $value); - } + $reflectionProperty->setValue($obj, $value); if (!$accessible) { $reflectionProperty->setAccessible(false); diff --git a/tests/Event/EventManagerTest.php b/tests/Event/EventManagerTest.php index 832c8567a..76f1cf76d 100644 --- a/tests/Event/EventManagerTest.php +++ b/tests/Event/EventManagerTest.php @@ -84,4 +84,15 @@ class EventManagerTest extends \PHPUnit\Framework\TestCase $event->trigger('group1'); self::assertEquals(1, $event->count()); } + + public function testImportEvents() + { + $event = new EventManager(); + self::assertFalse($event->importFromFile(__DIR__ . '/invalid.php')); + self::assertTrue($event->importFromFile(__DIR__ . '/events.php')); + + self::assertEquals(2, $event->count()); + self::assertTrue($event->trigger('SomeName1', '', [1, 2, 3])); + self::assertTrue($event->trigger('SomeName2', '', 4)); + } } diff --git a/tests/Event/events.php b/tests/Event/events.php new file mode 100644 index 000000000..81866c287 --- /dev/null +++ b/tests/Event/events.php @@ -0,0 +1,13 @@ + [ + 'callback' => [ + 0 => function($v1, $v2, $v3) {}, + 1 => function($v1, $v2, $v3) {}, + ], + ], + 'SomeName2' => [ + 'callback' => [ + 0 => function($v4) {}, + ], + ], +]; \ No newline at end of file diff --git a/tests/Utils/Barcode/C128AbstractTest.php b/tests/Utils/Barcode/C128AbstractTest.php new file mode 100644 index 000000000..0cbd5b995 --- /dev/null +++ b/tests/Utils/Barcode/C128AbstractTest.php @@ -0,0 +1,57 @@ +obj = new class extends C128Abstract {}; + } + + public function testSetGet() + { + $this->obj->setContent('abc'); + self::assertEquals('abc', $this->obj->getContent()); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testInvalidDimensionWidth() + { + $this->obj->setDimension(-2, 1); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testInvalidDimensionHeight() + { + $this->obj->setDimension(1, -2); + } + + /** + * @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue + */ + public function testInvalidOrientation() + { + $this->obj->setOrientation(99); + } +} diff --git a/tests/Utils/Barcode/C128aTest.php b/tests/Utils/Barcode/C128aTest.php index 378eae3f4..1a9499812 100644 --- a/tests/Utils/Barcode/C128aTest.php +++ b/tests/Utils/Barcode/C128aTest.php @@ -14,6 +14,7 @@ namespace phpOMS\tests\Utils\Barcode; use phpOMS\Utils\Barcode\C128a; +use phpOMS\Utils\Barcode\OrientationType; class C128aTest extends \PHPUnit\Framework\TestCase { @@ -26,7 +27,7 @@ class C128aTest extends \PHPUnit\Framework\TestCase } } - public function testImage() + public function testImagePng() { $path = __DIR__ . '/c128a.png'; if (\file_exists($path)) { @@ -39,6 +40,33 @@ class C128aTest extends \PHPUnit\Framework\TestCase self::assertTrue(\file_exists($path)); } + public function testImageJpg() + { + $path = __DIR__ . '/c128a.jpg'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C128a('ABCDEFG0123()+-', 200, 50); + $img->saveToJpgFile($path); + + self::assertTrue(\file_exists($path)); + } + + public function testOrientationAndMargin() + { + $path = __DIR__ . '/c128a_vertical.png'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C128a('ABCDEFG0123()+-', 50, 200, OrientationType::VERTICAL); + $img->setMargin(2); + $img->saveToPngFile($path); + + self::assertTrue(\file_exists($path)); + } + public function testValidString() { self::assertTrue(C128a::isValidString('ABCDEFG0123+-')); diff --git a/tests/Utils/Barcode/C128bTest.php b/tests/Utils/Barcode/C128bTest.php index 647430362..db4ad90ec 100644 --- a/tests/Utils/Barcode/C128bTest.php +++ b/tests/Utils/Barcode/C128bTest.php @@ -14,6 +14,7 @@ namespace phpOMS\tests\Utils\Barcode; use phpOMS\Utils\Barcode\C128b; +use phpOMS\Utils\Barcode\OrientationType; class C128bTest extends \PHPUnit\Framework\TestCase { @@ -26,7 +27,7 @@ class C128bTest extends \PHPUnit\Framework\TestCase } } - public function testImage() + public function testImagePng() { $path = __DIR__ . '/c128b.png'; if (\file_exists($path)) { @@ -39,6 +40,33 @@ class C128bTest extends \PHPUnit\Framework\TestCase self::assertTrue(\file_exists($path)); } + public function testImageJpg() + { + $path = __DIR__ . '/c128b.jpg'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C128b('ABcdeFG0123+-!@?', 200, 50); + $img->saveToJpgFile($path); + + self::assertTrue(\file_exists($path)); + } + + public function testOrientationAndMargin() + { + $path = __DIR__ . '/c128b_vertical.png'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C128b('ABcdeFG0123+-!@?', 50, 200, OrientationType::VERTICAL); + $img->setMargin(2); + $img->saveToPngFile($path); + + self::assertTrue(\file_exists($path)); + } + public function testValidString() { self::assertTrue(C128b::isValidString('ABCDE~FG0123+-')); diff --git a/tests/Utils/Barcode/C128cTest.php b/tests/Utils/Barcode/C128cTest.php index 769f1e50d..ad3feb114 100644 --- a/tests/Utils/Barcode/C128cTest.php +++ b/tests/Utils/Barcode/C128cTest.php @@ -14,6 +14,7 @@ namespace phpOMS\tests\Utils\Barcode; use phpOMS\Utils\Barcode\C128c; +use phpOMS\Utils\Barcode\OrientationType; class C128cTest extends \PHPUnit\Framework\TestCase { @@ -26,7 +27,7 @@ class C128cTest extends \PHPUnit\Framework\TestCase } } - public function testImage() + public function testImagePng() { $path = __DIR__ . '/c128c.png'; if (\file_exists($path)) { @@ -38,4 +39,31 @@ class C128cTest extends \PHPUnit\Framework\TestCase self::assertTrue(\file_exists($path)); } + + public function testImageJpg() + { + $path = __DIR__ . '/c128c.jpg'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C128c('412163', 200, 50); + $img->saveToJpgFile($path); + + self::assertTrue(\file_exists($path)); + } + + public function testOrientationAndMargin() + { + $path = __DIR__ . '/c128c_vertical.png'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C128c('412163', 50, 200, OrientationType::VERTICAL); + $img->setMargin(2); + $img->saveToPngFile($path); + + self::assertTrue(\file_exists($path)); + } } diff --git a/tests/Utils/Barcode/C25Test.php b/tests/Utils/Barcode/C25Test.php index 279d6bc62..d5b532738 100644 --- a/tests/Utils/Barcode/C25Test.php +++ b/tests/Utils/Barcode/C25Test.php @@ -14,6 +14,7 @@ namespace phpOMS\tests\Utils\Barcode; use phpOMS\Utils\Barcode\C25; +use phpOMS\Utils\Barcode\OrientationType; class C25Test extends \PHPUnit\Framework\TestCase { @@ -26,7 +27,7 @@ class C25Test extends \PHPUnit\Framework\TestCase } } - public function testImage() + public function testImagePng() { $path = __DIR__ . '/c25.png'; if (\file_exists($path)) { @@ -39,9 +40,44 @@ class C25Test extends \PHPUnit\Framework\TestCase self::assertTrue(\file_exists($path)); } + public function testImageJpg() + { + $path = __DIR__ . '/c25.jpg'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C25('1234567890', 150, 50); + $img->saveToJpgFile($path); + + self::assertTrue(\file_exists($path)); + } + + public function testOrientationAndMargin() + { + $path = __DIR__ . '/c25_vertical.png'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C25('1234567890', 50, 200, OrientationType::VERTICAL); + $img->setMargin(2); + $img->saveToPngFile($path); + + self::assertTrue(\file_exists($path)); + } + public function testValidString() { self::assertTrue(C25::isValidString('1234567890')); self::assertFalse(C25::isValidString('1234567A890')); } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidOrientation() + { + $img = new C25('45f!a?12'); + } } diff --git a/tests/Utils/Barcode/C39Test.php b/tests/Utils/Barcode/C39Test.php index 33b14df32..bee485f4d 100644 --- a/tests/Utils/Barcode/C39Test.php +++ b/tests/Utils/Barcode/C39Test.php @@ -14,6 +14,7 @@ namespace phpOMS\tests\Utils\Barcode; use phpOMS\Utils\Barcode\C39; +use phpOMS\Utils\Barcode\OrientationType; class C39Test extends \PHPUnit\Framework\TestCase { @@ -26,7 +27,7 @@ class C39Test extends \PHPUnit\Framework\TestCase } } - public function testImage() + public function testImagePng() { $path = __DIR__ . '/c39.png'; if (\file_exists($path)) { @@ -39,6 +40,33 @@ class C39Test extends \PHPUnit\Framework\TestCase self::assertTrue(\file_exists($path)); } + public function testImageJpg() + { + $path = __DIR__ . '/c39.jpg'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C39('ABCDEFG0123+-', 150, 50); + $img->saveToJpgFile($path); + + self::assertTrue(\file_exists($path)); + } + + public function testOrientationAndMargin() + { + $path = __DIR__ . '/c39_vertical.png'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new C39('ABCDEFG0123+-', 50, 150, OrientationType::VERTICAL); + $img->setMargin(2); + $img->saveToPngFile($path); + + self::assertTrue(\file_exists($path)); + } + public function testValidString() { self::assertTrue(C39::isValidString('ABCDEFG0123+-')); diff --git a/tests/Utils/Barcode/CodebarTest.php b/tests/Utils/Barcode/CodebarTest.php index 25d43aae7..568f14866 100644 --- a/tests/Utils/Barcode/CodebarTest.php +++ b/tests/Utils/Barcode/CodebarTest.php @@ -14,6 +14,7 @@ namespace phpOMS\tests\Utils\Barcode; use phpOMS\Utils\Barcode\Codebar; +use phpOMS\Utils\Barcode\OrientationType; class CodebarTest extends \PHPUnit\Framework\TestCase { @@ -26,7 +27,7 @@ class CodebarTest extends \PHPUnit\Framework\TestCase } } - public function testImage() + public function testImagePng() { $path = __DIR__ . '/codebar.png'; if (\file_exists($path)) { @@ -39,6 +40,33 @@ class CodebarTest extends \PHPUnit\Framework\TestCase self::assertTrue(\file_exists($path)); } + public function testImageJpg() + { + $path = __DIR__ . '/codebar.jpg'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new Codebar('412163', 200, 50); + $img->saveToJpgFile($path); + + self::assertTrue(\file_exists($path)); + } + + public function testOrientationAndMargin() + { + $path = __DIR__ . '/ccodebar_vertical.png'; + if (\file_exists($path)) { + \unlink($path); + } + + $img = new Codebar('412163', 50, 200, OrientationType::VERTICAL); + $img->setMargin(2); + $img->saveToPngFile($path); + + self::assertTrue(\file_exists($path)); + } + public function testValidString() { self::assertTrue(Codebar::isValidString('412163')); diff --git a/tests/Utils/Barcode/c128a.jpg b/tests/Utils/Barcode/c128a.jpg new file mode 100644 index 0000000000000000000000000000000000000000..321a9d41670a8791ee9a3b104e0ab00794f7dab6 GIT binary patch literal 3001 zcmbW0eK?fq9>?!77$!`L2$@NWUNn*SWR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|Hy$|2_hj6IfZ6fcaE9e}MZuR{akh~WCEGt4q)KM@ni5mIRHu@Ge3nO(`@?Ho^W;|z->}t7c!C(~aHX4) zEn*z7Oz}?aS$_GK?iN*d^X?GRbu`W@WMd;{JmP#d-FL^aL$vm*C+G{7ABoQKJGnoc z;TUqD82xPA_uSDvulL^!@bKE(Z*KmFGMt=T zv00v!#i4(G(pK}vztU?F9_Igpag$FS@D!*&KDP&a>P-kve7*{SXk$GD!AS{2ru|Ax zv9*S$B8xC-)u#-~90-~#j$%WL6Cfzpt;)jpn&AU1&2Lp$GbWezu~pSfV345L|(w8erLC4 z_CYYggJ5XGj}UMwi9C6c`qUMUN@tgFGAW0fgDF_vmY8Vc2%0`Sw4XlVu(3x;?!d-I z45FI_RQM74KEZ4vRtKup<`;RV4u2nteV5=|pERuEE^RVP%i%<#IqBs{Mpme(N^zrE)H zK^$9S`(kmajISHczr z6wGW>AH$bIAXtz1J5D~co&iBVuaB)w`x{M!$AaI~86iqW*PSw;2$M~#Lqby|{Vo9k)Ibvx{O%LiMqrmk~c@05h zyvmzgv`9$?i<^f~pzg;ql&05_uJ7I))G;CS<0z|K77{1g_z{A&hToCYuj!gro+@c; zCKIGV&_6O^>y7S;Ae1py7R>jNW9l{tl#7@U)ONl%2_bREpWs1X*J=(|_h?qs``0rj z?0AO4p~XokJ^U*o`%(&3PElv5?T}k7md4>OiXU~9hGt5~MO~$#K2(OZN5R=@g(UIu z6EUWLPY%Ze(Y+CcBR}om?3wCw6oRIniCHc^DvMzV#$L^dw>Cuc8EDfK8U{fSP|n|W zA;Wu{%uZdT*HuMHfFVdQ&MBb@0H3iFpa1{> delta 77 zcmbQkIEPWOGr-TCmrII^fq{Y7)59eQNZ$csBSvPB$Srk)iHfF-H50?tFVdQ&MBb@0LBg$F#rGn diff --git a/tests/Utils/Barcode/c128a_vertical.png b/tests/Utils/Barcode/c128a_vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..05d9e2813f3bcc85e6316ab72595f3cceb6f3457 GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^MnHU)kr_xHFx_Yeq}T#{LR^9L|NsA&-kg6I$l@&U zh%9Dc;5!1sj8nDwq=AB|o-U3d7QJUD268bda5(S%zj9Axpg^O-uFMJcPETgfHY!^= zXWgb(WxwFVdQ&MBb@00#$BDgXcg literal 0 HcmV?d00001 diff --git a/tests/Utils/Barcode/c128b.jpg b/tests/Utils/Barcode/c128b.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e13174bb16882a925221c029138fe6d709520477 GIT binary patch literal 3115 zcmbu9dpMM7AII-880T4QCbAfzD4mFOkVj33U5!Ia+rc62Dw541L+L>cMVqy$HkDZs zwbdY@$k9c)|iIwUJ~~0*P*5dZI&)KwTg}2yFb*_-NVh) z!^_3Z^x&%H3m2R2{`#BX*nKgk2V#Tw?Tv}ofW3eT)Kpa|sw!#}3PoLAO+$;Ot);1{ zHTP3JD$UrCVPb4(WMpcw)Y8;!vAL0vmBYft%WdrJ>=>4-*R8U3T)M)}Rv|)CS6A24 z)H2Z4Hn5#%G|%?GzTkbJs|IYrZ)B1gP|_ulbxH6MU;sc;L9`0sKQEFJSy@GuqNc8) zi4K&10+dK(vXU}cMMYT|olZpefwHd3r}J#qtLk|NQ_K#~Y?HI{)XX=OKA`)wk6WzR z6_ui{F-PBEuHpOzmR1WF+1amjShac$bEAu^+a`Ap-z{JI`EUJdTL=m(bkE+f=$P1p zaqRenqsKU@X~$2b|8P3{%-M54p3k|QUvQ4IAD7Z*U zap+IhRaTj2qx$K3Z%Xh1Ju};6HQI)(ywV5i<|};0>ARxZHRf2@y`C>rpnW9!dtfR5 z6WL#2|K#ccT4WL$9$6P)V0zZ7*r7tWxy1bah^SM2yv|5 zlOS%~-~tj{=)<$E>9H4BsU{|!rq$heTv7GQr*G!{D)7wx_FGrV2i@(-y~eiIA<{^1 z2slmhWO3%qS-c(-_nYs6fG2fr=`FoCCOj$VNm{F6-6-2Bh}7MS>)1tXYxSBa<{fsb zy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jqof`xEYi2-V*i z`QH{1JsT&xz)!=*tRX1K;l!BGkpR0+OmD+Peixk4a}E8HIrjZh!}kz~dW~aDv?2KZ zO{+Xx`*R3374mRFq%6bmgZ#UL5X?rLs-mhw@FZ%4XjZ*~6n(uYqyd)1GS?7-Tgl-N zTt1t@kdS0FgmANwINRu!j1A?o!--~vULnKZ z-1tbOGeR^Gi0De09|WjVlKi@9#MFJA{Ge`vjNX3>zlM+Q>mbz)qP(1p@vdvvkcske zvIjCXdg{d}!-TtipB?1ckrc(6%O+IsS6a;e{wLmNTV+A<<#?67^MX zL>3F-C1Zk@4+F*YatK~3@kyv8%v?oDc&H==zI=RuH6t45%Q+Fa=>BceebjW%L-n|r zej0)eRX62piOu>CxzltAUes(Tab!ZUpyo9u)o6ksZ>Jw|2?9&a*R9fYctPGy3I`v`T_)$mQ04SOeu=j;15?a0D+EPX%0o@@Eak5s z=$Gj1K;v@ms1v1!DQJeNN_dka$}L+nP)@tO6;+KoP$cK<$3zutW{>=vmy%_5Llj{# z`o^H1Z=autxqx^GPSg#Bc3@)xXf)a7BLo`Dk8bjoerZ5$(&Z#4dT8CC?ifx zrra#|9t28wV^M0|J8M+ULY3kmBol-_Updo?Z=1Cx!HM0DHu~bSKQ{VG0w)HSS literal 0 HcmV?d00001 diff --git a/tests/Utils/Barcode/c128b.png b/tests/Utils/Barcode/c128b.png index dd3157855397be279641e49215aae8a11dd3bdc2..0d7ce3e1ccdb36cdd07505656eab1e38ea5cc581 100644 GIT binary patch delta 122 zcmbQsIGa(iGr-TCmrII^fq{Y7)59eQNWTDLBSvN*nRAG>XriK4fVHQKV~9m>@{fLg zgPv21PRv_Z75C}h_p_Vchix=Z^On+kUAg;Y#M%>|UA7#36nGN|Bdt#Gh1`>`+QhKS W$b?ny=}&f`aSWcWelF{r5}E*~J1wsO delta 124 zcmbQuIG0heGr-TCmrII^fq{Y7)59eQNIwT+BSvN*Irn7T|A~rPLAIVQjv*Gk$v^tp z|0GLHb)9G%`*qKgz3*qI-d~%Pe`cCV%(c&DlQ%|9eBPPSeRT0A5M9G#QfvV}A+A9B|Ns9>Z_d99WN{XF zL>4nJ@ErkR#;MwT(m=r+PZ!4!i{8CKj$8~19H0NMf0gbU$kL=^ezH3ud$#uL)wAZ_ z%enTpPVV7fnTHqlo^TJdzZ6;-SvO7mgTe~DWM4fcN0?< literal 0 HcmV?d00001 diff --git a/tests/Utils/Barcode/c128c.jpg b/tests/Utils/Barcode/c128c.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a50453d8b9f1186c945fe358f383a2247e043929 GIT binary patch literal 1541 zcmbV}dsNe97{}k=?i(|1+vGCY7!X4QVUi#M11Acr91u#9h=>F@G?6=^lbMoaAu3)| zQX#TLKrS;AQ4kQ*Y$!1BAh!h}91r6%#$|i^O*?i@r_QOK_dI_+&w0Mz&-aB2*b9t= zYXa8*1VO+S^Z}>?K7tT`zfe(#Cp&hV)An64vFub=XBRd%B`JPqEIUxRmMskOU&~JQ zaB*0|-WKz5R7yfJJ253HAwD^S0-pf^AQ1>e0-i)963Ju|g-TmMH87x>o0uBX7Fn>Y z7FjTvY+Gl0HfM)5Y0dl3 z1@8c365xT2ScC&G#t7CJf%gCl00fWH>Vf|#1cSxl2}BZ^Vt_7G8vzW0#bR(+JRXNb zxA&rRfHTIMSiAZWOoO9{oJ1NgJO3idW>v*qdWd|?cG=e5QZj|H(9GPz?rnRn!(z90 zmb-hb@D!}}U$ZtKQ20UU`VCJ?8Xl_>l^MhHZ|XGdC>agXN+gW55T~v)nTG z8r8Z=`^H+4K>TpH`~~A^v*C%t#oh-WK6H=vx)qnHZeHaNGX3ejI#bQz{!-E1n~SuA z-w#Gaq}TVncSiTvs5?P^W!s%i)MFXUxsIaE;>;tF&-OUGsy{J`R|jW(KHjiYFJX>yev!R$tcX<_FyqDIf3OU8~1 zI+iZ=dL$ePk{yb_Rb-i8*3Pi>z4O4t!%CZRxnGoxJlZFe6Bp{dyzfS; zIr~Cp`^v1YPa?X(E-M@a$1?iL=D3WySqE{)6l>-*1f$~C zx@p#Czh2Rd{RImMu4juOxOB2s5)8qaJY7?*BLs<)h>}G`?_Hc0y}1S%cmB$*89D0{)5aD_n8Q7n1sQ;W$3GY9$#=TGntp;mu{KrUC_w{S3T3 u%!e&?E5j{se>*$pK;SusA~q{o28P))HlJ&aTKf^GiNVv=&t;ucLK6UZ92`9W delta 93 zcmZo0h4*<0=c)I$ztaD0e0swIJ9Nqu` diff --git a/tests/Utils/Barcode/c128c_vertical.png b/tests/Utils/Barcode/c128c_vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..a4690ef78f6f99ec6438bfaa377d6f403bb2c11a GIT binary patch literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^MnLSz$P6T1MV@~EQfvV}A+A9B|Ns9>Z_d99WN{XF zL>4nJ@ErkR#;MwT(m+8=PZ!4!jfu%W_}SPc623692{>GM@u=mB@M^x;c@u1RJmK6q vJ)&GNn}6p&rEB$1Zn6vNRcB7zT3D2OtR&lCmX<>oT(A`HIcIDcrV2!QUAX7S0bX-d^yw zf-g-=;iqLvQusS#!cZMVUbZnj|s+P zGJSn~{pZc|7cSu~5&q8$o(CKT5CSCy3j$sojKaZS55NJyXo%JW{PV)RC{&s^oxx=J zAVJ%F;Du2rUQ`N=Mx`Qk8Tt>X9NK~<5sBUlv-0RcMO@+gm0vJ|Up#TaFZ zb}?Ct7W+RNu=LlQB{wt~qe1?r{B=4UJzNX=y##cIxz*_Osm=dwTo&FMT~Q zbp6K7VZGtjZKG-I{`U{eCk&clTP%1>Coko^l62XT2(sT3;R!-aX3 zpiSXWX-gu!7bIrU^NJP*3EyXMU#$G%#06$>WcH-rrgyHf7KKC^ms&k&Ka%}-V7vY= zvR}ad$#om}QZO_;3I~Y6%v@+QKD&EtE9Z4$@)JT)7?@(1ap3JAoyvDc;;M9F?7`bz zqjrB_X9)&fV$)}@IWHU~id3EB4+GY`;5v+lSPeDFp#K|1wdLHt+gyc;x?FCP`fd^1>;sS?KZ6SJAtQJF3t?h2+qcyzwM?sP?QWxaAmp2|7+QbyZ>35V3#UwV{bu#E{sb^FSm zWQJoFu1t4Nd8a2!y?NM1y%F(c4xw;lsv=ySZ}lD!51uX>806o#dRoj+wx+k1Sj{~N z0iRF5S6R?-_-c+LH70HY^99Ywd(Prj|Rq7@$zIx{O3o_{bh}X;UnzUo^wNj4Ttxsk3@X1Q5=BKzLR?b0fp&DtnxpC1d2$m(8 zt~hBa5Y*n*iyKjI-LpEWkImN+={!qyKK!Fb#^rb)pF-v2p-34*oZt;fyj>`^0bwYDBsPvw4#L& z#kAdXMT-;CwVW3fb3A*!%uoh6Hp(d||zOE~j39JZm*Bekh*W))@@J z85vn+d3se@N~UXj587Ee2ol?xa}Q}mgt5e>jT&{*aCgv)?C7@{#T`A0vO z1e@%CuQj_9US53su+jZ!YODLt!+rJ_UUJ*ZGhDvK{QK?Ub*(_144$rjF6*2UngFZu BBDeqm delta 102 zcmZo;Y-d#L4DfU3<&xrJU|`_&^l%9R(&a#G#K;UJW0J0kO;psfQTKFl4AGdF{G*@g zpCOOczo`-B2QMu?ewewx>oiyYr*_-=1(&6@iPw!mBG{1&t;ucLK6Uw C{~-1N diff --git a/tests/Utils/Barcode/c25_vertical.png b/tests/Utils/Barcode/c25_vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..af7810f7d2d188a98ef8e305c1d7293cbef55a8e GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^MnIgw$P6SqpBN?sDYgKg5LY1m|NsA`H|O64vN#Jo zB8wRq_>O=u<5X=vX`rB)r;B5V#>C_w{A}zJ311l51QgD=FE3oVeA~|*XOy4FMeUp( t^L@hV`FB3Z=rxF~a}= literal 0 HcmV?d00001 diff --git a/tests/Utils/Barcode/c39.jpg b/tests/Utils/Barcode/c39.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b4f3b8fb1b11297a9bd715e6a8c2a8e884cd4f5a GIT binary patch literal 2865 zcmbW1c~nzZ9>;G8A*_vPSVSaFtkGdp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ABd2-qZpG(q8F3K6+WcRMJZ`Dm{_L?pDNn) z9R%kgm@wUgw+BJs>HC&+DhCBb`k(~-BnYN1SPGi4zVr^f#g`#pklsxC)8l$7_JKEZ z5rXy%2=Xn-FL@$KH-DCbMqyAMhL>TJdJsHA4F&sBPhq{|75-xN0wjjCUIk46*0)|r zl`FoRF7FNTpD=6?j97Mi%1z?Bgo&~XMgW3Bfi&*PLoG|f^(I@Mz_EZJ)6->v6arZ_ z1Y?U(@*&4?2yD2s-w4Dn4E|sr7cr&_o z*sP8Swd@`B0^UdM<;|)O38cI3`=VNnj7bRA zcKp{JfCw2If*Tb?D?Vnx)r6pSPa^~)VImrlQsrKS&wPuGW)a=l!aCXYQH-b-%t3lN zZU@1PNo5G0;>3rrJ9!XrUjz~5g$ybF{1NT~L7JHy*+fF#jarN!MmMTxQQiTNi6jaW z`Jz)#Nz}{#P;z_(IcQwrpzjh1-q`TT20@?0J-mfo&XayVMG_o`fHg~eaIyuWTxj3gf-XGw^Hk*f9#l2-rbYVI0QEX z3H;|>zn?IE*3WlnJi-#??uH;7lW4i0!~6Il5Qy!j6Cv>E;omVw5mU68(|9`u!B=+m z3e`H1Y5}`wa;!taXM~~gWW*tn4q{UfMEj{+hhWhgOQO7#4nc$2uT{qJejeWb1cIV# b95m<2ytRryLoWndyx53>Y5)KL diff --git a/tests/Utils/Barcode/c39_vertical.png b/tests/Utils/Barcode/c39_vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..ef56da5e9b849cc244af46831025d45ff510f4f9 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^MnHU=kr_xPuA3AAq}T#{LR^9L|NsA&-kg6I$l@&U zh%9Dc;5!1sj8nDwq=AAVo-U3d7QM+o_}SPc623692{?Qx>^%HqN!R4neL>$Rtm?b< zZ`l>Qpr6dL{a4ED*S=9Sv(w;}kDBSds&>jO_q7!ZLgs{h^jT$mdKI;Vst0466tmjD0& literal 0 HcmV?d00001 diff --git a/tests/Utils/Barcode/ccodebar_vertical.png b/tests/Utils/Barcode/ccodebar_vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..0f7c1efe2c735c925c859463b82a5d07a88e579b GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^MnD|K$P6U6PYK@#q}T#{LR^9L|NsA&-kg6I$l@&U zh%9Dc;5!1sj8nDwq=ACQo-U3d8WWR$@UyW?Bz$3H6FBf>arfgO{}VD!&w{e#cD`G7 qMfOXX{MJJ=Z$0!~_tWJSGlLFmj?*i%J7<8}89ZJ6T-G@yGywp6sxPYm literal 0 HcmV?d00001 diff --git a/tests/Utils/Barcode/codebar.jpg b/tests/Utils/Barcode/codebar.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6f066ae6f9745ce2734e666f036304ca4d90ef8f GIT binary patch literal 1676 zcmbW#dpJ~S90%}soVgFHkz2xyTc$*rnNW{*)@q1WN+nB)R2pK)EovKS$tsdkQJGTF zWuqdNRaPmnm4`_tJ)2yjk(OcHX3V^Mrrm9y_K)`Rp6C7Reb4Xr{rt{>V)zQo@O1NV z0~ibj1fdUrD)70h57%X_x6cxK=oZ_ssI8&&cze5rbVghZFEW(w;ptBIT*Y;#$2%>Y zJD$c#y9kKN2xZoYU*hDgX0bBtQk0;=9L;`_8A`!`&x>}kPismexncBK0Ml@3s zBV%K_rJXh1e7=RTF~f20{Dt;xHk)R>c&QW9*^b3#s*7MqB$6gY(@;yxkZERY#{AC< z{sgE*zy#Y6j5*MtVh}0@)&m*<7#ylqga23<4FrqB6Nn@-1-)=<2GGDDhz1tH;jmcr z_BZG`z*2EKX7(=lnX7{d=Fz&$eMim_Exx=_r{~i$Y{}ZZGlfLfH!z%KWHrZ{F?Sw& zk%Obt;w7%jxNh#tJv`T}UFW;r?`!`MbXcL=d0{cJaq$Ve5|j3So0@hY{kx2uqsMZO zpE#M9UwHn)#iHU%m#^F`E5B7y`9oFp-Fx--A2d8{Y-$xfZF|-(e%{g5-P8NJum6o? zKsqui8ylaPoRX_u7=ZlF`XKw8i;B85uvi33P`fZ13FtB=(N{o5?pfJeNtFoUQ@?PEfwRcd*YV~DeJR?Rms9INhR&=oxKH} z2^nCVY}3#$txP|HG}$fM@*U1=NK zuVhCVm_!6YaA)a@rD+Gc&uklAH~c;8B|i%SZ&6>BsgKr>?KN4}F5|6d)1`+Zdcf&q zb-4)+)p?ys#mTom+`Gj}n9bbjmS}Bq3AtXF z!2qSS8VGX6&I`o85J2D+pF616Ga(!aEaxl8oe)S$T9X$m1615hmg@crZ>7UPx!|!q z1RR-d%T>X{8$|-~WgY}YzxW=WD&q93QmcWTpf^;Spv=hcSDh{iKU)UD;oG6AyA?FK z;K!1^{VF$s0s2yjK+@D#P2o%`o(TqRf*~kYRD)M+&Xo1>+HvwJ2)N<7os;1z*8)5Q z*L`y#xZr;#%7`|7^yf_qoEHRzx0;5g7eQdwj0nUwo)EO!u1t2KG*8M}Y6tZMXeNqh zXIpKrpNKQKwj2UcF3sdEJ&sZr)EuWgkW<~6`IE;U#3kGGzLx{ zgdnO}X&pAI`1CoDkr{=_WT~QgYJtC_GL;X3teqEF#|3*J__)=d!;))cfGO3dW-?A@ zAbnceDv#Ht%9J7qTKr!psEi=U?%#(pFA603#qT@RB|>1D@2E^EMZ4DV0_2s`2aQ6N c8OMe4h_>)IXqEndh>xZR>R;j$8-dS%1E$ULWB>pF literal 0 HcmV?d00001 diff --git a/tests/Utils/Barcode/codebar.png b/tests/Utils/Barcode/codebar.png index bdb33351a969cf6e2e40dc90d27367848ab8b9f0..7ce6830427b426d265ac58cd5b3a64211dd12d22 100644 GIT binary patch delta 87 zcmZo>Y-UvK4DfU3<&xrJU|`_&^l%9R(rG|!#K;UJr|{Vvn5bx~`_F*K;C)fpl}%ft nZaPMuKG*+=O*8+)5^;vyDKBo>6vl@G)iQXx`njxgN@xNA-;5gh delta 87 zcmZo>Y-UvK4DfU3<&xrJU|`_&^l%9R(y2gf#K;UJ>n+<4PgFG3tux>;cwZEDWz*KE nn~ssE&-H(5W64*z%+0WP?xVBIUvRAes%7wW^>bP0l+XkK=HMHY diff --git a/tests/Utils/Converter/MeasurementTest.php b/tests/Utils/Converter/MeasurementTest.php index de27bb2bd..44fc9bbe9 100644 --- a/tests/Utils/Converter/MeasurementTest.php +++ b/tests/Utils/Converter/MeasurementTest.php @@ -159,4 +159,180 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase } } } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidTemperatureFrom() + { + Measurement::convertTemperature(1.1, 'invalid', TemperatureType::CELSIUS); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidTemperatureTo() + { + Measurement::convertTemperature(1.1, TemperatureType::CELSIUS, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidWeightFrom() + { + Measurement::convertWeight(1.1, 'invalid', WeightType::KILOGRAM); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidWeightTo() + { + Measurement::convertWeight(1.1, WeightType::KILOGRAM, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidLengthFrom() + { + Measurement::convertLength(1.1, 'invalid', LengthType::METERS); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidLengthTo() + { + Measurement::convertLength(1.1, LengthType::METERS, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidAreaFrom() + { + Measurement::convertArea(1.1, 'invalid', AreaType::SQUARE_METERS); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidAreaTo() + { + Measurement::convertArea(1.1, AreaType::SQUARE_METERS, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidVolumeFrom() + { + Measurement::convertVolume(1.1, 'invalid', VolumeType::LITER); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidVolumeTo() + { + Measurement::convertVolume(1.1, VolumeType::LITER, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidSpeedFrom() + { + Measurement::convertSpeed(1.1, 'invalid', SpeedType::KILOMETERS_PER_HOUR); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidSpeedTo() + { + Measurement::convertSpeed(1.1, SpeedType::KILOMETERS_PER_HOUR, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidTimeFrom() + { + Measurement::convertTime(1.1, 'invalid', TimeType::HOURS); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidTimeTo() + { + Measurement::convertTime(1.1, TimeType::HOURS, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidAngleFrom() + { + Measurement::convertAngle(1.1, 'invalid', AngleType::RADIAN); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidAngleTo() + { + Measurement::convertAngle(1.1, AngleType::RADIAN, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidPressureFrom() + { + Measurement::convertPressure(1.1, 'invalid', PressureType::BAR); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidPressureTo() + { + Measurement::convertPressure(1.1, PressureType::BAR, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidEnergyPowerFrom() + { + Measurement::convertEnergy(1.1, 'invalid', EnergyPowerType::JOULS); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidEnergyPowerTo() + { + Measurement::convertEnergy(1.1, EnergyPowerType::JOULS, 'invalid'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidFileSizeFrom() + { + Measurement::convertFileSize(1.1, 'invalid', FileSizeType::KILOBYTE); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidFileSizeTo() + { + Measurement::convertFileSize(1.1, FileSizeType::KILOBYTE, 'invalid'); + } } diff --git a/tests/Utils/TestUtilsClass.php b/tests/Utils/TestUtilsClass.php new file mode 100644 index 000000000..964696ee9 --- /dev/null +++ b/tests/Utils/TestUtilsClass.php @@ -0,0 +1,22 @@ +