mirror of
https://github.com/friendica/friendica
synced 2025-04-22 11:10:11 +00:00
Move Activity/Namespaces defines to constants
This commit is contained in:
parent
978262a718
commit
07cea24430
34 changed files with 467 additions and 403 deletions
|
@ -16,13 +16,13 @@ class ActivityTest extends MockedTest
|
|||
'assert' => true,
|
||||
],
|
||||
'simple' => [
|
||||
'haystack' => ACTIVITY_OBJ_TAGTERM,
|
||||
'needle' => ACTIVITY_OBJ_TAGTERM,
|
||||
'haystack' => Activity::OBJ_TAGTERM,
|
||||
'needle' => Activity::OBJ_TAGTERM,
|
||||
'assert' => true,
|
||||
],
|
||||
'withNamespace' => [
|
||||
'haystack' => 'tagterm',
|
||||
'needle' => NAMESPACE_ACTIVITY_SCHEMA . ACTIVITY_OBJ_TAGTERM,
|
||||
'needle' => Activity\Namespaces::ACTIVITY_SCHEMA . Activity::OBJ_TAGTERM,
|
||||
'assert' => true,
|
||||
],
|
||||
'invalidSimple' => [
|
||||
|
@ -32,12 +32,12 @@ class ActivityTest extends MockedTest
|
|||
],
|
||||
'invalidWithOutNamespace' => [
|
||||
'haystack' => 'tagterm',
|
||||
'needle' => ACTIVITY_OBJ_TAGTERM,
|
||||
'needle' => Activity::OBJ_TAGTERM,
|
||||
'assert' => false,
|
||||
],
|
||||
'withSubPath' => [
|
||||
'haystack' => 'tagterm',
|
||||
'needle' => NAMESPACE_ACTIVITY_SCHEMA . '/bla/' . ACTIVITY_OBJ_TAGTERM,
|
||||
'needle' => Activity\Namespaces::ACTIVITY_SCHEMA . '/bla/' . Activity::OBJ_TAGTERM,
|
||||
'assert' => true,
|
||||
],
|
||||
];
|
||||
|
@ -54,4 +54,12 @@ class ActivityTest extends MockedTest
|
|||
|
||||
$this->assertEquals($assert, $activity->match($haystack, $needle));
|
||||
}
|
||||
|
||||
public function testIsHidden()
|
||||
{
|
||||
$activity = new Activity();
|
||||
|
||||
$this->assertTrue($activity->isHidden(Activity::LIKE));
|
||||
$this->assertFalse($activity->isHidden(Activity::OBJ_BOOKMARK));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue