Skip to content

Commit a3e5db3

Browse files
authored
Add test for missing/invalid model dateFormat
1 parent ef04957 commit a3e5db3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/system/Database/Live/ModelTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,20 @@ public function testThrowsWithNoPrimaryKey()
12231223

12241224
//--------------------------------------------------------------------
12251225

1226+
/**
1227+
* @expectedException \CodeIgniter\Exceptions\ModelException
1228+
* @expectedExceptionMessage `Tests\Support\Models\UserModel` model class does not have a valid dateFormat.
1229+
*/
1230+
public function testThrowsWithNoDateFormat()
1231+
{
1232+
$model = new UserModel();
1233+
$this->setPrivateProperty($model, 'dateFormat', '');
1234+
1235+
$model->find(1);
1236+
}
1237+
1238+
//--------------------------------------------------------------------
1239+
12261240
public function testInsertID()
12271241
{
12281242
$model = new JobModel();

0 commit comments

Comments
 (0)