Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
"php": "^7.3",
"doctrine/dbal": "*",
"react/event-loop": "*",
"clue/block-react": "*",

"react/mysql": "*",
"clue/reactphp-sqlite": "*",
"voryx/pgasync": "*"
},
"require-dev": {
"clue/block-react": "*"
},
"autoload": {
"psr-4": {
"Drift\\DBAL\\": "src/"
Expand All @@ -29,4 +31,4 @@
"Drift\\DBAL\\Tests\\": "tests/"
}
}
}
}
11 changes: 9 additions & 2 deletions tests/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
*/
abstract class ConnectionTest extends TestCase
{
/**
* The timeout is used to prevent tests from endless waiting.
* Consider this amount of seconds as a reasonable timeout
* to understand that something went wrong.
*/
private const MAX_TIMEOUT = 3;

/**
* @param LoopInterface $loop
*
Expand Down Expand Up @@ -116,7 +123,7 @@ public function testQuery()
});
});

await($promise, $loop);
await($promise, $loop, self::MAX_TIMEOUT);
}

/**
Expand Down Expand Up @@ -170,6 +177,6 @@ public function testMultipleRows()
$this->assertEquals(2, $result->fetchCount());
});

await($promise, $loop);
await($promise, $loop, self::MAX_TIMEOUT);
}
}