I have installed Pear and used Pear to install PHPUnit and Mockery. I have PHPUnit running successfully in elipse (the pear directory is configured as an include path in the project).
I would like to use Mockery but eclipse keeps giving me this error:
PHP Fatal error: Class 'deepend\Mockery' not found
I followed the advice here: http://pkp.sfu.ca/wiki/index.php/Configure_Eclipse_for_PHPUnit but am not sure how to load the library. Here's my code:
<?php
use \Mockery as m;
define('BASEPATH', (dirname(__FILE__) . '/../../../../sys'));
require_once (dirname(__FILE__) . '/../models/products_model_composed.php');
class ProductsModelTest extends PHPUnit_Framework_TestCase {
private $products;
private $mock_ci_model;
public function setUp(){
$this->products = new products_model_composed();
$this->define_ci_mock();
$this->products->__set('ci_model', $this->mock_ci_model);
}
private function define_ci_mock(){
$ci = m::mock('CI_Model');
$ci->shouldReceive('ee')->once()->andReturn($this);
}
See first line in function define_ci_mock. This is where Mockery is called but not found. Can you point me in the right direction? I've installed Mockery 0.8.0