Skip to content

Instantly share code, notes, and snippets.

@Mulkave
Last active December 2, 2020 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mulkave/87d968816a86244828628cc1729f61bd to your computer and use it in GitHub Desktop.
Save Mulkave/87d968816a86244828628cc1729f61bd to your computer and use it in GitHub Desktop.
<?php
/**
* @dataProvider generousDataProvider::giveMeInput()
*/
public fucntion test_thy_feature($input)
{
// Mock Job that make an external HTTP request
$mOperation = Mockery::mock(GetTheBeansOperation::class, [$input])->makePartial();
$mOperation->shouldReceive('run')
->with(BeanGrabberJob::class, [
'platformId' => Arr::get($input, 'platform_id')
])
->once()
->andReturn(true);
// Call the endpoint that runs the feature.
$this->post('/beans', [])->assertJson([
'status' => 200,
'data' => [
'yummy' => 'tummy'
]
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment