Files
roundcubemail/tests/Actions/Utils/Html2text.php
Aleksander Machniak 545a1569f1 Steps -> Actions refactoring (#7688)
* 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
2020-11-01 11:25:38 +01:00

39 lines
892 B
PHP

<?php
/**
* Test class to test rcmail_action_utils_html2text
*
* @package Tests
*/
class Actions_Utils_Html2text extends ActionTestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcmail_action_utils_html2text;
$this->assertInstanceOf('rcmail_action', $object);
}
/**
* Test for run()
*/
function test_run()
{
$object = new rcmail_action_utils_html2text;
$html = "<p>test</p>";
$object::$source = $this->createTempFile($html);
$output = $this->initOutput(rcmail_action::MODE_HTTP, 'utils', 'html2text');
$this->assertTrue($object->checks());
$this->runAndAssert($object, OutputHtmlMock::E_EXIT);
$this->assertSame('test', $output->output);
$this->assertSame(['Content-Type: text/plain; charset=UTF-8'], $output->headers);
}
}