Support the ongoing development of Laravel.io →
IOC Architecture Testing
Last updated 2 years ago.
0

You need to define what the mock should return.

$mock->shouldReceive('byPage')->once()->andReturn(...)

Last updated 2 years ago.
0

Thank you anlutro,

So I have to create 2 new article, hydrate them entirely, push on array, construct my return value with it ?

And how can I set the andReturn for

Paginator::shouldReceive('make')->once(); 
Last updated 2 years ago.
0

The same way as with $mock.

Last updated 2 years ago.
0

Yeah bu what I should return, a real Paginator instance ?

How can I instanciate one for tests ?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Elyahou elyahou Joined 7 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.