Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Sep 21, 2013
1 parent 87ed5d0 commit 7ac517e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
4 changes: 3 additions & 1 deletion imp/package.xml
Expand Up @@ -22,7 +22,7 @@
<email>chuck@horde.org</email>
<active>yes</active>
</lead>
<date>2013-09-16</date>
<date>2013-09-21</date>
<version>
<release>6.2.0</release>
<api>6.1.0</api>
Expand Down Expand Up @@ -941,6 +941,7 @@
</dir> <!-- /test/Imp/fixtures -->
<dir name="Stub">
<file name="HtmlViewer.php" role="test" />
<file name="Imap.php" role="test" />
<file name="ItipRequest.php" role="test" />
</dir> <!-- /test/Imp/Stub -->
<dir name="Unit">
Expand Down Expand Up @@ -1979,6 +1980,7 @@
<install as="Imp/fixtures/test.eml" name="test/Imp/fixtures/test.eml" />
<install as="Imp/fixtures/test.mbox" name="test/Imp/fixtures/test.mbox" />
<install as="Imp/Stub/HtmlViewer.php" name="test/Imp/Stub/HtmlViewer.php" />
<install as="Imp/Stub/Imap.php" name="test/Imp/Stub/Imap.php" />
<install as="Imp/Stub/ItipRequest.php" name="test/Imp/Stub/ItipRequest.php" />
<install as="Imp/Unit/ComposeTest.php" name="test/Imp/Unit/ComposeTest.php" />
<install as="Imp/Unit/MboxParseTest.php" name="test/Imp/Unit/MboxParseTest.php" />
Expand Down
1 change: 1 addition & 0 deletions imp/test/Imp/Autoload.php
Expand Up @@ -13,4 +13,5 @@
Horde_Test_Autoload::addPrefix('IMP', __DIR__ . '/../../lib');

require_once 'Stub/HtmlViewer.php';
require_once 'Stub/Imap.php';
require_once 'Stub/ItipRequest.php';
32 changes: 32 additions & 0 deletions imp/test/Imp/Stub/Imap.php
@@ -0,0 +1,32 @@
<?php
/**
* Copyright 2012-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @category Horde
* @copyright 2012-2013 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP
* @subpackage UnitTests
*/

/**
* Stub for testing the IMP Itip Imple handler.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2012-2013 Horde LLC
* @ignore
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP
* @subpackage UnitTests
*/
class Imp_Stub_Imap
{
public function getIdsOb()
{
return new Horde_Imap_Client_Ids();
}
}
10 changes: 9 additions & 1 deletion imp/test/Imp/Unit/Mime/Viewer/ItipTest.php
Expand Up @@ -33,6 +33,7 @@ class Imp_Unit_Mime_Viewer_ItipTest
private $_contentsFactory;
private $_identity;
private $_identityId = 'default';
private $_imapFactory;
private $_mail;
private $_mailbox;
private $_notifyStack = array();
Expand Down Expand Up @@ -94,7 +95,14 @@ public function _injectorGetInstance($interface)
return $this->_contentsFactory;

case 'IMP_Factory_Imap':
return new IMP_Imap('foo');
if (!isset($this->_imapFactory)) {
$imap = $this->getMock('IMP_Factory_Imap', array(), array(), '', false);
$imap->expects($this->any())
->method('create')
->will($this->returnValue(new IMP_Stub_Imap()));
$this->_imapFactory = $imap;
}
return $this->_imapFactory;

case 'IMP_Factory_Mailbox':
if (!isset($this->_mailbox)) {
Expand Down

0 comments on commit 7ac517e

Please sign in to comment.