Yes, I would usually use ->AssertSee() chained onto the end of the command.
I does not work for this situation. If I try:
$foo->doSomething()->assertSee('script');
I get Method [assertSee] does not exist on Redirect.
And If I try just placing it after the function call:
$response->assertSee('script');
I get:
Undefined variable: response
I need to do a function call not a GET because I am passing a mocked object
Here is my test so far:
public function do_the_test()
{
//Arrange
$mockObject = Mockery::mock('App\MockObject');
$authCode = 123456;
$mockObject->shouldReceive('doSomething')->once()->with($authCode)->andReturn([
'code' => '123456',
'name' => 'joe',
'username' => 'smith',
'email' => '[email protected]',
'domain' => 'yahoo.co.uk'
]);
//Act
$object = new Foo($mockObject);
$object->doSomething();
//Assert
??
//check that view is returned with message text
}
Mick