We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e849d49 commit 034829cCopy full SHA for 034829c
tests/src/PHPUnit/Misc/PreparePatternTest.php
@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace Swaggest\JsonSchema\Tests\PHPUnit\Misc;
4
5
+use Swaggest\JsonSchema\Helper;
6
+use Swaggest\JsonSchema\InvalidValue;
7
8
+class PreparePatternTest extends \PHPUnit_Framework_TestCase
9
+{
10
+ public function testFailedToPreparePattern()
11
+ {
12
+ $this->setExpectedException(get_class(new InvalidValue()), 'Failed to prepare preg pattern');
13
+ Helper::toPregPattern('/#+~%');
14
+ }
15
16
+ public function testInvalidPattern()
17
18
+ $this->setExpectedException(get_class(new InvalidValue()), 'Regex pattern is invalid: ((');
19
+ Helper::toPregPattern('((');
20
21
+}
0 commit comments