From 1cb6e91e998d861c8e6b67cfc9bf83108331ca50 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Wed, 27 May 2015 07:38:55 -0400 Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail --- tests/Selenium/bootstrap.php | 5 +++++ program/lib/Roundcube/bootstrap.php | 5 +++-- tests/Selenium/Mail/Getunread.php | 2 +- tests/Selenium/Mail/List.php | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index ba7954e..0cfa574 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -99,8 +99,9 @@ spl_autoload_register('rcube_autoload'); // set PEAR error handling (will also load the PEAR main class) -@PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'rcube_pear_error'); - +if (class_exists('PEAR')) { + @PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'rcube_pear_error'); +} /** diff --git a/tests/Selenium/Mail/Getunread.php b/tests/Selenium/Mail/Getunread.php index 16b6bd1..c18ddc0 100644 --- a/tests/Selenium/Mail/Getunread.php +++ b/tests/Selenium/Mail/Getunread.php @@ -32,6 +32,6 @@ $this->assertHasClass('unread', $li); $badge = $this->byCssSelector('.folderlist li.inbox span.unreadcount'); - $this->assertEquals(strval($this->msgcount), $badge->text()); + $this->assertEquals(strval($this->msgcount), $this->getText($badge)); } } diff --git a/tests/Selenium/Mail/List.php b/tests/Selenium/Mail/List.php index 88fdb25..dc28577 100644 --- a/tests/Selenium/Mail/List.php +++ b/tests/Selenium/Mail/List.php @@ -42,7 +42,7 @@ $this->assertHasClass('unread', $row); $subject = $this->byCssSelector('.messagelist tbody tr:first-child td.subject'); - $this->assertEquals('Lines', $subject->text()); + $this->assertEquals('Lines', $this->getText($subject)); $icon = $this->byCssSelector('.messagelist tbody tr:first-child td.status span'); $this->assertHasClass('unread', $icon); diff --git a/tests/Selenium/bootstrap.php b/tests/Selenium/bootstrap.php index cf547df..dc4897d 100644 --- a/tests/Selenium/bootstrap.php +++ b/tests/Selenium/bootstrap.php @@ -337,6 +337,11 @@ return $response; } + protected function getText($element) + { + return $element->text() ?: $element->attribute('textContent'); + } + protected function assertHasClass($classname, $element) { $this->assertContains($classname, $element->attribute('class')); -- Gitblit v1.9.1