File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Functional/Driver/Common/Schema Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,28 @@ public function testAddBigIntegerFieldThrowsException(): void
8080 $ this ->modifier ->addBigIntegerColumn ('snowflake_column ' , 'snowflake ' );
8181 }
8282
83+ public function testAddSnowflakeField (): void
84+ {
85+ $ this ->modifier ->addSnowflakeColumn ('snowflake_column ' , 'snowflake ' );
86+
87+ $ entity = $ this ->registry ->getEntity (self ::ROLE_TEST );
88+ $ fields = $ entity ->getFields ();
89+
90+ $ this ->assertTrue ($ fields ->has ('snowflake ' ));
91+ $ this ->assertSame ('snowflake ' , $ fields ->get ('snowflake ' )->getType ());
92+ $ this ->assertSame ('snowflake_column ' , $ fields ->get ('snowflake ' )->getColumn ());
93+ }
94+
95+ public function testAddSnowflakeFieldThrowsException (): void
96+ {
97+ $ this ->modifier ->addStringColumn ('snowflake_column ' , 'snowflake ' );
98+
99+ $ this ->expectException (BehaviorCompilationException::class);
100+ $ this ->expectExceptionMessage ('Field snowflake must be of type snowflake. ' );
101+
102+ $ this ->modifier ->addSnowflakeColumn ('snowflake_column ' , 'snowflake ' );
103+ }
104+
83105 public function testAddUlidField (): void
84106 {
85107 $ this ->modifier ->addUlidColumn ('ulid_column ' , 'ulid ' );
Original file line number Diff line number Diff line change @@ -121,6 +121,22 @@ public function testIsStringTypeFalse(mixed $type): void
121121 $ this ->assertFalse (RegistryModifier::isStringType ($ type ));
122122 }
123123
124+ public function testIsSnowflakeTypeTrue (): void
125+ {
126+ $ this ->assertTrue (RegistryModifier::isSnowflakeType ('snowflake ' ));
127+ }
128+
129+ /**
130+ * @dataProvider integerDataProvider
131+ * @dataProvider datetimeDataProvider
132+ * @dataProvider invalidDataProvider
133+ * @dataProvider stringDataProvider
134+ */
135+ public function testIsSnowflakeTypeFalse (mixed $ type ): void
136+ {
137+ $ this ->assertFalse (RegistryModifier::isSnowflakeType ($ type ));
138+ }
139+
124140 public function testIsUlidTypeTrue (): void
125141 {
126142 $ this ->assertTrue (RegistryModifier::isUlidType ('ulid ' ));
You can’t perform that action at this time.
0 commit comments