Skip to content

Commit

Permalink
Improvement de la suppression du vhost de test
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume DUBOST committed Mar 4, 2020
1 parent 536d01f commit 9eed5c8
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/RabbitContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public static function createVhosts()
foreach (self::$vhosts as $vhost) {
$vhost = str_replace('/', '%2f', $vhost);

try {
$client->delete("/api/vhosts/{$vhost}");
} catch (\Exception $e) {
// On ignore l'exception car le vhost n'existe peut être pas mais dans le doute on le supprime
}

$client->put("/api/vhosts/{$vhost}");
$client->put(
"/api/permissions/{$vhost}/guest",
Expand All @@ -50,20 +56,6 @@ public static function createVhosts()
}
}

/**
* @AfterSuite
*/
public static function deleteVhosts()
{
$client = self::getRabbitMqClient();

foreach (self::$vhosts as $vhost) {
$vhost = str_replace('/', '%2f', $vhost);
$client->delete("/api/vhosts/{$vhost}");
}
}


/**
* @Given /le producer "([^"]*)" devrait avoir publié un message dans la queue "([^"]*)"$/
*/
Expand Down

0 comments on commit 9eed5c8

Please sign in to comment.