mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-06 08:14:08 +01:00
* Check plugins composer.json using CI * Add "require-dev" and "config.allow-plugins" to plugins * fix composer.json format - rm invalid email * fix composer.json format - fix ext require * fix composer.json format - fix plugin name * tmp * Revert "tmp" * fix ext in ext install * disable plugin in plugin install until Roundcube is fully autoloadable * fix composer.json format - fix non-canonical license name * Revert "Add "require-dev" and "config.allow-plugins" to plugins" * no composer install for plugins needed * Revert "fix ext in ext install" * add standard "Test" suffix to phpunit files * rm unneeded "suffix" in phpunit config * simplify phpunit config * fix default "xhtml" doctype in unit testing * fix test_format_date test to not rely on other tests * even more phpunit config simplify * stricter/unify phpunit params for E2E tests * run E2E tests on maximal php version too with lowest deps * "repositories" in bundled plugins are useless as for root package only * add/unify missing plugin test
38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* Test class to test rcube_mime_decode class
|
|
*/
|
|
class Framework_MimeDecode extends TestCase
|
|
{
|
|
/**
|
|
* Test mail decode
|
|
*/
|
|
public function test_decode()
|
|
{
|
|
$mail = file_get_contents(TESTS_DIR . 'src/mail0.eml');
|
|
|
|
$decoder = new rcube_mime_decode();
|
|
|
|
$result = $decoder->decode($mail);
|
|
|
|
$this->assertInstanceOf('rcube_message_part', $result);
|
|
$this->assertSame('multipart/mixed', $result->mimetype);
|
|
$this->assertSame('=_8853bfb47b7da1852ac882e69cc724f3', $result->ctype_parameters['boundary']);
|
|
$this->assertSame('8bit', $result->encoding);
|
|
$this->assertSame(1413, $result->size);
|
|
|
|
$this->assertCount(13, $result->headers);
|
|
$this->assertSame('thomas@roundcube.net', $result->headers['x-sender']);
|
|
|
|
$this->assertSame('=_8853bfb47b7da1852ac882e69cc724f3', $result->ctype_parameters['boundary']);
|
|
|
|
$this->assertCount(3, $result->parts);
|
|
$this->assertSame(11, $result->parts[2]->size);
|
|
$this->assertSame('text/plain', $result->parts[2]->mimetype);
|
|
$this->assertSame('lines_lf.txt', $result->parts[2]->filename);
|
|
}
|
|
}
|