8000 [DependencyInjection] clean up legacy test by xabbuh · Pull Request #52416 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DependencyInjection] clean up legacy test #52416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -93,56 +93,6 @@ public static function getTypeConversions()
];
}

/**
* @group legacy
*
* @dataProvider getLegacyTypeConversions
*/
public function testLegacyTypeConversionsWithNativePhp($key, $value, $supported)
{
if (!$supported) {
$this->markTestSkipped(sprintf('Converting the value "%s" to "%s" is not supported by the IniFileLoader.', $key, $value));
}

$expected = parse_ini_file(__DIR__.'/../Fixtures/ini/types_legacy.ini', true, \INI_SCANNER_TYPED);
$this->assertSame($value, $expected['parameters'][$key], '->load() converts values to PHP types');
}

public static function getLegacyTypeConversions()
{
return [
['true_comment', true, true],
['true', true, true],
['false', false, true],
['on', true, true],
['off', false, true],
['yes', true, true],
['no', false, true],
['none', false, true],
['null', null, true],
['constant', \PHP_VERSION, true],
['12', 12, true],
['12_string', '12', true],
['12_quoted_number', 12, false], // INI_SCANNER_RAW removes the double quotes
['12_comment', 12, true],
['12_string_comment', '12', true],
['12_quoted_number_comment', 12, false], // INI_SCANNER_RAW removes the double quotes
['-12', -12, true],
['1', 1, true],
['0', 0, true],
['0b0110', bindec('0b0110'), false], // not supported by INI_SCANNER_TYPED
['11112222333344445555', '1111,2222,3333,4444,5555', true],
['0777', 0777, false], // not supported by INI_SCANNER_TYPED
['255', 0xFF, false], // not supported by INI_SCANNER_TYPED
['100.0', 1e2, false], // not supported by INI_SCANNER_TYPED
['-120.0', -1.2E2, false], // not supported by INI_SCANNER_TYPED
['-10100.1', -10100.1, false], // not supported by INI_SCANNER_TYPED
['-10,100.1', '-10,100.1', true],
['list', [1, 2], true],
['map', ['one' => 1, 'two' => 2], true],
];
}

public function testExceptionIsRaisedWhenIniFileDoesNotExist()
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
0