@@ -311,7 +311,7 @@ public function testLike()
311
311
// case : str%
312
312
$ m ->addCondition ('country ' , 'LIKE ' , 'La% ' );
313
313
$ result = $ m ->action ('select ' )->getRows ();
314
- $ this ->assertSame (3 , count ( $ result) );
314
+ $ this ->assertCount (3 , $ result );
315
315
$ this ->assertSame ($ dbDataCountries [3 ], $ result [3 ]);
316
316
$ this ->assertSame ($ dbDataCountries [7 ], $ result [7 ]);
317
317
$ this ->assertSame ($ dbDataCountries [9 ], $ result [9 ]);
@@ -322,7 +322,7 @@ public function testLike()
322
322
$ m ->scope ()->clear ();
323
323
$ m ->addCondition ('country ' , 'NOT LIKE ' , 'La% ' );
324
324
$ result = $ m ->action ('select ' )->getRows ();
325
- $ this ->assertSame (7 , count ( $ m ->export () ));
325
+ $ this ->assertCount (7 , $ m ->export ());
326
326
$ this ->assertSame ($ dbDataCountries [1 ], $ result [1 ]);
327
327
$ this ->assertSame ($ dbDataCountries [2 ], $ result [2 ]);
328
328
$ this ->assertSame ($ dbDataCountries [4 ], $ result [4 ]);
@@ -335,7 +335,7 @@ public function testLike()
335
335
$ m ->scope ()->clear ();
336
336
$ m ->addCondition ('country ' , 'LIKE ' , '%ia ' );
337
337
$ result = $ m ->action ('select ' )->getRows ();
338
- $ this ->assertSame (4 , count ( $ result) );
338
+ $ this ->assertCount (4 , $ result );
339
339
$ this ->assertSame ($ dbDataCountries [3 ], $ result [3 ]);
340
340
$ this ->assertSame ($ dbDataCountries [7 ], $ result [7 ]);
341
341
$ this ->assertSame ($ dbDataCountries [8 ], $ result [8 ]);
@@ -347,7 +347,7 @@ public function testLike()
347
347
$ m ->scope ()->clear ();
348
348
$ m ->addCondition ('country ' , 'LIKE ' , '%a% ' );
349
349
$ result = $ m ->action ('select ' )->getRows ();
350
- $ this ->assertSame (8 , count ( $ result) );
350
+ $ this ->assertCount (8 , $ result );
351
351
$ this ->assertSame ($ dbDataCountries [1 ], $ result [1 ]);
352
352
$ this ->assertSame ($ dbDataCountries [2 ], $ result [2 ]);
353
353
$ this ->assertSame ($ dbDataCountries [3 ], $ result [3 ]);
@@ -361,36 +361,36 @@ public function testLike()
361
361
// case : boolean field
362
362
$ m ->scope ()->clear ();
363
363
$ m ->addCondition ('active ' , 'LIKE ' , '0 ' );
364
- $ this ->assertSame (4 , count ( $ m ->export () ));
364
+ $ this ->assertCount (4 , $ m ->export ());
365
365
366
366
$ m ->scope ()->clear ();
367
367
$ m ->addCondition ('active ' , 'LIKE ' , '1 ' );
368
- $ this ->assertSame (6 , count ( $ m ->export () ));
368
+ $ this ->assertCount (6 , $ m ->export ());
369
369
370
370
$ m ->scope ()->clear ();
371
371
$ m ->addCondition ('active ' , 'LIKE ' , '%0% ' );
372
- $ this ->assertSame (4 , count ( $ m ->export () ));
372
+ $ this ->assertCount (4 , $ m ->export ());
373
373
374
374
$ m ->scope ()->clear ();
375
375
$ m ->addCondition ('active ' , 'LIKE ' , '%1% ' );
376
- $ this ->assertSame (6 , count ( $ m ->export () ));
376
+ $ this ->assertCount (6 , $ m ->export ());
377
377
378
378
$ m ->scope ()->clear ();
379
379
$ m ->addCondition ('active ' , 'LIKE ' , '%999% ' );
380
- $ this ->assertSame (0 , count ( $ m ->export () ));
380
+ $ this ->assertCount (0 , $ m ->export ());
381
381
382
382
$ m ->scope ()->clear ();
383
383
$ m ->addCondition ('active ' , 'LIKE ' , '%ABC% ' );
384
- $ this ->assertSame (0 , count ( $ m ->export () ));
384
+ $ this ->assertCount (0 , $ m ->export ());
385
385
386
386
// null value
387
387
$ m ->scope ()->clear ();
388
388
$ m ->addCondition ('code ' , '= ' , null );
389
- $ this ->assertSame (1 , count ( $ m ->export () ));
389
+ $ this ->assertCount (1 , $ m ->export ());
390
390
391
391
$ m ->scope ()->clear ();
392
392
$ m ->addCondition ('code ' , '!= ' , null );
393
- $ this ->assertSame (9 , count ( $ m ->export () ));
393
+ $ this ->assertCount (9 , $ m ->export ());
394
394
}
395
395
396
396
/**
@@ -424,7 +424,7 @@ public function testConditions()
424
424
$ m ->scope ()->clear ();
425
425
$ m ->addCondition ('country ' , 'REGEXP ' , 'Ireland|UK ' );
426
426
$ result = $ m ->action ('select ' )->getRows ();
427
- $ this ->assertSame (5 , count ( $ result) );
427
+ $ this ->assertCount (5 , $ result );
428
428
$ this ->assertSame ($ dbDataCountries [1 ], $ result [1 ]);
429
429
$ this ->assertSame ($ dbDataCountries [2 ], $ result [2 ]);
430
430
$ this ->assertSame ($ dbDataCountries [4 ], $ result [4 ]);
@@ -436,23 +436,23 @@ public function testConditions()
436
436
$ m ->scope ()->clear ();
437
437
$ m ->addCondition ('country ' , 'NOT REGEXP ' , 'Ireland|UK|Latvia ' );
438
438
$ result = $ m ->action ('select ' )->getRows ();
439
- $ this ->assertSame (1 , count ( $ result) );
439
+ $ this ->assertCount (1 , $ result );
440
440
$ this ->assertSame ($ dbDataCountries [8 ], $ result [8 ]);
441
441
unset($ result );
442
442
$ m ->unload ();
443
443
444
444
$ m ->scope ()->clear ();
445
445
$ m ->addCondition ('code ' , '> ' , 18 );
446
446
$ result = $ m ->action ('select ' )->getRows ();
447
- $ this ->assertSame (1 , count ( $ result) );
447
+ $ this ->assertCount (1 , $ result );
448
448
$ this ->assertSame ($ dbDataCountries [9 ], $ result [9 ]);
449
449
unset($ result );
450
450
$ m ->unload ();
451
451
452
452
$ m ->scope ()->clear ();
453
453
$ m ->addCondition ('code ' , '>= ' , 18 );
454
454
$ result = $ m ->action ('select ' )->getRows ();
455
- $ this ->assertSame (2 , count ( $ result) );
455
+ $ this ->assertCount (2 , $ result );
456
456
$ this ->assertSame ($ dbDataCountries [8 ], $ result [8 ]);
457
457
$ this ->assertSame ($ dbDataCountries [9 ], $ result [9 ]);
458
458
unset($ result );
@@ -461,15 +461,15 @@ public function testConditions()
461
461
$ m ->scope ()->clear ();
462
462
$ m ->addCondition ('code ' , '< ' , 12 );
463
463
$ result = $ m ->action ('select ' )->getRows ();
464
- $ this ->assertSame (1 , count ( $ result) );
464
+ $ this ->assertCount (1 , $ result );
465
465
$ this ->assertSame ($ dbDataCountries [1 ], $ result [1 ]);
466
466
unset($ result );
467
467
$ m ->unload ();
468
468
469
469
$ m ->scope ()->clear ();
470
470
$ m ->addCondition ('code ' , '<= ' , 12 );
471
471
$ result = $ m ->action ('select ' )->getRows ();
472
- $ this ->assertSame (2 , count ( $ result) );
472
+ $ this ->assertCount (2 , $ result );
473
473
$ this ->assertSame ($ dbDataCountries [1 ], $ result [1 ]);
474
474
$ this ->assertSame ($ dbDataCountries [2 ], $ result [2 ]);
475
475
unset($ result );
@@ -478,7 +478,7 @@ public function testConditions()
478
478
$ m ->scope ()->clear ();
479
479
$ m ->addCondition ('code ' , [11 , 12 ]);
480
480
$ result = $ m ->action ('select ' )->getRows ();
481
- $ this ->assertSame (2 , count ( $ result) );
481
+ $ this ->assertCount (2 , $ result );
482
482
$ this ->assertSame ($ dbDataCountries [1 ], $ result [1 ]);
483
483
$ this ->assertSame ($ dbDataCountries [2 ], $ result [2 ]);
484
484
unset($ result );
@@ -487,14 +487,14 @@ public function testConditions()
487
487
$ m ->scope ()->clear ();
488
488
$ m ->addCondition ('code ' , 'IN ' , []);
489
489
$ result = $ m ->action ('select ' )->getRows ();
490
- $ this ->assertSame (0 , count ( $ result) );
490
+ $ this ->assertCount (0 , $ result );
491
491
unset($ result );
492
492
$ m ->unload ();
493
493
494
494
$ m ->scope ()->clear ();
495
495
$ m ->addCondition ('code ' , 'NOT IN ' , [11 , 12 , 13 , 14 , 15 , 16 , 17 ]);
496
496
$ result = $ m ->action ('select ' )->getRows ();
497
- $ this ->assertSame (2 , count ( $ result) );
497
+ $ this ->assertCount (2 , $ result );
498
498
$ this ->assertSame ($ dbDataCountries [8 ], $ result [8 ]);
499
499
$ this ->assertSame ($ dbDataCountries [9 ], $ result [9 ]);
500
500
unset($ result );
@@ -503,7 +503,7 @@ public function testConditions()
503
503
$ m ->scope ()->clear ();
504
504
$ m ->addCondition ('code ' , '!= ' , [11 , 12 , 13 , 14 , 15 , 16 , 17 ]);
505
505
$ result = $ m ->action ('select ' )->getRows ();
506
- $ this ->assertSame (2 , count ( $ result) );
506
+ $ this ->assertCount (2 , $ result );
507
507
$ this ->assertSame ($ dbDataCountries [8 ], $ result [8 ]);
508
508
$ this ->assertSame ($ dbDataCountries [9 ], $ result [9 ]);
509
509
unset($ result );
0 commit comments