Closed tu6ge closed 2 years ago
It is convenient for developer to test their own code. this is very necessary, other project is required you, It can write test case 100% coverage. it can assert download:
ExcelFacades::fake(); $this->app->fastexcel->download('bar.xlsx'); $this->app->fastexcel->assertDownloaded('bar.xlsx');
and with assert data:
ExcelFacades::fake(); $original_collection = $this->collection(); $this->app->fastexcel->data($original_collection)->download('bar.xlsx'); $this->app->fastexcel->assertDownloaded('bar.xlsx', function ($data) use ($original_collection) { if ($data->toJson() == $original_collection->toJson()) { return true; } return false; });
It is convenient for developer to test their own code. this is very necessary, other project is required you, It can write test case 100% coverage. it can assert download:
and with assert data: