Fix ACLFormatterTest

- Add nullable to expand() function again
- Add angle bracket support to toString()
This commit is contained in:
Philipp Holzer 2019-11-01 14:13:29 +01:00
parent bc18cde412
commit aa7be41728
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
6 changed files with 51 additions and 24 deletions

View file

@ -164,15 +164,14 @@ class ACLFormaterTest extends TestCase
}
/**
* Test expected exception in case of wrong typehint
*
* @expectedException Error
* Test nullable expand (=> no ACL set)
*/
public function testExpandNull()
{
$aclFormatter = new ACLFormatter();
$aclFormatter->expand(null);
$this->assertNull($aclFormatter->expand(null));
$this->assertNull($aclFormatter->expand());
}
public function dataAclToString()
@ -198,6 +197,23 @@ class ACLFormaterTest extends TestCase
'input' => 'a,bsd23,4',
'assert' => '<4>',
],
/** @see https://github.com/friendica/friendica/pull/7787 */
'bug-7778-angle-brackets' => [
'input' => ["<40195>"],
'assert' => "<40195>",
],
Group::FOLLOWERS => [
'input' => [Group::FOLLOWERS, 1],
'assert' => '<' . Group::FOLLOWERS . '><1>',
],
Group::MUTUALS => [
'input' => [Group::MUTUALS, 1],
'assert' => '<' . Group::MUTUALS . '><1>',
],
'wrong-angle-brackets' => [
'input' => ["<asd>","<123>"],
'assert' => "<123>",
],
];
}