Fix for when packets have a kludge after the origin line, and now capturing taglines. Updated testing configuration

This commit is contained in:
2023-08-04 22:06:29 +10:00
parent fb65c645cb
commit c8a2affbfa
7 changed files with 152 additions and 47 deletions

View File

@@ -201,4 +201,55 @@ class PacketTest extends TestCase
$this->assertTrue($messages);
}
}
public function test_soh_in_origin()
{
// This packet has a SOH<char>SOH sequence
$f = new File(__DIR__.'/data/test_msg_with_soh_in_origin.pkt');
foreach ($f as $packet) {
$pkt = Packet::process($packet,$f->itemName(),$f->itemSize(),NULL,FALSE);
$this->assertEquals(9,$pkt->count());
$messages = FALSE;
$c = 0;
foreach ($pkt as $msg) {
$c++;
$messages = TRUE;
$this->assertNotTrue($msg->isNetmail());
switch ($c) {
case 1:
$this->assertSame('3:712/886 220da89f',$msg->msgid);
$this->assertSame('9f5544bea46ef57a45f561b9e07dd71e',md5($msg->message));
$this->assertSame('9bf4b8c348ac235cc218577abf7140af',md5($msg->message_src));
$this->assertCount(3,$msg->rogue_path);
$this->assertCount(16,$msg->rogue_seenby);
$this->assertContains('633/0 267 280 281 408 410 412 509 509 640/1384 712/114 550 620 848',$msg->seenby);
$this->assertContains('712/886 848 633/280',$msg->path);
$this->assertCount(2,$msg->seenby);
$this->assertCount(0,$msg->unknown);
break;
case 4:
$this->assertSame('',$msg->msgid);
$this->assertSame('b975057002def556c5a9497aacd000fb',md5($msg->message));
$this->assertSame('c90dd234d2aa029af22c453a25b79a4e',md5($msg->message_src));
$this->assertCount(3,$msg->rogue_path);
$this->assertCount(19,$msg->rogue_seenby);
$this->assertContains('633/267 280 281 384 408 410 412 418 420 509 509 712/848 770/1 100 330',$msg->seenby);
$this->assertContains('772/210 770/1 633/280',$msg->path);
$this->assertCount(2,$msg->seenby);
$this->assertCount(0,$msg->unknown);
default:
continue 2;
}
}
$this->assertTrue($messages);
}
}
}