File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 2020testPositiveInt (IntegerPositive::fromInt (10 )->value ());
2121testNonNegativeInt (IntegerNonNegative::fromInt (10 )->value ());
2222testWeekDayInt (IntegerWeekDay::fromInt (7 )->value ());
23- echo WeekDay::fromInt (7 )->value () . PHP_EOL ;
23+ echo WeekDay::fromInt (7 )->value () . \ PHP_EOL ;
2424
2525// DB tinyint usage
2626echo Tiny::fromInt (-5 )->toString () . \PHP_EOL ;
Original file line number Diff line number Diff line change 1616} catch (UndefinedTypeException $ e ) {
1717 // suppress
1818}
19+ try {
20+ UndefinedStandard::create ()->toInt ();
21+ } catch (UndefinedTypeException $ e ) {
22+ // suppress
23+ }
24+ try {
25+ UndefinedStandard::create ()->toFloat ();
26+ } catch (UndefinedTypeException $ e ) {
27+ // suppress
28+ }
1929try {
2030 NotExist::create ()->value ();
2131} catch (UndefinedTypeException $ e ) {
Original file line number Diff line number Diff line change 1616 ->toThrow (UndefinedTypeException::class, 'Undefined type cannot be converted to string. ' );
1717});
1818
19+ it ('throws on toInt for UndefinedStandard ' , function (): void {
20+ $ u = UndefinedStandard::create ();
21+ expect (fn () => $ u ->toInt ())
22+ ->toThrow (UndefinedTypeException::class, 'Undefined type cannot be converted to integer. ' );
23+ });
24+
25+ it ('throws on toFloat for UndefinedStandard ' , function (): void {
26+ $ u = UndefinedStandard::create ();
27+ expect (fn () => $ u ->toFloat ())
28+ ->toThrow (UndefinedTypeException::class, 'Undefined type cannot be converted to float. ' );
29+ });
30+
1931it ('throws on value for UndefinedStandard ' , function (): void {
2032 $ u = UndefinedStandard::create ();
2133 expect (fn () => $ u ->value ())
You can’t perform that action at this time.
0 commit comments