mirror of
https://github.com/cosmocode/dokuwiki-plugin-struct.git
synced 2025-07-25 16:01:54 +00:00
fix tests, add formaly optional csv parser params
This commit is contained in:
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user