@@ -44,7 +44,7 @@ protected function setUp(): void
44
44
$ this ->type = Type::getType ('ulid ' );
45
45
}
46
46
47
- public function testUlidConvertsToDatabaseValue (): void
47
+ public function testUlidConvertsToDatabaseValue ()
48
48
{
49
49
$ ulid = Ulid::fromString (self ::DUMMY_ULID );
50
50
@@ -54,7 +54,7 @@ public function testUlidConvertsToDatabaseValue(): void
54
54
$ this ->assertEquals ($ expected , $ actual );
55
55
}
56
56
57
- public function testUlidInterfaceConvertsToDatabaseValue (): void
57
+ public function testUlidInterfaceConvertsToDatabaseValue ()
58
58
{
59
59
$ ulid = $ this ->createMock (AbstractUid::class);
60
60
@@ -68,79 +68,71 @@ public function testUlidInterfaceConvertsToDatabaseValue(): void
68
68
$ this ->assertEquals ('foo ' , $ actual );
69
69
}
70
70
71
- public function testUlidStringConvertsToDatabaseValue (): void
72
- {
73
- $ actual = $ this ->type ->convertToDatabaseValue (self ::DUMMY_ULID , $ this ->platform );
74
- $ ulid = Ulid::fromString (self ::DUMMY_ULID );
75
-
76
- $ expected = $ ulid ->toRfc4122 ();
77
-
78
- $ this ->assertEquals ($ expected , $ actual );
79
- }
80
-
81
- public function testInvalidUlidConversionForDatabaseValue (): void
71
+ public function testNotSupportedUlidStringConversionToDatabaseValue ()
82
72
{
83
73
$ this ->expectException (ConversionException::class);
84
74
85
- $ this ->type ->convertToDatabaseValue (' abcdefg ' , $ this ->platform );
75
+ $ this ->type ->convertToDatabaseValue (self :: DUMMY_ULID , $ this ->platform );
86
76
}
87
77
88
78
public function testNotSupportedTypeConversionForDatabaseValue ()
89
79
{
90
- $ this ->assertNull ($ this ->type ->convertToDatabaseValue (new \stdClass (), $ this ->platform ));
80
+ $ this ->expectException (ConversionException::class);
81
+
82
+ $ this ->type ->convertToDatabaseValue (new \stdClass (), $ this ->platform );
91
83
}
92
84
93
- public function testNullConversionForDatabaseValue (): void
85
+ public function testNullConversionForDatabaseValue ()
94
86
{
95
87
$ this ->assertNull ($ this ->type ->convertToDatabaseValue (null , $ this ->platform ));
96
88
}
97
89
98
- public function testUlidInterfaceConvertsToPHPValue (): void
90
+ public function testUlidInterfaceConvertsToPHPValue ()
99
91
{
100
92
$ ulid = $ this ->createMock (AbstractUid::class);
101
93
$ actual = $ this ->type ->convertToPHPValue ($ ulid , $ this ->platform );
102
94
103
95
$ this ->assertSame ($ ulid , $ actual );
104
96
}
105
97
106
- public function testUlidConvertsToPHPValue (): void
98
+ public function testUlidConvertsToPHPValue ()
107
99
{
108
100
$ ulid = $ this ->type ->convertToPHPValue (self ::DUMMY_ULID , $ this ->platform );
109
101
110
102
$ this ->assertInstanceOf (Ulid::class, $ ulid );
111
103
$ this ->assertEquals (self ::DUMMY_ULID , $ ulid ->__toString ());
112
104
}
113
105
114
- public function testInvalidUlidConversionForPHPValue (): void
106
+ public function testInvalidUlidConversionForPHPValue ()
115
107
{
116
108
$ this ->expectException (ConversionException::class);
117
109
118
110
$ this ->type ->convertToPHPValue ('abcdefg ' , $ this ->platform );
119
111
}
120
112
121
- public function testNullConversionForPHPValue (): void
113
+ public function testNullConversionForPHPValue ()
122
114
{
123
115
$ this ->assertNull ($ this ->type ->convertToPHPValue (null , $ this ->platform ));
124
116
}
125
117
126
- public function testReturnValueIfUlidForPHPValue (): void
118
+ public function testReturnValueIfUlidForPHPValue ()
127
119
{
128
120
$ ulid = new Ulid ();
129
121
130
122
$ this ->assertSame ($ ulid , $ this ->type ->convertToPHPValue ($ ulid , $ this ->platform ));
131
123
}
132
124
133
- public function testGetName (): void
125
+ public function testGetName ()
134
126
{
135
127
$ this ->assertEquals ('ulid ' , $ this ->type ->getName ());
136
128
}
137
129
138
- public function testGetGuidTypeDeclarationSQL (): void
130
+ public function testGetGuidTypeDeclarationSQL ()
139
131
{
140
132
$ this ->assertEquals ('DUMMYVARCHAR() ' , $ this ->type ->getSqlDeclaration (['length ' => 36 ], $ this ->platform ));
141
133
}
142
134
143
- public function testRequiresSQLCommentHint (): void
135
+ public function testRequiresSQLCommentHint ()
144
136
{
145
137
$ this ->assertTrue ($ this ->type ->requiresSQLCommentHint ($ this ->platform ));
146
138
}
0 commit comments