mirror of
https://github.com/friendica/friendica
synced 2024-12-23 00:40:15 +00:00
Move API status tests
This commit is contained in:
parent
43a001bf73
commit
2c15fb03ff
2 changed files with 26 additions and 29 deletions
|
@ -638,35 +638,6 @@ class ApiTest extends FixtureTest
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_get_entitities() function.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiGetEntitities()
|
||||
{
|
||||
// $text = 'text';
|
||||
// self::assertIsArray(api_get_entitities($text, 'bbcode', 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_get_entitities() function with the include_entities parameter.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiGetEntititiesWithIncludeEntities()
|
||||
{
|
||||
/*
|
||||
$_REQUEST['include_entities'] = 'true';
|
||||
$text = 'text';
|
||||
$result = api_get_entitities($text, 'bbcode', 0);
|
||||
self::assertIsArray($result['hashtags']);
|
||||
self::assertIsArray($result['symbols']);
|
||||
self::assertIsArray($result['urls']);
|
||||
self::assertIsArray($result['user_mentions']);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_format_items_embeded_images() function.
|
||||
*
|
||||
|
|
|
@ -82,4 +82,30 @@ class StatusTest extends FixtureTest
|
|||
self::assertEquals('<h4>item_title</h4><br>item_title item_body', $result['html']);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_get_entitities() function.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiGetEntititiesWithIncludeEntities()
|
||||
{
|
||||
$hashTagFac = new Hashtag(DI::logger());
|
||||
$mediaFac = new Media(DI::logger(), DI::baseUrl());
|
||||
$urlFac = new Url(DI::logger());
|
||||
$mentionFac = new Mention(DI::logger(), DI::baseUrl());
|
||||
$activitiesFac = new Activities(DI::logger(), DI::baseUrl(), DI::twitterUser());
|
||||
$attachmentFac = new Attachment(DI::logger());
|
||||
|
||||
$statusFac = new Status(DI::logger(), DI::dba(), DI::twitterUser(), $hashTagFac, $mediaFac, $urlFac, $mentionFac, $activitiesFac, $attachmentFac);
|
||||
$statusObj = $statusFac->createFromItemId(13, ApiTest::SELF_USER['id'], true);
|
||||
$status = $statusObj->toArray();
|
||||
|
||||
self::assertIsArray($status['entities']);
|
||||
self::assertIsArray($status['extended_entities']);
|
||||
self::assertIsArray($status['entities']['hashtags']);
|
||||
self::assertIsArray($status['entities']['media']);
|
||||
self::assertIsArray($status['entities']['urls']);
|
||||
self::assertIsArray($status['entities']['user_mentions']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue