We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running tests got this error:
BadMethodCallException: Method Mockery_0_App_Repositories_ProductRepository::pushCriteria() does not exist on this mock object
Making mock like that $this->productRepository = \Mockery::mock('App\Repositories\ProductRepository');
$this->productRepository = \Mockery::mock('App\Repositories\ProductRepository');
In the same time $this->productRepository->shouldReceive('paginate') doesn't give errors
$this->productRepository->shouldReceive('paginate')
More code:
public function setUp() { parent::setUp(); $this->productRepository = m::mock('App\Repositories\ProductRepository'); $this->variantRepository = m::mock('App\Repositories\VariantRepository'); $this->request = m::mock('Illuminate\Http\Request'); $this->productController = new \App\Http\Controllers\Admin\ProductController($this->productRepository, $this->variantRepository); } public function tearDown() { m::close(); parent::tearDown(); }
public function testIndex() { $this->productRepository->shouldReceive('paginate')->once()->andReturn(array()); $response = $this->productController->getIndex($this->request); $this->assertEqual(array(), $response); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Running tests got this error:
Making mock like that
$this->productRepository = \Mockery::mock('App\Repositories\ProductRepository');
In the same time
$this->productRepository->shouldReceive('paginate')
doesn't give errors
More code:
public function setUp()
{
parent::setUp();
$this->productRepository = m::mock('App\Repositories\ProductRepository');
$this->variantRepository = m::mock('App\Repositories\VariantRepository');
$this->request = m::mock('Illuminate\Http\Request');
$this->productController = new \App\Http\Controllers\Admin\ProductController($this->productRepository, $this->variantRepository);
}
public function tearDown()
{
m::close();
parent::tearDown();
}
The text was updated successfully, but these errors were encountered: