Try setting it to:
$excel = m::mock('Maatwebsite\Excel\Excel');
$this->app->instance('Maatwebsite\Excel\Excel', $excel);
Summer Sale! All accounts are 50% off this week.
Hello
I'm just starting out with Mockery and have read/watched some information on getting started but I am running up against this error
Call to a member function fetchMock() on null
I don't understand why it's null, I thought it just creates an object to create expectations on. I get the same error when I try to mock any class. Here's my test
<?php
use Mockery\Mock as m;
use Maatwebsite\Excel\Excel;
class ExcelWriterTest extends TestCase
{
/**
* @test
*/
function it_creates_an_excel_document()
{
$excel = m::mock(Excel::class);
}
function tearDown()
{
m::close();
}
}
What am I doing wrong?
I found what my mistake was, for some reason I thought I needed to...
use Mockery\Mock as m;
I should have just put
use Mockery as m;
Please or to participate in this conversation.