Skip to content

Commit

Permalink
correcting test for sqlite and php 8.+
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Nov 24, 2023
1 parent 9e0fc82 commit 7618025
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions tests/database/Mvc/Model/ToArrayCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,30 +360,20 @@ public function mvcModelToArrayModelWithGetters(DatabaseTester $I)
$actual = $model->inv_id;
$I->assertEquals($expected, $actual);

/**
* sqlite returns strings
*/
if ('sqlite' === $I->getDriver()) {
$expected = [
'inv_id' => '4',
'inv_cst_id' => '1',
'inv_status_flag' => '0',
'inv_title' => $title . '!4',
'inv_total' => '111.26',
'inv_created_at' => $date,
];
} else {
$expected = [
'inv_id' => 4,
'inv_cst_id' => 1,
'inv_status_flag' => 0,
'inv_title' => $title . '!4',
'inv_total' => 111.26,
'inv_created_at' => $date,
];
};
$expected = [
'inv_id' => '4',
'inv_cst_id' => '1',
'inv_status_flag' => '0',
'inv_title' => $title . '!4',
'inv_total' => '111.26',
'inv_created_at' => $date,
];

$actual = $model->toArray();
$I->assertSame($expected, $actual);
/**
* assertEquals here because sqlite returns strings in different
* PHP versions
*/
$I->assertEquals($expected, $actual);
}
}

0 comments on commit 7618025

Please sign in to comment.