Files
roundcubemail/tests/Framework/TnefDecoder.php
Aleksander Machniak 8b16a7dfe7 More tests
2020-11-08 11:06:42 +01:00

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']);
}
}