Skip to content

Commit efde523

Browse files
committed
Changed assertion to seeInDatabase function
1 parent d8af403 commit efde523

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

tests/system/Models/InsertModelTest.php

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -404,27 +404,7 @@ public function testInsertBatchWithCasts(): void
404404

405405
$this->assertSame(2, $numRows);
406406

407-
$rows = $this->model->where('country', 'India')->findAll();
408-
409-
$this->assertNotEmpty($rows);
410-
$this->assertCount(2, $rows);
411-
412-
$smriti = $rows[0];
413-
$rahul = $rows[1];
414-
415-
$this->assertNotNull($smriti);
416-
$this->assertNotNull($rahul);
417-
418-
// Check Smriti
419-
$this->assertSame('Smriti', $smriti['name']);
420-
$this->assertIsArray($smriti['email']);
421-
$this->assertSame('[email protected]', $smriti['email']['personal']);
422-
$this->assertSame('[email protected]', $smriti['email']['work']);
423-
424-
// Check Rahul
425-
$this->assertSame('Rahul', $rahul['name']);
426-
$this->assertIsArray($rahul['email']);
427-
$this->assertSame('[email protected]', $rahul['email']['personal']);
428-
$this->assertSame('[email protected]', $rahul['email']['work']);
407+
$this->seeInDatabase('user', ['email' => json_encode($userData[0]['email'])]);
408+
$this->seeInDatabase('user', ['email' => json_encode($userData[1]['email'])]);
429409
}
430410
}

0 commit comments

Comments
 (0)