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

You need to define what the mock should return.

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

Last updated 8 months 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 8 months ago.
0

The same way as with $mock.

Last updated 8 months ago.
0

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

How can I instanciate one for tests ?

Last updated 8 months ago.
0

Sign in to participate in this thread!

Full Stack Europe

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.

© 2023 Laravel.io - All rights reserved.