3 namespace Friendica\Test\Protocol;
5 use Friendica\Protocol\Activity;
6 use Friendica\Test\MockedTest;
8 class ActivityTest extends MockedTest
10 public function dataMatch()
19 'haystack' => Activity::OBJ_TAGTERM,
20 'needle' => Activity::OBJ_TAGTERM,
24 'haystack' => 'tagterm',
25 'needle' => Activity\Namespaces::ACTIVITY_SCHEMA . Activity::OBJ_TAGTERM,
29 'haystack' => 'tagterm',
33 'invalidWithOutNamespace' => [
34 'haystack' => 'tagterm',
35 'needle' => Activity::OBJ_TAGTERM,
39 'haystack' => 'tagterm',
40 'needle' => Activity\Namespaces::ACTIVITY_SCHEMA . '/bla/' . Activity::OBJ_TAGTERM,
47 * Test the different, possible matchings
49 * @dataProvider dataMatch
51 public function testMatch(string $haystack, string $needle, bool $assert)
53 $activity = new Activity();
55 $this->assertEquals($assert, $activity->match($haystack, $needle));
58 public function testIsHidden()
60 $activity = new Activity();
62 $this->assertTrue($activity->isHidden(Activity::LIKE));
63 $this->assertFalse($activity->isHidden(Activity::OBJ_BOOKMARK));