Skip to content

Commit

Permalink
fix(test):fix tests (not truncate table run test after)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezzzhak committed Aug 11, 2022
1 parent 2ed0f0e commit 29a317f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"require-dev": {
"symfony/event-dispatcher-contracts": "2.2.0",
"codeception/codeception": "4.1.22",
"codeception/module-asserts": "1.3",
"codeception/module-yii2": "1.1"
"codeception/module-asserts": "^2.0",
"codeception/module-yii2": "^1.1"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/ClickHouseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class ClickHouseTest extends Unit
*/
protected $tester;



protected function _before()
{
$db = $this->getDb();
Expand Down Expand Up @@ -62,14 +60,16 @@ protected function _before()
) ENGINE = MergeTree(event_date, (event_date, user_id), 8192);')
->execute();

$db->createCommand('TRUNCATE TABLE IF EXISTS `test_stat`')->execute();

$db->createCommand()->insert('test_stat', [
'event_date' => date('Y-m-d'),
'user_id' => 5
])->execute();

$db->createCommand()->insert('test_stat', [
'event_date' => date('Y-m-d', strtotime('-1 days')),
'time' => time(),
'time' => time() - 3600,
'user_id' => 5
])->execute();

Expand Down

0 comments on commit 29a317f

Please sign in to comment.