Skip to content

Commit

Permalink
✅ fix test too fast!
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek- committed Oct 12, 2024
1 parent 1c2e1fc commit 64fc798
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Functional/SubscriptionsApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use SwagIndustries\MercureRouter\Test\Functional\Tool\TestSubscriber;
use Symfony\Component\Mercure\Jwt\LcobucciFactory;
use function Amp\async;
use function Amp\delay;
use function Amp\Future\await;

class SubscriptionsApiTest extends AbstractFunctionalTest
Expand Down Expand Up @@ -110,6 +111,7 @@ public function testGetASpecificSubscription(): void
[,[$response, $content]] = await([
$subscriber1->subscribe(),
async(function () use ($client, $subscriber1) {
delay(1);
$topic = urlencode('https://example.com/my-topic');
// Let some time pass for the subscription to be established
$res = $client->get(
Expand Down Expand Up @@ -143,7 +145,7 @@ function (string $content) {
]);

$content = json_decode($content, true, flags: JSON_THROW_ON_ERROR);
var_dump($content);

$this->assertEquals($response->getRequest()->getUri()->getPath(), $content['id']);
$this->assertTrue($content['active']);
$this->assertEquals('https://example.com/my-topic', $content['topic']);
Expand Down

0 comments on commit 64fc798

Please sign in to comment.