Moved API\Notification tests

This commit is contained in:
Philipp 2021-11-12 21:35:21 +01:00
parent f2ca21935e
commit 6725f05ab2
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
8 changed files with 161 additions and 86 deletions

View file

@ -3565,77 +3565,6 @@ class ApiTest extends FixtureTest
$this->markTestIncomplete();
}
/**
* Test the api_friendica_notification() function.
*
* @return void
*/
public function testApiFriendicaNotification()
{
// $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
// api_friendica_notification('json');
}
/**
* Test the api_friendica_notification() function without an authenticated user.
*
* @return void
*/
public function testApiFriendicaNotificationWithoutAuthenticatedUser()
{
// $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
// $_SESSION['authenticated'] = false;
// api_friendica_notification('json');
}
/**
* Test the api_friendica_notification() function with empty result
*
* @return void
*/
public function testApiFriendicaNotificationWithEmptyResult()
{
// DI::args()->setArgv(['api', 'friendica', 'notification']);
// $_SESSION['uid'] = 41;
// $result = api_friendica_notification('json');
// self::assertEquals(['note' => false], $result);
}
/**
* Test the api_friendica_notification() function with an XML result.
*
* @return void
*/
public function testApiFriendicaNotificationWithXmlResult()
{
/*
DI::args()->setArgv(['api', 'friendica', 'notification']);
$result = api_friendica_notification('xml');
$date = DateTimeFormat::local('2020-01-01 12:12:02');
$dateRel = Temporal::getRelativeDate('2020-01-01 07:12:02');
$assertXml=<<<XML
<?xml version="1.0"?>
<notes>
<note date="$date" date_rel="$dateRel" id="1" iid="4" link="http://localhost/notification/1" msg="A test reply from an item" msg_cache="A test reply from an item" msg_html="A test reply from an item" msg_plain="A test reply from an item" name="Reply to" name_cache="Reply to" otype="item" parent="" photo="http://localhost/" seen="false" timestamp="1577880722" type="8" uid="42" url="http://localhost/display/1" verb="http://activitystrea.ms/schema/1.0/post"/>
</notes>
XML;
self::assertXmlStringEqualsXmlString($assertXml, $result);
*/
}
/**
* Test the api_friendica_notification() function with an JSON result.
*
* @return void
*/
public function testApiFriendicaNotificationWithJsonResult()
{
// DI::args()->setArgv(['api', 'friendica', 'notification']);
// $result = json_encode(api_friendica_notification('json'));
// self::assertJson($result);
}
/**
* Test the api_friendica_notification_seen() function.
*