mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-06 00:04:01 +01:00
* Assert CS using CI * fix "single_blank_line_at_eof" * fix "statement_indentation" * fix "switch_case_semicolon_to_colon" * fix "control_structure_braces" * fix "statement_indentation" * fix "no_whitespace_in_blank_line" * fix "no_trailing_whitespace_in_comment" * fix "no_trailing_whitespace" * fix "single_space_around_construct" * fix "spaces_inside_parentheses" * fix "ternary_operator_spaces" * fix "trim_array_spaces" * fix "whitespace_after_comma_in_array" * fix "cast_spaces" * fix "unary_operator_spaces" * fix "no_trailing_comma_in_singleline" * fix "ordered_imports" * fix "no_unused_imports" * Check composer.json format * fix CI job name * file header comments are not phpdoc * fix "phpdoc_indent" * fix "braces_position" * fix "phpdoc_types" * fix "no_blank_lines_after_class_opening" * fix "no_multiple_statements_per_line" * fix "multiline_comment_opening_closing" * fix "single_line_empty_body" * fix "non_printable_character" * fix "phpdoc_trim_consecutive_blank_line_separation" * fix "include" * fix "no_mixed_echo_print" --------- Co-authored-by: Aleksander Machniak <alec@alec.pl>
36 lines
967 B
PHP
36 lines
967 B
PHP
<?php
|
|
|
|
class AdditionalMessageHeaders_Plugin extends ActionTestCase
|
|
{
|
|
static function setUpBeforeClass(): void
|
|
{
|
|
include_once __DIR__ . '/../additional_message_headers.php';
|
|
}
|
|
|
|
/**
|
|
* Test the plugin
|
|
*/
|
|
function test_plugin()
|
|
{
|
|
$rcube = rcube::get_instance();
|
|
$plugin = new additional_message_headers($rcube->plugins);
|
|
|
|
$this->assertInstanceOf('additional_message_headers', $plugin);
|
|
$this->assertInstanceOf('rcube_plugin', $plugin);
|
|
|
|
$plugin->init();
|
|
|
|
$args = ['message' => new Mail_mime()];
|
|
|
|
$result = $plugin->message_headers($args);
|
|
|
|
$this->assertSame("MIME-Version: 1.0\r\n", $result['message']->txtHeaders());
|
|
|
|
$rcube->config->set('additional_message_headers', ['X-Test' => 'Test']);
|
|
|
|
$result = $plugin->message_headers($args);
|
|
|
|
$this->assertSame("MIME-Version: 1.0\r\nX-Test: Test\r\n", $result['message']->txtHeaders());
|
|
}
|
|
}
|