$input->
bind($definition);
$this->
assertEquals($expectedType,
$input->
getCompletionType(), 'Unexpected type'
);
$this->
assertEquals($expectedName,
$input->
getCompletionName(), 'Unexpected name'
);
$this->
assertEquals($expectedValue,
$input->
getCompletionValue(), 'Unexpected value'
);
} public static function provideBindData() { // option names
yield 'optname-minimal-input' =>
[CompletionInput::
fromTokens(['bin/console', '-'
], 1
), CompletionInput::TYPE_OPTION_NAME, null, '-'
];
yield 'optname-partial' =>
[CompletionInput::
fromTokens(['bin/console', '--with'
], 1
), CompletionInput::TYPE_OPTION_NAME, null, '--with'
];
// option values
yield 'optval-short' =>
[CompletionInput::
fromTokens(['bin/console', '-r'
], 1
), CompletionInput::TYPE_OPTION_VALUE, 'with-required-value', ''
];
yield 'optval-short-partial' =>
[CompletionInput::
fromTokens(['bin/console', '-rsymf'
], 1
), CompletionInput::TYPE_OPTION_VALUE, 'with-required-value', 'symf'
];
yield 'optval-short-space' =>
[CompletionInput::
fromTokens(['bin/console', '-r'
], 2
), CompletionInput::TYPE_OPTION_VALUE, 'with-required-value', ''
];
yield 'optval-short-space-partial' =>
[CompletionInput::
fromTokens(['bin/console', '-r', 'symf'
], 2
), CompletionInput::TYPE_OPTION_VALUE, 'with-required-value', 'symf'
];
yield 'optval-short-before-arg' =>
[CompletionInput::
fromTokens(['bin/console', '-r', 'symfony'
], 1
), CompletionInput::TYPE_OPTION_VALUE, 'with-required-value', ''
];
yield 'optval-long' =>
[CompletionInput::
fromTokens(['bin/console', '--with-required-value='
], 1
), CompletionInput::TYPE_OPTION_VALUE, 'with-required-value', ''
];
yield 'optval-long-partial' =>
[CompletionInput::
fromTokens(['bin/console', '--with-required-value=symf'
], 1
), CompletionInput::TYPE_OPTION_VALUE, 'with-required-value', 'symf'
];
yield 'optval-long-space' =>
[CompletionInput::
fromTokens(['bin/console', '--with-required-value'
], 2
), CompletionInput::TYPE_OPTION_VALUE, 'with-required-value', ''
];