forked from GNUsocial/gnu-social
update tests to include 'mentioned' links
This commit is contained in:
parent
e2c90576c0
commit
b17fc0ca5b
@ -261,6 +261,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
|
|||||||
$element = $this->_entryToElement($entry, true);
|
$element = $this->_entryToElement($entry, true);
|
||||||
|
|
||||||
$this->assertEquals($this->targetUser1->uri, ActivityUtils::getLink($element, 'ostatus:attention'));
|
$this->assertEquals($this->targetUser1->uri, ActivityUtils::getLink($element, 'ostatus:attention'));
|
||||||
|
$this->assertEquals($this->targetUser1->uri, ActivityUtils::getLink($element, 'mentioned'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMultipleReplyAttention()
|
public function testMultipleReplyAttention()
|
||||||
@ -291,6 +292,19 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertTrue(in_array($this->targetUser1->uri, $hrefs));
|
$this->assertTrue(in_array($this->targetUser1->uri, $hrefs));
|
||||||
$this->assertTrue(in_array($this->targetUser2->uri, $hrefs));
|
$this->assertTrue(in_array($this->targetUser2->uri, $hrefs));
|
||||||
|
|
||||||
|
$links = ActivityUtils::getLinks($element, 'mentioned');
|
||||||
|
|
||||||
|
$this->assertEquals(2, count($links));
|
||||||
|
|
||||||
|
$hrefs = array();
|
||||||
|
|
||||||
|
foreach ($links as $link) {
|
||||||
|
$hrefs[] = $link->getAttribute('href');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->assertTrue(in_array($this->targetUser1->uri, $hrefs));
|
||||||
|
$this->assertTrue(in_array($this->targetUser2->uri, $hrefs));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGroupPostAttention()
|
public function testGroupPostAttention()
|
||||||
@ -304,6 +318,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
|
|||||||
$element = $this->_entryToElement($entry, true);
|
$element = $this->_entryToElement($entry, true);
|
||||||
|
|
||||||
$this->assertEquals($this->targetGroup1->uri, ActivityUtils::getLink($element, 'ostatus:attention'));
|
$this->assertEquals($this->targetGroup1->uri, ActivityUtils::getLink($element, 'ostatus:attention'));
|
||||||
|
$this->assertEquals($this->targetGroup1->uri, ActivityUtils::getLink($element, 'mentioned'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMultipleGroupPostAttention()
|
public function testMultipleGroupPostAttention()
|
||||||
@ -328,6 +343,19 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertTrue(in_array($this->targetGroup1->uri, $hrefs));
|
$this->assertTrue(in_array($this->targetGroup1->uri, $hrefs));
|
||||||
$this->assertTrue(in_array($this->targetGroup2->uri, $hrefs));
|
$this->assertTrue(in_array($this->targetGroup2->uri, $hrefs));
|
||||||
|
|
||||||
|
$links = ActivityUtils::getLinks($element, 'mentioned');
|
||||||
|
|
||||||
|
$this->assertEquals(2, count($links));
|
||||||
|
|
||||||
|
$hrefs = array();
|
||||||
|
|
||||||
|
foreach ($links as $link) {
|
||||||
|
$hrefs[] = $link->getAttribute('href');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->assertTrue(in_array($this->targetGroup1->uri, $hrefs));
|
||||||
|
$this->assertTrue(in_array($this->targetGroup2->uri, $hrefs));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRepeatLink()
|
public function testRepeatLink()
|
||||||
|
Loading…
Reference in New Issue
Block a user