Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Commit

Permalink
unittest 100%
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Meilick <[email protected]>
  • Loading branch information
bnomei committed Aug 26, 2019
1 parent d24863a commit b689d78
Show file tree
Hide file tree
Showing 6 changed files with 7,181 additions and 6 deletions.
15 changes: 10 additions & 5 deletions tests/InstagramTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,19 @@ public function testIsJson()

public function testApi()
{
$inst = new Instagram();
$key = 'TOKEN'.$inst->option('endpoint');
$inst = new Instagram([
'token' => null,
'api' => 'https://repo.packagist.org/',
'endpoint' => 'p/bnomei/kirby3-instagram.json',
'json-root' => 'packages',
]);
$key = $inst->option('token').$inst->option('endpoint');

$id = $inst->cacheId($key);
$this->assertRegExp('/^2178974503-\d-\d-\d-NONE$/', $id);
$this->assertRegExp('/^1601707070-\d-\d-\d-NONE$/', $id);

$this->assertCount(0, $inst->api('TOKEN'));
$this->assertCount(0, $inst->api('TOKEN'));
$this->assertCount(1, $inst->api());
$this->assertCount(1, $inst->api());
$this->assertIsArray($inst->read($key));
}

Expand Down
Loading

0 comments on commit b689d78

Please sign in to comment.