Skip to content

Commit 18d46b5

Browse files
Add test for PHP setting without value
1 parent 5703e0a commit 18d46b5

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/unit/Util/PHP/JobRunnerTest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static function provider(): Generator
113113

114114
$obfuscationRegex = '(?i)(?:(?:"|%22)?)(?:(?:old[-_]?|new[-_]?)?p(?:ass)?w(?:or)?d(?:1|2)?|pass(?:[-_]?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\s|%20)*(?:=|%3D)[^&]+|(?:"|%22)(?:\s|%20)*(?::|%3A)(?:\s|%20)*(?:"|%22)(?:%2[^2]|%[^2]|[^"%])+(?:"|%22))|bearer(?:\s|%20)+[a-z0-9\._\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L](?:[\w=-]|%3D)+\.ey[I-L](?:[\w=-]|%3D)+(?:\.(?:[\w.+\/=-]|%3D|%2F|%2B)+)?|-{5}BEGIN(?:[a-z\s]|%20)+PRIVATE(?:\s|%20)KEY-{5}[^\-]+-{5}END(?:[a-z\s]|%20)+PRIVATE(?:\s|%20)KEY(?:-{5})?(?:\n|%0A)?';
115115

116-
yield 'php setting value containing INI metacharacters' => [
116+
yield 'PHP setting value containing INI metacharacters' => [
117117
new Result($obfuscationRegex, ''),
118118
new Job(
119119
<<<'EOT'
@@ -124,6 +124,18 @@ public static function provider(): Generator
124124
phpSettings: ['highlight.string=' . $obfuscationRegex],
125125
),
126126
];
127+
128+
yield 'PHP setting without value' => [
129+
new Result('1', ''),
130+
new Job(
131+
<<<'EOT'
132+
<?php declare(strict_types=1);
133+
print ini_get('highlight.string');
134+
135+
EOT,
136+
phpSettings: ['highlight.string'],
137+
),
138+
];
127139
}
128140

129141
#[DataProvider('provider')]

0 commit comments

Comments
 (0)