Skip to content
Snippets Groups Projects
Commit 13ae2b37 authored by Demian Katz's avatar Demian Katz
Browse files

Fixed broken tests.

parent 814406b6
Branches
Tags
No related merge requests found
...@@ -209,6 +209,12 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase ...@@ -209,6 +209,12 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
$this->serviceManager->setService( $this->serviceManager->setService(
'SharedEventManager', new \Zend\EventManager\SharedEventManager() 'SharedEventManager', new \Zend\EventManager\SharedEventManager()
); );
$this->serviceManager->setService(
'VuFind\RecordLoader', new \VuFind\Record\Loader(
$this->serviceManager->get('VuFind\Search'),
$this->serviceManager->get('VuFind\RecordDriverPluginManager')
)
);
} }
return $this->serviceManager; return $this->serviceManager;
} }
......
...@@ -49,7 +49,8 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase ...@@ -49,7 +49,8 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase
$recordLink = $this->getMock( $recordLink = $this->getMock(
'VuFind\View\Helper\Root\RecordLink', array(), 'VuFind\View\Helper\Root\RecordLink', array(),
array(new \VuFind\Record\Router( array(new \VuFind\Record\Router(
new \VuFind\Record\Loader(), new \Zend\Config\Config(array())) $this->getServiceManager()->get('VuFind\RecordLoader'),
new \Zend\Config\Config(array()))
) )
); );
$recordLink->expects($this->any())->method('getUrl') $recordLink->expects($this->any())->method('getUrl')
......
...@@ -50,7 +50,13 @@ class CartTest extends \PHPUnit_Framework_TestCase ...@@ -50,7 +50,13 @@ class CartTest extends \PHPUnit_Framework_TestCase
*/ */
public function __construct() public function __construct()
{ {
$this->loader = $this->getMock('VuFind\Record\Loader'); $this->loader = $this->getMock(
'VuFind\Record\Loader', array(),
array(
$this->getMock('VuFindSearch\Service'),
$this->getMock('VuFind\RecordDriver\PluginManager')
)
);
} }
/** /**
......
...@@ -46,8 +46,15 @@ class CartTest extends \PHPUnit_Framework_TestCase ...@@ -46,8 +46,15 @@ class CartTest extends \PHPUnit_Framework_TestCase
public function testCart() public function testCart()
{ {
// Create a mock cart object: // Create a mock cart object:
$mockLoader = $this->getMock(
'VuFind\Record\Loader', array(),
array(
$this->getMock('VuFindSearch\Service'),
$this->getMock('VuFind\RecordDriver\PluginManager')
)
);
$cart = $this->getMock( $cart = $this->getMock(
'VuFind\Cart', null, array($this->getMock('VuFind\Record\Loader')) 'VuFind\Cart', null, array($mockLoader)
); );
// Create a helper object: // Create a helper object:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment