Skip to content

Commit

Permalink
fix: make compatible with old pattern
Browse files Browse the repository at this point in the history
TODO: remove the >signer pattern

Signed-off-by: Vitor Mattos <vitor@php.rio>
  • Loading branch information
vitormattos committed Apr 5, 2024
1 parent 5f64559 commit 17e16c0
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,12 @@ protected function beforeRequest(string $fullUrl, array $options): array {
}

protected function parseText(string $text): string {
$patterns = [
'/<SIGN_UUID>/',
'/<BASE_URL>/',
];
$replacements = [
$this->signer['sign_uuid'] ?? null,
$this->baseUrl . '/index.php',
];
foreach ($this->fields as $key => $value) {
$fields = $this->fields;
if (!empty($this->signer['sign_uuid'])) {
$fields = $this->signer['sign_uuid'];
}
$fields['BASE_URL'] = $this->baseUrl . '/index.php';
foreach ($fields as $key => $value) {
$patterns[] = '/<' . $key . '>/';
$replacements[] = $value;
}
Expand Down

0 comments on commit 17e16c0

Please sign in to comment.