Skip to content

Commit

Permalink
test: add bad access toekn
Browse files Browse the repository at this point in the history
  • Loading branch information
KEINOS committed Jul 22, 2020
1 parent 590235c commit c03cf28
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/ConstructTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,23 @@ public function testEmptyArrayArg()
$this->expectException(\Exception::class);
$obj = new \KEINOS\MSTDN_TOOLS\Config\Config($settings);
}
public function testEmptyInstanceInfoWhenCache()
{
$settings = [
'url_host' => 'https://qiitadon.com/',
'flag_use_cache' => false,
];

$object = new \KEINOS\MSTDN_TOOLS\Config\Config($settings);

// Change method accessibility
$reflection = new \ReflectionClass($object);
$method = $reflection->getMethod('saveCacheInstanceInfo');
$method->setAccessible(true);

$this->expectException(\Exception::class);
$method->invokeArgs($object, [ null ]);
}

public function testNonCaching()
{
Expand Down

0 comments on commit c03cf28

Please sign in to comment.