mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Reintroduce Webklex IMAP for ticket processing as PHP-IMAP is no longer being developed. This is optional for now and considered beta can be found in cron/ticket_email_parser.php
This commit is contained in:
37
plugins/vendor/webklex/php-imap/tests/AttachmentTest.php
vendored
Normal file
37
plugins/vendor/webklex/php-imap/tests/AttachmentTest.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Tests\fixtures\FixtureTestCase;
|
||||
use Webklex\PHPIMAP\Attachment;
|
||||
|
||||
class AttachmentTest extends FixtureTestCase
|
||||
{
|
||||
protected Attachment $attachment;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$message = $this->getFixture("attachment_encoded_filename.eml");
|
||||
$this->attachment = $message->getAttachments()->first();
|
||||
}
|
||||
/**
|
||||
* @dataProvider decodeNameDataProvider
|
||||
*/
|
||||
public function testDecodeName(string $input, string $output): void
|
||||
{
|
||||
$name = $this->attachment->decodeName($input);
|
||||
$this->assertEquals($output, $name);
|
||||
}
|
||||
|
||||
public function decodeNameDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['../../../../../../../../../../../var/www/shell.php', 'varwwwshell.php'],
|
||||
['test..xml', 'test.xml'],
|
||||
[chr(0), ''],
|
||||
['C:\\file.txt', 'Cfile.txt'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user