mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-06 16:16:48 +01:00
29 lines
903 B
PHP
29 lines
903 B
PHP
<?php
|
|
|
|
/**
|
|
* Test class to test rcube_tnef_decoder class
|
|
*
|
|
* @package Tests
|
|
*/
|
|
class Framework_TnefDecoder extends PHPUnit\Framework\TestCase
|
|
{
|
|
|
|
/**
|
|
* Test TNEF decoding
|
|
*/
|
|
function test_decompress()
|
|
{
|
|
$body = file_get_contents(TESTS_DIR . 'src/one-file.tnef');
|
|
$tnef = new rcube_tnef_decoder;
|
|
$result = $tnef->decompress($body);
|
|
|
|
$this->assertSame('one-file', trim($result['message']['name']));
|
|
$this->assertCount(1, $result['attachments']);
|
|
$this->assertSame('application', $result['attachments'][0]['type']);
|
|
$this->assertSame('octet-stream', $result['attachments'][0]['subtype']);
|
|
$this->assertSame('AUTHORS', $result['attachments'][0]['name']);
|
|
$this->assertSame(244, $result['attachments'][0]['size']);
|
|
$this->assertRegExp('/Mark Simpson/', $result['attachments'][0]['stream']);
|
|
}
|
|
}
|