plugins);
$this->assertInstanceOf('attachment_reminder', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
$plugin->init();
}
/**
* Test prefs_list() method
*/
public function test_prefs_list()
{
$rcube = \rcube::get_instance();
$plugin = new \attachment_reminder($rcube->plugins);
$args = ['section' => 'compose', 'blocks' => ['main' => ['options' => []]]];
$result = $plugin->prefs_list($args);
$this->assertSame(
'',
$result['blocks']['main']['options']['attachment_reminder']['title']
);
$this->assertSame(
'',
$result['blocks']['main']['options']['attachment_reminder']['content']
);
}
/**
* Test prefs_save() method
*/
public function test_prefs_save()
{
$rcube = \rcube::get_instance();
$plugin = new \attachment_reminder($rcube->plugins);
$_POST = [];
$args = ['section' => 'compose', 'prefs' => []];
$result = $plugin->prefs_save($args);
$this->assertFalse($result['prefs']['attachment_reminder']);
$_POST = ['_attachment_reminder' => 1];
$args = ['section' => 'compose', 'prefs' => []];
$result = $plugin->prefs_save($args);
$this->assertTrue($result['prefs']['attachment_reminder']);
}
}