Skip to content

Commit

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

$expected = [
'inv_id' => 4,
'inv_cst_id' => 1,
'inv_status_flag' => 0,
'inv_title' => $title . '!4',
'inv_total' => 111.26,
'inv_created_at' => $date,
];
/**
* 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,
];
};

$actual = $model->toArray();
$I->assertSame($expected, $actual);
}
Expand Down

0 comments on commit 9e0fc82

Please sign in to comment.