]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
API: update test regexes to comply with PCRE2
authorVirtualTam <virtualtam@flibidi.net>
Sat, 12 Jan 2019 22:19:15 +0000 (23:19 +0100)
committerVirtualTam <virtualtam@flibidi.net>
Sat, 12 Jan 2019 23:04:42 +0000 (00:04 +0100)
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
tests/api/controllers/links/PostLinkTest.php

index ade07eeb39adedc07b3faca3be07bad79459143b..24e591db9a4d20962aaabdf184f56b691dd49b3a 100644 (file)
@@ -121,7 +121,7 @@ class PostLinkTest extends TestCase
         $data = json_decode((string) $response->getBody(), true);
         $this->assertEquals(self::NB_FIELDS_LINK, count($data));
         $this->assertEquals(43, $data['id']);
         $data = json_decode((string) $response->getBody(), true);
         $this->assertEquals(self::NB_FIELDS_LINK, count($data));
         $this->assertEquals(43, $data['id']);
-        $this->assertRegExp('/[\w-_]{6}/', $data['shorturl']);
+        $this->assertRegExp('/[\w_-]{6}/', $data['shorturl']);
         $this->assertEquals('http://domain.tld/?' . $data['shorturl'], $data['url']);
         $this->assertEquals('?' . $data['shorturl'], $data['title']);
         $this->assertEquals('', $data['description']);
         $this->assertEquals('http://domain.tld/?' . $data['shorturl'], $data['url']);
         $this->assertEquals('?' . $data['shorturl'], $data['title']);
         $this->assertEquals('', $data['description']);
@@ -166,7 +166,7 @@ class PostLinkTest extends TestCase
         $data = json_decode((string) $response->getBody(), true);
         $this->assertEquals(self::NB_FIELDS_LINK, count($data));
         $this->assertEquals(43, $data['id']);
         $data = json_decode((string) $response->getBody(), true);
         $this->assertEquals(self::NB_FIELDS_LINK, count($data));
         $this->assertEquals(43, $data['id']);
-        $this->assertRegExp('/[\w-_]{6}/', $data['shorturl']);
+        $this->assertRegExp('/[\w_-]{6}/', $data['shorturl']);
         $this->assertEquals('http://' . $link['url'], $data['url']);
         $this->assertEquals($link['title'], $data['title']);
         $this->assertEquals($link['description'], $data['description']);
         $this->assertEquals('http://' . $link['url'], $data['url']);
         $this->assertEquals($link['title'], $data['title']);
         $this->assertEquals($link['description'], $data['description']);