@@ -162,12 +162,12 @@ public function testDefaultValues(): void
162
162
163
163
$ arClass ->loadDefaultValues ();
164
164
165
- $ this ->assertEquals (1 , $ arClass ->int_col2 );
166
- $ this ->assertEquals ('something ' , $ arClass ->char_col2 );
167
- $ this ->assertEquals (1.23 , $ arClass ->float_col2 );
168
- $ this ->assertEquals (33.22 , $ arClass ->numeric_col );
165
+ $ this ->assertSame (1 , $ arClass ->int_col2 );
166
+ $ this ->assertSame ('something ' , $ arClass ->char_col2 );
167
+ $ this ->assertSame (1.23 , $ arClass ->float_col2 );
168
+ $ this ->assertSame (33.22 , $ arClass ->numeric_col );
169
169
$ this ->assertTrue ($ arClass ->bool_col2 );
170
- $ this ->assertEquals ('2002-01-01 00:00:00 ' , $ arClass ->time );
170
+ $ this ->assertSame ('2002-01-01 00:00:00 ' , $ arClass ->time );
171
171
172
172
if ($ this ->db ()->getDriverName () !== 'mysql ' ) {
173
173
$ this ->assertSame (['a ' => 1 ], $ arClass ->json_col );
@@ -177,13 +177,13 @@ public function testDefaultValues(): void
177
177
$ arClass ->char_col2 = 'not something ' ;
178
178
179
179
$ arClass ->loadDefaultValues ();
180
- $ this ->assertEquals ('not something ' , $ arClass ->char_col2 );
180
+ $ this ->assertSame ('not something ' , $ arClass ->char_col2 );
181
181
182
182
$ arClass = new Type ();
183
183
$ arClass ->char_col2 = 'not something ' ;
184
184
185
185
$ arClass ->loadDefaultValues (false );
186
- $ this ->assertEquals ('something ' , $ arClass ->char_col2 );
186
+ $ this ->assertSame ('something ' , $ arClass ->char_col2 );
187
187
}
188
188
189
189
public function testCastValues (): void
@@ -219,8 +219,8 @@ public function testCastValues(): void
219
219
$ this ->assertSame ('test123 ' , $ query ->char_col3 );
220
220
$ this ->assertSame (3.742 , $ query ->float_col );
221
221
$ this ->assertSame (42.1337 , $ query ->float_col2 );
222
- $ this ->assertEquals ( true , $ query ->bool_col );
223
- $ this ->assertEquals ( false , $ query ->bool_col2 );
222
+ $ this ->assertTrue ( $ query ->bool_col );
223
+ $ this ->assertFalse ( $ query ->bool_col2 );
224
224
$ this ->assertSame (['a ' => 'b ' , 'c ' => null , 'd ' => [1 , 2 , 3 ]], $ query ->json_col );
225
225
}
226
226
@@ -452,12 +452,9 @@ public function testSetProperties(): void
452
452
'name ' => 'samdark ' ,
453
453
'address ' => 'rusia ' ,
454
454
'status ' => 1 ,
455
+ 'bool_status ' => true ,
455
456
];
456
457
457
- if ($ this ->db ()->getDriverName () === 'pgsql ' ) {
458
- $ properties ['bool_status ' ] = true ;
459
- }
460
-
461
458
$ properties ['profile_id ' ] = null ;
462
459
463
460
$ customer = new Customer ();
@@ -564,25 +561,25 @@ public function testBooleanProperty(): void
564
561
565
562
$ customer ->setName ('boolean customer ' );
566
563
$ customer->
setEmail (
'[email protected] ' );
567
- $ customer ->setStatus ( 1 );
564
+ $ customer ->setBoolStatus ( true );
568
565
569
566
$ customer ->save ();
570
567
$ customer ->refresh ();
571
- $ this ->assertEquals ( 1 , $ customer ->getStatus ());
568
+ $ this ->assertTrue ( $ customer ->getBoolStatus ());
572
569
573
- $ customer ->setStatus ( 0 );
570
+ $ customer ->setBoolStatus ( false );
574
571
$ customer ->save ();
575
572
576
573
$ customer ->refresh ();
577
- $ this ->assertEquals ( 0 , $ customer ->getStatus ());
574
+ $ this ->assertFalse ( $ customer ->getBoolStatus ());
578
575
579
576
$ customerQuery = new ActiveQuery (Customer::class);
580
- $ customers = $ customerQuery ->where (['status ' => 1 ])->all ();
577
+ $ customers = $ customerQuery ->where (['bool_status ' => true ])->all ();
581
578
$ this ->assertCount (2 , $ customers );
582
579
583
580
$ customerQuery = new ActiveQuery (Customer::class);
584
- $ customers = $ customerQuery ->where (['status ' => 0 ])->all ();
585
- $ this ->assertCount (1 , $ customers );
581
+ $ customers = $ customerQuery ->where (['bool_status ' => false ])->all ();
582
+ $ this ->assertCount (2 , $ customers );
586
583
}
587
584
588
585
public function testPropertyAccess (): void
@@ -823,7 +820,7 @@ public function testGetDirtyValuesOnNewRecord(): void
823
820
$ customer->
set (
'email ' ,
'[email protected] ' );
824
821
$ customer ->set ('address ' , null );
825
822
826
- $ this ->assertEquals ([], $ customer ->newValues ([]));
823
+ $ this ->assertSame ([], $ customer ->newValues ([]));
827
824
828
825
$ this ->assertEquals (
829
826
[
@@ -836,7 +833,7 @@ public function testGetDirtyValuesOnNewRecord(): void
836
833
],
837
834
$ customer ->newValues ()
838
835
);
839
- $ this ->assertEquals (
836
+ $ this ->assertSame (
840
837
[
841
838
842
839
'address ' => null ,
0 commit comments