mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 18:11:52 -04:00
Add Safe PHP functions
This commit is contained in:
parent
04a956886a
commit
58cc098058
260 changed files with 49458 additions and 45 deletions
21
vendor/thecodingmachine/safe/generator/tests/SpecialCasesTest.php
vendored
Normal file
21
vendor/thecodingmachine/safe/generator/tests/SpecialCasesTest.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Safe\Exceptions\PcreException;
|
||||
|
||||
class SpecialCasesTest extends TestCase
|
||||
{
|
||||
public function testPregReplace()
|
||||
{
|
||||
require_once __DIR__.'/../../lib/special_cases.php';
|
||||
require_once __DIR__.'/../../lib/Exceptions/SafeExceptionInterface.php';
|
||||
require_once __DIR__.'/../../lib/Exceptions/AbstractSafeException.php';
|
||||
require_once __DIR__.'/../../lib/Exceptions/PcreException.php';
|
||||
|
||||
$this->expectException(PcreException::class);
|
||||
$this->expectExceptionMessage('PREG_BAD_UTF8_ERROR: Invalid UTF8 character');
|
||||
preg_replace("/([\s,]+)/u", "foo", "\xc3\x28");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue