You are here

public function FileValidatorTest::provideBinaryFormatTests in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/validator/Tests/Constraints/FileValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\FileValidatorTest::provideBinaryFormatTests()

File

vendor/symfony/validator/Tests/Constraints/FileValidatorTest.php, line 242

Class

FileValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function provideBinaryFormatTests() {
  return array(
    array(
      11,
      10,
      null,
      '11',
      '10',
      'bytes',
    ),
    array(
      11,
      10,
      true,
      '11',
      '10',
      'bytes',
    ),
    array(
      11,
      10,
      false,
      '11',
      '10',
      'bytes',
    ),
    // round(size) == 1.01kB, limit == 1kB
    array(
      ceil(1000 * 1.01),
      1000,
      null,
      '1.01',
      '1',
      'kB',
    ),
    array(
      ceil(1000 * 1.01),
      '1k',
      null,
      '1.01',
      '1',
      'kB',
    ),
    array(
      ceil(1024 * 1.01),
      '1Ki',
      null,
      '1.01',
      '1',
      'KiB',
    ),
    array(
      ceil(1024 * 1.01),
      1024,
      true,
      '1.01',
      '1',
      'KiB',
    ),
    array(
      ceil(1024 * 1.01 * 1000),
      '1024k',
      true,
      '1010',
      '1000',
      'KiB',
    ),
    array(
      ceil(1024 * 1.01),
      '1Ki',
      true,
      '1.01',
      '1',
      'KiB',
    ),
    array(
      ceil(1000 * 1.01),
      1000,
      false,
      '1.01',
      '1',
      'kB',
    ),
    array(
      ceil(1000 * 1.01),
      '1k',
      false,
      '1.01',
      '1',
      'kB',
    ),
    array(
      ceil(1024 * 1.01 * 10),
      '10Ki',
      false,
      '10.34',
      '10.24',
      'kB',
    ),
  );
}