Skip to content

Commit 222a915

Browse files
committed
Adding failing test case
1 parent ea1f195 commit 222a915

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

generator/tests/GeneratedFilesTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,19 @@ public function testObjects()
7373
$xmlElem = simplexml_import_dom($doc);
7474
$this->assertInstanceOf(SimpleXMLElement::class, $xmlElem);
7575
}
76+
77+
/**
78+
* Tests that the limit parameter is nullable.
79+
* See https://github.com/thecodingmachine/safe/issues/56
80+
*/
81+
public function testPregSplit()
82+
{
83+
require_once __DIR__.'/../../generated/pcre.php';
84+
require_once __DIR__.'/../../lib/Exceptions/SafeExceptionInterface.php';
85+
require_once __DIR__.'/../../lib/Exceptions/AbstractSafeException.php';
86+
require_once __DIR__.'/../../generated/Exceptions/PcreException.php';
87+
88+
$keywords = preg_split("/[\s,]+/", "hypertext language, programming", null);
89+
$this->assertSame(['hypertext', 'language', 'programming'], $keywords);
90+
}
7691
}

0 commit comments

Comments
 (0)