From 01fa846f86eb3dfcb7ab91c9dc79598d6b63bd13 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 16 Nov 2018 18:50:33 +0100 Subject: [PATCH] bindDLZ tests --- lam/tests/lib/modules/bindDLZTest.php | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lam/tests/lib/modules/bindDLZTest.php diff --git a/lam/tests/lib/modules/bindDLZTest.php b/lam/tests/lib/modules/bindDLZTest.php new file mode 100644 index 00000000..c9dfb8a6 --- /dev/null +++ b/lam/tests/lib/modules/bindDLZTest.php @@ -0,0 +1,36 @@ +assertEquals('1', bindDLZ::increaseSerial('')); + $this->assertEquals('4', bindDLZ::increaseSerial('3')); + $this->assertEquals('10', bindDLZ::increaseSerial('9')); + $date = new DateTime('now', new DateTimeZone('UTC')); + $dateStr = $date->format('Ymd'); + $this->assertEquals($dateStr . '2', bindDLZ::increaseSerial($dateStr . '1')); + $this->assertEquals($dateStr . '06', bindDLZ::increaseSerial($dateStr . '05')); + $this->assertEquals($dateStr . '0010', bindDLZ::increaseSerial($dateStr . '0009')); + $this->assertEquals($dateStr . '100', bindDLZ::increaseSerial($dateStr . '99')); + $this->assertEquals($dateStr . '001', bindDLZ::increaseSerial('20010517003')); + $this->assertEquals('20990517004', bindDLZ::increaseSerial('20990517003')); + } + + } + +}