Add Safe PHP functions

This commit is contained in:
Alex Cabal 2019-03-07 12:11:50 -06:00
parent 04a956886a
commit 58cc098058
260 changed files with 49458 additions and 45 deletions

View 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");
}
}