Add & validate MySQL tests

This commit is contained in:
Bubka
2022-04-01 13:35:59 +02:00
parent fd1ea631f2
commit b0b648cf80
10 changed files with 106 additions and 37 deletions

View File

@@ -67,8 +67,7 @@ class GroupControllerTest extends FeatureTestCase
'name' => 'My second group',
])
->assertCreated()
->assertExactJson([
'id' => 1,
->assertJsonFragment([
'name' => 'My second group',
'twofaccounts_count' => 0,
]);
@@ -100,8 +99,7 @@ class GroupControllerTest extends FeatureTestCase
$response = $this->actingAs($this->user, 'api-guard')
->json('GET', '/api/v1/groups/' . $group->id)
->assertOk()
->assertExactJson([
'id' => 1,
->assertJsonFragment([
'name' => 'My group',
'twofaccounts_count' => 0,
]);
@@ -134,8 +132,7 @@ class GroupControllerTest extends FeatureTestCase
'name' => 'name updated',
])
->assertOk()
->assertExactJson([
'id' => 1,
->assertJsonFragment([
'name' => 'name updated',
'twofaccounts_count' => 0,
]);
@@ -183,7 +180,7 @@ class GroupControllerTest extends FeatureTestCase
$response = $this->actingAs($this->user, 'api-guard')
->json('POST', '/api/v1/groups/' . $group->id . '/assign', [
'ids' => [1,2],
'ids' => [$accounts[0]->id, $accounts[1]->id],
])
->assertOk()
->assertExactJson([
@@ -203,7 +200,7 @@ class GroupControllerTest extends FeatureTestCase
$response = $this->actingAs($this->user, 'api-guard')
->json('POST', '/api/v1/groups/1000/assign', [
'ids' => [1,2],
'ids' => [$accounts[0]->id, $accounts[1]->id],
])
->assertNotFound()
->assertJsonStructure([
@@ -238,7 +235,7 @@ class GroupControllerTest extends FeatureTestCase
$assign = $this->actingAs($this->user, 'api-guard')
->json('POST', '/api/v1/groups/' . $group->id . '/assign', [
'ids' => [1,2],
'ids' => [$accounts[0]->id, $accounts[1]->id],
]);
$response = $this->actingAs($this->user, 'api-guard')
@@ -271,7 +268,7 @@ class GroupControllerTest extends FeatureTestCase
$assign = $this->actingAs($this->user, 'api-guard')
->json('POST', '/api/v1/groups/' . $group->id . '/assign', [
'ids' => [1,2],
'ids' => [$accounts[0]->id, $accounts[1]->id],
]);
$response = $this->actingAs($this->user, 'api-guard')