Skip to content

Commit b4bf8bf

Browse files
authored
Merge pull request #70 from sahat81/fix-issue-69
Closes #69
2 parents cda10e2 + 821ff8e commit b4bf8bf

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/EDI/Reader.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,23 @@ public function readEdiSegmentDTM($PeriodQualifier)
314314
*/
315315
public function readUNBDateTimeOfPpreperation()
316316
{
317-
return readUNBDateTimeOfPreperation();
317+
return $this->readUNBDateTimeOfPreparation();
318+
}
319+
320+
/**
321+
* @deprecated
322+
*/
323+
public function readUNBDateTimeOfPreperation()
324+
{
325+
return $this->readUNBDateTimeOfPreparation();
318326
}
319327

320328
/**
321329
* get message preparation time
322330
*
323331
* @return mixed|string
324332
*/
325-
public function readUNBDateTimeOfPreperation()
333+
public function readUNBDateTimeOfPreparation()
326334
{
327335

328336
//separate date (YYMMDD) and time (HHMM)

tests/EDITest/ReaderTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ public function testReadEdiDataValue()
2525
$this->assertEquals('1', $unh1);
2626
}
2727

28+
public function testReadUNBDateTimeOfPpreperation()
29+
{
30+
$r = new Reader(__DIR__ . "/../files/example.edi");
31+
32+
$Dt = $r->readUNBDateTimeOfPpreperation();
33+
$this->assertEquals('2094-01-01 09:50:00', $Dt);
34+
}
35+
2836
public function testReadUNBDateTimeOfPreperation()
2937
{
3038
$r = new Reader(__DIR__ . "/../files/example.edi");
@@ -33,6 +41,14 @@ public function testReadUNBDateTimeOfPreperation()
3341
$this->assertEquals('2094-01-01 09:50:00', $Dt);
3442
}
3543

44+
public function testReadUNBDateTimeOfPreparation()
45+
{
46+
$r = new Reader(__DIR__ . "/../files/example.edi");
47+
48+
$Dt = $r->readUNBDateTimeOfPreparation();
49+
$this->assertEquals('2094-01-01 09:50:00', $Dt);
50+
}
51+
3652
public function testReadUNHmessageType()
3753
{
3854
$r = new Reader(__DIR__ . "/../files/example.edi");

0 commit comments

Comments
 (0)