You are here

public function StringInputTest::getTokenizeData in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Input/StringInputTest.php \Symfony\Component\Console\Tests\Input\StringInputTest::getTokenizeData()

File

vendor/symfony/console/Tests/Input/StringInputTest.php, line 57

Class

StringInputTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function getTokenizeData() {
  return array(
    array(
      '',
      array(),
      '->tokenize() parses an empty string',
    ),
    array(
      'foo',
      array(
        'foo',
      ),
      '->tokenize() parses arguments',
    ),
    array(
      '  foo  bar  ',
      array(
        'foo',
        'bar',
      ),
      '->tokenize() ignores whitespaces between arguments',
    ),
    array(
      '"quoted"',
      array(
        'quoted',
      ),
      '->tokenize() parses quoted arguments',
    ),
    array(
      "'quoted'",
      array(
        'quoted',
      ),
      '->tokenize() parses quoted arguments',
    ),
    array(
      "'a\rb\nc\td'",
      array(
        "a\rb\nc\td",
      ),
      '->tokenize() parses whitespace chars in strings',
    ),
    array(
      "'a'\r'b'\n'c'\t'd'",
      array(
        'a',
        'b',
        'c',
        'd',
      ),
      '->tokenize() parses whitespace chars between args as spaces',
    ),
    array(
      '\\"quoted\\"',
      array(
        '"quoted"',
      ),
      '->tokenize() parses escaped-quoted arguments',
    ),
    array(
      "\\'quoted\\'",
      array(
        '\'quoted\'',
      ),
      '->tokenize() parses escaped-quoted arguments',
    ),
    array(
      '-a',
      array(
        '-a',
      ),
      '->tokenize() parses short options',
    ),
    array(
      '-azc',
      array(
        '-azc',
      ),
      '->tokenize() parses aggregated short options',
    ),
    array(
      '-awithavalue',
      array(
        '-awithavalue',
      ),
      '->tokenize() parses short options with a value',
    ),
    array(
      '-a"foo bar"',
      array(
        '-afoo bar',
      ),
      '->tokenize() parses short options with a value',
    ),
    array(
      '-a"foo bar""foo bar"',
      array(
        '-afoo barfoo bar',
      ),
      '->tokenize() parses short options with a value',
    ),
    array(
      '-a\'foo bar\'',
      array(
        '-afoo bar',
      ),
      '->tokenize() parses short options with a value',
    ),
    array(
      '-a\'foo bar\'\'foo bar\'',
      array(
        '-afoo barfoo bar',
      ),
      '->tokenize() parses short options with a value',
    ),
    array(
      '-a\'foo bar\'"foo bar"',
      array(
        '-afoo barfoo bar',
      ),
      '->tokenize() parses short options with a value',
    ),
    array(
      '--long-option',
      array(
        '--long-option',
      ),
      '->tokenize() parses long options',
    ),
    array(
      '--long-option=foo',
      array(
        '--long-option=foo',
      ),
      '->tokenize() parses long options with a value',
    ),
    array(
      '--long-option="foo bar"',
      array(
        '--long-option=foo bar',
      ),
      '->tokenize() parses long options with a value',
    ),
    array(
      '--long-option="foo bar""another"',
      array(
        '--long-option=foo baranother',
      ),
      '->tokenize() parses long options with a value',
    ),
    array(
      '--long-option=\'foo bar\'',
      array(
        '--long-option=foo bar',
      ),
      '->tokenize() parses long options with a value',
    ),
    array(
      "--long-option='foo bar''another'",
      array(
        '--long-option=foo baranother',
      ),
      '->tokenize() parses long options with a value',
    ),
    array(
      "--long-option='foo bar'\"another\"",
      array(
        '--long-option=foo baranother',
      ),
      '->tokenize() parses long options with a value',
    ),
    array(
      'foo -a -ffoo --long bar',
      array(
        'foo',
        '-a',
        '-ffoo',
        '--long',
        'bar',
      ),
      '->tokenize() parses when several arguments and options',
    ),
  );
}