class CsvRowProcessorTest extends TestCase
{
/**
* @test
*/
public function should_process_csv_row(): void
{
$row = [
'url' => 'http://localhost:9501/entries?description',
'descriptions' => 'time;ate;red;dog',
];
$csvRowProcessor = new CsvRowProcessor();
$resp = $csvRowProcessor->execute($row);
self::assertCount(4, $resp);
}
}
Obviously test doesn't pass because execute() method returns responses before coroutine are finished
There was 1 failure:
1) CsvRowProcessorTest::should_process_csv_row
Failed asserting that actual size 0 matches expected size 4.
Is there some technique to handle this scenario?
Among other things, I was expecting a second problem which, however, is not happening. I was expecting where to run coroutines within a context but this problem is not reported. It simply fails the assertion
I have a service that loop over some http calls
Than I'd like to have a test on this service
Obviously test doesn't pass because execute() method returns responses before coroutine are finished
Is there some technique to handle this scenario?
Among other things, I was expecting a second problem which, however, is not happening. I was expecting where to run coroutines within a context but this problem is not reported. It simply fails the assertion