php - Error using Mockery/phpUnit in Laravel -
i'm novice developer trying test suite started existing laravel app have not experience in testing. right i'm trying tests built out confidence , experience write more substantial tests. i'm trying test relationship on model(i realize it's not sensible tests) , trying create mocked model object so(i understand it's better in memory in sqlite db major goal here test controllers don't know how deal authentication issue there). have following simple, stupid test: public function testfoo() { $lead = m::mock('lead'); $this->mock->shouldreceive('program')->once(); $this->assertequals($lead->program_id, $lead->program->id); } but following error: leadtest::testfoo badmethodcallexception: received mockery_0_lead::getattribute(), no expectations specified i don't understand error trying tell me , i'm finding no googling issue or reading through docs can find. i assume i'm not setting expected