I'm trying to unit test a controller where I have $this->library->client->changeLog->create()
and I'm wondering if I need to mock each of these properties or if I can just somehow deep mock $this->library
so I don't have to have a long chain of objects being mocked and have to worry about their constructor parameters as well. I'm trying to mock a chain right now and it's very ugly and not working very well.
I also tried $this->library->shouldReceive('client->changeLog->create')->once()->andReturn(true);
but it leads to a "trying to get property of a non-object.
Is there a simple way to test the output the output of a method that's a few properties deep?