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) { $this->browse(function ($browser) {
if ($browser->isPhone()) { if ($browser->isPhone()) {
$this->markTestSkipped(); $this->markTestSkipped();
return;
} }
$browser->go('mail'); $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) { $browser->with(new Popupmenu('message-menu'), function ($browser) use (&$current_window, &$new_window) {
if ($browser->isPhone()) { if ($browser->isPhone()) {
$browser->assertMissing('a.print'); $browser->assertMissing('a.print');
return; $this->markTestSkipped();
} }
list($current_window, $new_window) = $browser->openWindow(function ($browser) { list($current_window, $new_window) = $browser->openWindow(function ($browser) {

@ -202,16 +202,21 @@ class bootstrap
rcube::raise_error(__METHOD__ . ': IMAP connection unavailable', false, true); rcube::raise_error(__METHOD__ . ': IMAP connection unavailable', false, true);
} }
$rcmail = rcmail::get_instance(); $rcmail = rcmail::get_instance();
$imap = $rcmail->get_storage(); $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 // Note: We do not expect IMAP server auto-creating any folders
foreach ($imap->list_folders() as $folder) { foreach ($imap->list_folders() as $folder) {
if ($folder != 'INBOX' && (!$no_special || !$imap->is_special_folder($folder))) { if ($folder != 'INBOX' && (!$got_defaults || !$imap->is_special_folder($folder))) {
// Note: GreenMail throws errors when unsubscribing deleted folder // GreenMail throws errors when unsubscribing a deleted folder
// We'll ignore that for now if ($vendor == 'greenmail') {
$imap->delete_folder($folder); $imap->conn->deleteFolder($folder);
}
else {
$imap->delete_folder($folder);
}
} }
} }
} }

Loading…
Cancel
Save