mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-04 15:24:02 +01:00
* Move action handling code to rcmail class * Add rcmail_action class * Add action aliases * Get rid of $OUTPUT global * Move some methods from rcmail to rcmail_action * PHP8 compat. fixes * Add framework for testing actions * Fix obvious code mistakes
39 lines
943 B
PHP
39 lines
943 B
PHP
<?php
|
|
|
|
/**
|
|
* Test class to test rcmail_action_utils_text2html
|
|
*
|
|
* @package Tests
|
|
*/
|
|
class Actions_Utils_Text2html extends ActionTestCase
|
|
{
|
|
/**
|
|
* Class constructor
|
|
*/
|
|
function test_class()
|
|
{
|
|
$object = new rcmail_action_utils_text2html;
|
|
|
|
$this->assertInstanceOf('rcmail_action', $object);
|
|
}
|
|
|
|
/**
|
|
* Test for run()
|
|
*/
|
|
function test_run()
|
|
{
|
|
$object = new rcmail_action_utils_text2html;
|
|
$input = "test plain text input";
|
|
$object::$source = $this->createTempFile($input);
|
|
|
|
$output = $this->initOutput(rcmail_action::MODE_HTTP, 'utils', 'text2html');
|
|
|
|
$this->assertTrue($object->checks());
|
|
|
|
$this->runAndAssert($object, OutputHtmlMock::E_EXIT);
|
|
|
|
$this->assertSame('<div class="pre">test plain text input</div>', $output->output);
|
|
$this->assertSame(['Content-Type: text/html; charset=UTF-8'], $output->headers);
|
|
}
|
|
}
|