Skip to content

Commit

Permalink
Provide a bit more context on live server failures
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Aug 4, 2014
1 parent b4ec077 commit fb63cca
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 79 deletions.
6 changes: 4 additions & 2 deletions framework/Imap_Client/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<email>slusarz@horde.org</email>
<active>yes</active>
</lead>
<date>2014-07-31</date>
<date>2014-08-04</date>
<version>
<release>2.24.0</release>
<api>2.24.0</api>
Expand Down Expand Up @@ -302,6 +302,7 @@
<file name="remote4.txt" role="test" />
</dir> <!-- /test/Horde/Imap/Client/fixtures -->
<dir name="Live">
<file name="Base.php" role="test" />
<file name="Imap.php" role="test" />
<file name="ImapTest.php" role="test" />
<file name="Pop3.php" role="test" />
Expand Down Expand Up @@ -637,6 +638,7 @@
<install as="Horde/Imap/Client/fixtures/remote2.txt" name="test/Horde/Imap/Client/fixtures/remote2.txt" />
<install as="Horde/Imap/Client/fixtures/remote3.txt" name="test/Horde/Imap/Client/fixtures/remote3.txt" />
<install as="Horde/Imap/Client/fixtures/remote4.txt" name="test/Horde/Imap/Client/fixtures/remote4.txt" />
<install as="Horde/Imap/Client/Live/Base.php" name="test/Horde/Imap/Client/Live/Base.php" />
<install as="Horde/Imap/Client/Live/Imap.php" name="test/Horde/Imap/Client/Live/Imap.php" />
<install as="Horde/Imap/Client/Live/ImapTest.php" name="test/Horde/Imap/Client/Live/ImapTest.php" />
<install as="Horde/Imap/Client/Live/Pop3.php" name="test/Horde/Imap/Client/Live/Pop3.php" />
Expand Down Expand Up @@ -2553,7 +2555,7 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2014-07-31</date>
<date>2014-08-04</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Added the &apos;url&apos; property to Horde_Imap_Client_Base.
Expand Down
43 changes: 43 additions & 0 deletions framework/Imap_Client/test/Horde/Imap/Client/Live/Base.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Copyright 2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @category Horde
* @copyright 2014 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Imap_Client
* @subpackage UnitTests
*/

/**
* Base class for live server testing.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2014 Horde LLC
* @ignore
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Imap_Client
* @subpackage UnitTests
*/
class Horde_Imap_Client_Live_Base extends PHPUnit_Framework_TestCase
{
static public $live;

static public function tearDownAfterClass()
{
self::$live = null;
}

public function onNotSuccessfulTest(Exception $e)
{
if ($e instanceof Horde_Imap_Client_Exception) {
$e->setMessage($e->getMessage() . ' [' . self::$live->url . ']');
}
parent::onNotSuccessfulTest($e);
}

}

0 comments on commit fb63cca

Please sign in to comment.