initOutput(\rcmail_action::MODE_HTTP, 'settings', 'responses');
$this->assertInstanceOf(\rcmail_action::class, $action);
$this->assertTrue($action->checks());
self::initDB('responses');
$this->runAndAssert($action, OutputHtmlMock::E_EXIT);
$result = $output->getOutput();
$this->assertSame('responses', $output->template);
$this->assertSame('Responses', $output->getProperty('pagetitle'));
$this->assertTrue(stripos($result, '') === 0);
$this->assertTrue(stripos($result, '
assertMatchesRegularExpression('/list(.min)?.js/', $result);
}
/**
* Test responses_list() method
*/
public function test_responses_list()
{
$rcmail = \rcmail::get_instance();
$rcmail->user->save_prefs([
'compose_responses_static' => [
['name' => 'static 1', 'text' => 'Static Response One'],
],
]);
self::initDB('responses');
$action = new \rcmail_action_settings_responses();
$output = $this->initOutput(\rcmail_action::MODE_HTTP, 'settings', 'responses');
$result = $action->responses_list([]);
$expected = '| Display Name |
'
. '| static 1 |
'
. '| response 1 |
'
. '| response 2 |
'
. '
';
$this->assertSame($expected, $result);
}
}