@@ -37,12 +37,12 @@ public static function get_schema_history(): array {
3737 $ callable = function () use ( $ table_name ) {
3838 $ columns = new Column_Collection ();
3939
40- // Primary key
40+ // Primary key.
4141 $ columns [] = ( new ID ( 'id ' ) )
4242 ->set_length ( 11 )
4343 ->set_type ( Column_Types::INT );
4444
45- // Using Boolean_Column class
45+ // Using Boolean_Column class.
4646 $ columns [] = ( new Boolean_Column ( 'active_flag ' ) )
4747 ->set_default ( true );
4848
@@ -52,13 +52,13 @@ public static function get_schema_history(): array {
5252 $ columns [] = ( new Boolean_Column ( 'featured_flag ' ) )
5353 ->set_nullable ( true );
5454
55- // Using different Boolean column types
55+ // Using different Boolean column types.
5656 $ columns [] = ( new Boolean_Column ( 'bit_flag ' ) )
5757 ->set_type ( Column_Types::BIT );
5858
5959 $ columns [] = new Boolean_Column ( 'boolean_flag ' );
6060
61- // Using Blob_Column class with different types
61+ // Using Blob_Column class with different types.
6262 $ columns [] = ( new Blob_Column ( 'tiny_data ' ) )
6363 ->set_type ( Column_Types::TINYBLOB );
6464
@@ -71,7 +71,7 @@ public static function get_schema_history(): array {
7171 $ columns [] = ( new Blob_Column ( 'long_data ' ) )
7272 ->set_type ( Column_Types::LONGBLOB );
7373
74- // Blob column with JSON PHP type
74+ // Blob column with JSON PHP type.
7575 $ columns [] = ( new Blob_Column ( 'json_blob_data ' ) )
7676 ->set_type ( Column_Types::BLOB )
7777 ->set_php_type ( PHP_Types::JSON );
@@ -80,7 +80,7 @@ public static function get_schema_history(): array {
8080 ->set_type ( Column_Types::BLOB )
8181 ->set_php_type ( PHP_Types::STRING );
8282
83- // Regular column for reference
83+ // Regular column for reference.
8484 $ columns [] = ( new String_Column ( 'name ' ) )
8585 ->set_length ( 255 );
8686
@@ -102,13 +102,13 @@ public static function get_schema_history(): array {
102102 public function should_create_boolean_columns_with_proper_types () {
103103 $ column = new Boolean_Column ( 'test_bool ' );
104104
105- // Test default type is BOOLEAN
105+ // Test default type is BOOLEAN.
106106 $ this ->assertEquals ( Column_Types::BOOLEAN , $ column ->get_type () );
107107
108- // Test PHP type is BOOL
108+ // Test PHP type is BOOL.
109109 $ this ->assertEquals ( PHP_Types::BOOL , $ column ->get_php_type () );
110110
111- // Test different boolean types
111+ // Test different boolean types.
112112 $ column ->set_type ( Column_Types::BIT );
113113 $ this ->assertEquals ( Column_Types::BIT , $ column ->get_type () );
114114 }
@@ -121,17 +121,17 @@ public function should_create_boolean_columns_with_proper_types() {
121121 public function should_create_blob_columns_with_proper_types () {
122122 $ column = new Blob_Column ( 'test_blob ' );
123123
124- // Test default type is BLOB
124+ // Test default type is BLOB.
125125 $ this ->assertEquals ( Column_Types::BLOB , $ column ->get_type () );
126126
127- // Test PHP type is BLOB
127+ // Test PHP type is BLOB.
128128 $ this ->assertEquals ( PHP_Types::BLOB , $ column ->get_php_type () );
129129
130- // Test different blob types
130+ // Test different blob types.
131131 $ column ->set_type ( Column_Types::MEDIUMBLOB );
132132 $ this ->assertEquals ( Column_Types::MEDIUMBLOB , $ column ->get_type () );
133133
134- // Test JSON PHP type
134+ // Test JSON PHP type.
135135 $ column ->set_php_type ( PHP_Types::JSON );
136136 $ this ->assertEquals ( PHP_Types::JSON , $ column ->get_php_type () );
137137 }
@@ -147,7 +147,7 @@ public function should_create_table_with_column_classes() {
147147
148148 $ this ->assertTrue ( $ table ->exists () );
149149
150- // Verify columns exist
150+ // Verify columns exist.
151151 $ columns = $ table ::get_columns ();
152152 $ this ->assertNotNull ( $ columns ->get ( 'active_flag ' ) );
153153 $ this ->assertNotNull ( $ columns ->get ( 'published_flag ' ) );
@@ -170,7 +170,7 @@ public function should_respect_boolean_column_defaults() {
170170 $ table = $ this ->get_column_types_test_table ();
171171 Register::table ( $ table );
172172
173- // Insert with minimal data to test defaults
173+ // Insert with minimal data to test defaults.
174174 $ data = [
175175 'name ' => 'Test Defaults ' ,
176176 'tiny_data ' => 'tiny ' ,
@@ -185,13 +185,13 @@ public function should_respect_boolean_column_defaults() {
185185 $ insert_id = $ wpdb ->insert_id ;
186186 $ retrieved = $ table ::get_by_id ( $ insert_id );
187187
188- // active_flag default is true
188+ // active_flag default is true.
189189 $ this ->assertTrue ( $ retrieved ['active_flag ' ] );
190190
191- // published_flag default is false
191+ // published_flag default is false.
192192 $ this ->assertFalse ( $ retrieved ['published_flag ' ] );
193193
194- // featured_flag is nullable and should be null
194+ // featured_flag is nullable and should be null.
195195 $ this ->assertNull ( $ retrieved ['featured_flag ' ] );
196196 }
197197
@@ -233,7 +233,7 @@ public function should_handle_json_in_blob_columns() {
233233 $ insert_id = $ wpdb ->insert_id ;
234234 $ retrieved = $ table ::get_by_id ( $ insert_id );
235235
236- // json_blob_data should be decoded back to array
236+ // json_blob_data should be decoded back to array.
237237 $ this ->assertIsArray ( $ retrieved ['json_blob_data ' ] );
238238 $ this ->assertEquals ( $ complex_json ['nested ' ]['array ' ], $ retrieved ['json_blob_data ' ]['nested ' ]['array ' ] );
239239 $ this ->assertEquals ( $ complex_json ['special_chars ' ], $ retrieved ['json_blob_data ' ]['special_chars ' ] );
@@ -250,7 +250,7 @@ public function should_query_different_boolean_types() {
250250 $ table = $ this ->get_column_types_test_table ();
251251 Register::table ( $ table );
252252
253- // Insert test data
253+ // Insert test data.
254254 $ test_data = [
255255 [
256256 'name ' => 'All True ' ,
@@ -294,7 +294,7 @@ public function should_query_different_boolean_types() {
294294 $ table ::insert ( $ data );
295295 }
296296
297- // Query by different boolean columns
297+ // Query by different boolean columns.
298298 $ active_results = $ table ::get_all_by ( 'active_flag ' , true );
299299 $ this ->assertCount ( 2 , $ active_results ); // "All True" and "Mixed"
300300
@@ -304,7 +304,7 @@ public function should_query_different_boolean_types() {
304304 $ boolean_false_results = $ table ::get_all_by ( 'boolean_flag ' , false );
305305 $ this ->assertCount ( 2 , $ boolean_false_results ); // "All False" and "Mixed"
306306
307- // Test nullable featured_flag
307+ // Test nullable featured_flag.
308308 $ featured_true = $ table ::get_all_by ( 'featured_flag ' , true );
309309 $ this ->assertCount ( 1 , $ featured_true );
310310 $ this ->assertEquals ( 'All True ' , $ featured_true [0 ]['name ' ] );
@@ -321,7 +321,7 @@ public function should_update_boolean_and_blob_columns() {
321321 $ table = $ this ->get_column_types_test_table ();
322322 Register::table ( $ table );
323323
324- // Insert initial data
324+ // Insert initial data.
325325 $ initial = [
326326 'name ' => 'Update Test ' ,
327327 'active_flag ' => true ,
@@ -338,7 +338,7 @@ public function should_update_boolean_and_blob_columns() {
338338 $ table ::insert ( $ initial );
339339 $ insert_id = $ wpdb ->insert_id ;
340340
341- // Update with new values
341+ // Update with new values.
342342 $ update = [
343343 'id ' => $ insert_id ,
344344 'active_flag ' => false ,
@@ -352,25 +352,25 @@ public function should_update_boolean_and_blob_columns() {
352352 $ result = $ table ::update_single ( $ update );
353353 $ this ->assertTrue ( $ result );
354354
355- // Retrieve and verify
355+ // Retrieve and verify.
356356 $ updated = $ table ::get_by_id ( $ insert_id );
357357
358- // Check boolean updates
358+ // Check boolean updates.
359359 $ this ->assertFalse ( $ updated ['active_flag ' ] );
360360 $ this ->assertTrue ( $ updated ['published_flag ' ] );
361361 $ this ->assertFalse ( $ updated ['bit_flag ' ] );
362362 $ this ->assertFalse ( $ updated ['boolean_flag ' ] );
363363
364- // Check blob updates
364+ // Check blob updates.
365365 $ this ->assertStringContainsString ( 'updated_blob_ ' , $ updated ['blob_data ' ] );
366366 $ this ->assertStringContainsString ( str_repeat ( 'X ' , 1000 ), $ updated ['blob_data ' ] );
367367
368- // Check JSON blob update
368+ // Check JSON blob update.
369369 $ json_data = $ updated ['json_blob_data ' ];
370370 $ this ->assertEquals ( 2 , $ json_data ['version ' ] );
371371 $ this ->assertTrue ( $ json_data ['updated ' ] );
372372
373- // Check unchanged values
373+ // Check unchanged values.
374374 $ this ->assertEquals ( 'initial_tiny ' , $ updated ['tiny_data ' ] );
375375 $ this ->assertEquals ( 'initial_medium ' , $ updated ['medium_data ' ] );
376376 }
0 commit comments