Tester\Assert::count PHP Метод

count() публичный статический Метод

Checks if subject has expected count.
public static count ( $count, $value, $description = NULL ) : void
Результат void
    public static function count($count, $value, $description = NULL)
    {
        self::$counter++;
        if (!$value instanceof \Countable && !is_array($value)) {
            self::fail(self::describe('%1 should be array or countable object', $description), $value);
        } elseif (count($value) !== $count) {
            self::fail(self::describe('Count %1 should be %2', $description), count($value), $count);
        }
    }

Usage Example

Пример #1
0
 private function assertLimit(IDataSource $source)
 {
     $all = $source->fetchAll();
     Assert::count(self::LIMIT, $all);
     Assert::count(self::FULL_USER_COUNT, $source->fetchFullData());
     Assert::count(self::FULL_USER_COUNT, $source->fetchAllForExport());
     Assert::same(self::FULL_USER_COUNT, $source->getTotalCount());
     Assert::same(self::LIMIT, $source->count());
     return $all;
 }
All Usage Examples Of Tester\Assert::count