Simplify tests

This commit is contained in:
philipp lang 2023-06-07 21:43:11 +02:00 committed by Philipp Lang
parent a880333f35
commit 36dcff9738
2 changed files with 4 additions and 38 deletions

View File

@ -1,38 +0,0 @@
<?php
namespace Tests\Feature\Mailgateway;
use App\Mailgateway\Types\LocalType;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class LocalGatewayCreateTest extends TestCase
{
use DatabaseTransactions;
public function testItCanCreateALocalGateway(): void
{
$this->login()->loginNami();
$this->withoutExceptionHandling();
$response = $this->post('/api/mailgateway', [
'type' => [
'cls' => LocalType::class,
'params' => [],
],
'name' => 'lala',
'domain' => 'example.com',
]);
$response->assertOk();
$this->assertDatabaseHas('mailgateways', [
'name' => 'lala',
'domain' => 'example.com',
'type' => json_encode([
'cls' => LocalType::class,
'params' => [],
]),
]);
}
}

View File

@ -27,6 +27,10 @@ class StoreTest extends TestCase
$this->assertDatabaseHas('mailgateways', [
'domain' => 'example.com',
'name' => 'lala',
'type' => json_encode([
'cls' => LocalType::class,
'params' => [],
]),
]);
}
}