escapeCurrencySymbol($symbol); $this->assertStringNotContainsString('SLEEP', $escaped, "SQL injection attempt should be escaped: $symbol"); $this->assertStringNotContainsString('DROP', $escaped, "SQL injection attempt should be escaped: $symbol"); $this->assertStringNotContainsString(';', $escaped, "Query termination should be escaped: $symbol"); } } public function testNormalCurrencySymbolHandling(): void { $normal_symbols = ['$', '€', '£', '¥', '₹', '₩', '₽', 'kr', 'CHF']; foreach ($normal_symbols as $symbol) { $escaped = $this->escapeCurrencySymbol($symbol); $this->assertNotEmpty($escaped, "Normal currency symbol should be preserved: $symbol"); } } private function escapeCurrencySymbol(string $symbol): string { if (strlen($symbol) === 0) { return "''"; } $symbol = addslashes($symbol); return "'" . $symbol . "'"; } }