-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
use Cachet\Actions\Integrations\ImportOhDearFeed; | ||
use Cachet\Enums\ComponentStatusEnum; | ||
use Cachet\Enums\ExternalProviderEnum; | ||
use Cachet\Enums\IncidentStatusEnum; | ||
|
||
it('can import an OhDear feed', function () { | ||
$importOhDearFeed = new ImportOhDearFeed(); | ||
|
||
$data = json_decode(file_get_contents(__DIR__.'/../../../stubs/ohdear-feed-php.json'), true); | ||
|
||
$importOhDearFeed($data, importSites: true, componentGroupId: 1, importIncidents: true); | ||
|
||
$this->assertDatabaseHas('components', [ | ||
'link' => 'https://www.php.net/', | ||
'name' => 'php.net', | ||
'component_group_id' => 1, | ||
'status' => ComponentStatusEnum::operational, | ||
]); | ||
|
||
$this->assertDatabaseHas('incidents', [ | ||
'external_provider' => ExternalProviderEnum::OhDear->value, | ||
'external_id' => "1274100", | ||
'name' => 'php.net has recovered.', | ||
'status' => IncidentStatusEnum::fixed, | ||
]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"title":"PHP.net Status","timezone":"UTC","pinnedUpdate":null,"sites":{"ungrouped":[{"label":"php.net","url":"https:\/\/www.php.net\/","status":"up"},{"label":"pecl.php.net","url":"https:\/\/pecl.php.net","status":"up"},{"label":"bugs.php.net","url":"https:\/\/bugs.php.net","status":"up"},{"label":"museum.php.net","url":"https:\/\/museum.php.net","status":"up"},{"label":"wiki.php.net","url":"https:\/\/wiki.php.net","status":"up"},{"label":"people.php.net","url":"https:\/\/people.php.net","status":"up"},{"label":"news-web.php.net","url":"https:\/\/news-web.php.net","status":"up"},{"label":"downloads.php.net","url":"https:\/\/downloads.php.net","status":"up"}]},"updatesPerDay":{"1732579200":[],"1732492800":[],"1732406400":[{"id":1274100,"title":"php.net has recovered.","text":"","pinned":false,"severity":"resolved","time":1732471160},{"id":1273622,"title":"php.net appears to be down.","text":"","pinned":false,"severity":"warning","time":1732429163},{"id":1273623,"title":"downloads.php.net appears to be down.","text":"","pinned":false,"severity":"warning","time":1732429163}],"1732320000":[],"1732233600":[],"1732147200":[],"1732060800":[]},"summarizedStatus":"up"} |