fix tests, add formaly optional csv parser params

This commit is contained in:
Andreas Gohr
2025-05-12 12:52:51 +02:00
parent 518bf35837
commit e303766cee
3 changed files with 4 additions and 2 deletions

View File

@ -87,6 +87,7 @@ class ConfigParserTest extends StructTest
'nesting' => 0, 'nesting' => 0,
'index' => 0, 'index' => 0,
'classes' => ['struct-custom-foo', 'struct-custom-bar'], 'classes' => ['struct-custom-foo', 'struct-custom-bar'],
'actcol' => -1,
]; ];
$this->assertEquals($expected_config, $actual_config); $this->assertEquals($expected_config, $actual_config);

View File

@ -54,6 +54,7 @@ class InlineConfigParserTest extends StructTest
'nesting' => 0, 'nesting' => 0,
'index' => 0, 'index' => 0,
'classes' => [], 'classes' => [],
'actcol' => -1,
]; ];
$this->assertEquals($expected_config, $actual_config); $this->assertEquals($expected_config, $actual_config);

View File

@ -35,13 +35,13 @@ class InlineConfigParser extends ConfigParser
// Extract components // Extract components
$parts = explode('?', $inline, 2); $parts = explode('?', $inline, 2);
$n_parts = count($parts); $n_parts = count($parts);
$components = str_getcsv(trim($parts[0]), '.'); $components = str_getcsv(trim($parts[0]), '.', '"', '\\');
// Extract parameters if given // Extract parameters if given
$filtering = false; // First initialisation of the variable $filtering = false; // First initialisation of the variable
if ($n_parts == 2) { if ($n_parts == 2) {
$filtering = false; // Whether to filter result to current page $filtering = false; // Whether to filter result to current page
$parameters = str_getcsv(trim($parts[1]), ' '); $parameters = str_getcsv(trim($parts[1]), ' ', '"', '\\');
$n_parameters = count($parameters); $n_parameters = count($parameters);
// Process parameters and add to config lines // Process parameters and add to config lines