rework of the e2e test suites
This commit is contained in:
30
app/Http/Controllers/Testing/TestMailboxController.php
Normal file
30
app/Http/Controllers/Testing/TestMailboxController.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Testing;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Testing\Mailbox;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class TestMailboxController extends Controller
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
abort_unless(app()->environment(['local', 'testing']), 404);
|
||||
|
||||
return response()->json([
|
||||
'data' => Mailbox::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy(): JsonResponse
|
||||
{
|
||||
abort_unless(app()->environment(['local', 'testing']), 404);
|
||||
|
||||
Mailbox::flush();
|
||||
|
||||
return response()->json([
|
||||
'status' => 'ok',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user