Tests: Fix Print test on mobile, make GreenMail quiet on folder deletion

pull/7186/head
Aleksander Machniak 5 years ago
parent 2037f2612b
commit c2c85b0a76

@ -26,7 +26,6 @@ class Open extends \Tests\Browser\TestCase
$this->browse(function ($browser) {
if ($browser->isPhone()) {
$this->markTestSkipped();
return;
}
$browser->go('mail');

@ -34,7 +34,7 @@ class PrintTest extends \Tests\Browser\TestCase
$browser->with(new Popupmenu('message-menu'), function ($browser) use (&$current_window, &$new_window) {
if ($browser->isPhone()) {
$browser->assertMissing('a.print');
return;
$this->markTestSkipped();
}
list($current_window, $new_window) = $browser->openWindow(function ($browser) {

@ -204,17 +204,22 @@ class bootstrap
$rcmail = rcmail::get_instance();
$imap = $rcmail->get_storage();
$no_special = $rcmail->config->get('create_special_folders');
$got_defaults = $rcmail->config->get('create_default_folders');
$vendor = $imap->get_vendor();
// Note: We do not expect IMAP server auto-creating any folders
foreach ($imap->list_folders() as $folder) {
if ($folder != 'INBOX' && (!$no_special || !$imap->is_special_folder($folder))) {
// Note: GreenMail throws errors when unsubscribing deleted folder
// We'll ignore that for now
if ($folder != 'INBOX' && (!$got_defaults || !$imap->is_special_folder($folder))) {
// GreenMail throws errors when unsubscribing a deleted folder
if ($vendor == 'greenmail') {
$imap->conn->deleteFolder($folder);
}
else {
$imap->delete_folder($folder);
}
}
}
}
/**
* Check IMAP capabilities

Loading…
Cancel
Save