Skip to content

Commit

Permalink
tests: enable fk in testing db
Browse files Browse the repository at this point in the history
  • Loading branch information
danigargar committed Oct 30, 2024
1 parent 99ca3d5 commit c2e0812
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function load(ObjectManager $manager)
$this->disableLifecycleEvents($manager);
$manager->getClassMetadata(ApplicationServerSetRelApplicationServer::class)->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
$manager->getConnection()->exec(
'INSERT INTO ApplicationServerSetRelApplicationServers(applicationServerId, applicationServerSetId ) SELECT id, 0 FROM ApplicationServers'
'INSERT INTO ApplicationServerSetRelApplicationServers(applicationServerId, applicationServerSetId ) SELECT id, 0 FROM ApplicationServers WHERE id != 3'
);

$item1 = $this->createEntityInstance(ApplicationServerSetRelApplicationServer::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ Feature: Retrieve application server sets
"id": 0,
"applicationServers": [
1,
2,
3
2
]
}
"""
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ Feature: Create companies
"routingTagIds": [
1
],
"codecIds": [
1
],
"codecIds": [],
"applicationServerSet": 1,
"mediaRelaySet": 1
}
Expand Down Expand Up @@ -359,8 +357,6 @@ Feature: Create companies
"routingTagIds": [
1
],
"codecIds": [
1
]
"codecIds": []
}
"""
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Remove application servers
Given I add Authorization header
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "DELETE" request to "/application_servers/2"
And I send a "DELETE" request to "/application_servers/3"
Then the response status code should be 204

@createSchema
Expand All @@ -17,4 +17,12 @@ Feature: Remove application servers
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "DELETE" request to "/application_servers/1"
Then the response status code should be 403
Then the response status code should be 500
And the response should be in JSON
And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
And the JSON should be like:
"""
{
"detail":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 19 FOREIGN KEY constraint failed"
}
"""
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ Feature: Retrieve applicationServers
"id": 0,
"applicationServers": [
1,
2,
3
2
]
}
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Manage application server set
Given I add Authorization header
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "DELETE" request to "/application_server_sets/1"
And I send a "DELETE" request to "/application_server_sets/2"
Then the response status code should be 204

@createSchema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Feature: Manage media relay sets
Given I add Authorization header
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "DELETE" request to "/media_relay_sets/1"
And I send a "DELETE" request to "/media_relay_sets/2"
Then the response status code should be 204

0 comments on commit c2e0812

Please sign in to comment.