Skip to content

Commit 4ae8722

Browse files
committed
fix: corrects failing test
1 parent b1fef45 commit 4ae8722

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Models/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected static function castValueForProperty( ModelPropertyDefinition $definit
100100
case 'float':
101101
return (float) filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION );
102102
default:
103-
Config::throwInvalidArgumentException( "Unexpected type: '$type'. To support additional types, overload this method or use Definition casting." );
103+
Config::throwInvalidArgumentException( "Unexpected type: '{$type[0]}'. To support additional types, overload this method or use Definition casting." );
104104
}
105105
}
106106

tests/wpunit/ModelTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,8 @@ public function testFromDataShouldCreateInstanceWithCorrectTypes(): void {
314314
* @since 2.0.0
315315
*/
316316
public function testFromDataShouldThrowExceptionForNonPrimitiveTypes(): void {
317-
self::markTestSkipped( 'This is not finished yet.' );
318-
319317
$this->expectException( Config::getInvalidArgumentException() );
318+
$this->expectExceptionMessage( "Unexpected type: 'DateTime'. To support additional types, overload this method or use Definition casting." );
320319

321320
MockModel::fromData( [
322321
'id' => 1,

0 commit comments

Comments
 (0)