API: update test regexes to comply with PCRE2

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
VirtualTam 2019-01-12 23:19:15 +01:00
parent 1a55fc8d63
commit a43e7842e4

View file

@ -121,7 +121,7 @@ public function testPostLinkMinimal()
$data = json_decode((string) $response->getBody(), true); $data = json_decode((string) $response->getBody(), true);
$this->assertEquals(self::NB_FIELDS_LINK, count($data)); $this->assertEquals(self::NB_FIELDS_LINK, count($data));
$this->assertEquals(43, $data['id']); $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('http://domain.tld/?' . $data['shorturl'], $data['url']);
$this->assertEquals('?' . $data['shorturl'], $data['title']); $this->assertEquals('?' . $data['shorturl'], $data['title']);
$this->assertEquals('', $data['description']); $this->assertEquals('', $data['description']);
@ -166,7 +166,7 @@ public function testPostLinkFull()
$data = json_decode((string) $response->getBody(), true); $data = json_decode((string) $response->getBody(), true);
$this->assertEquals(self::NB_FIELDS_LINK, count($data)); $this->assertEquals(self::NB_FIELDS_LINK, count($data));
$this->assertEquals(43, $data['id']); $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('http://' . $link['url'], $data['url']);
$this->assertEquals($link['title'], $data['title']); $this->assertEquals($link['title'], $data['title']);
$this->assertEquals($link['description'], $data['description']); $this->assertEquals($link['description'], $data['description']);