Skip to content

Commit

Permalink
Fix fatal error when calling Config method getNtfyAuthMethod() (#183)
Browse files Browse the repository at this point in the history
Fix fatal error when calling Config method `getNtfyAuthMethod()` if no
Ntfy auth method is set.
  • Loading branch information
VerifiedJoseph authored Apr 29, 2024
1 parent e4b874e commit 3a2db0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Config
'feeds_file' => 'feeds.yaml',
'notification_gotify_priority' => 4,
'notification_ntfy_priority' => 3,
'notification_ntfy_auth' => 'none'
];

/** @var array<string, mixed> $config Loaded config parameters */
Expand Down
8 changes: 1 addition & 7 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,7 @@ public function testGetNtfyPriority(): void
public function testGetNtfyAuthMethod(): void
{
$config = new Config();

$reflection = new ReflectionClass($config);
$property = $reflection->getProperty('config');
$property->setAccessible(true);
$property->setValue($config, ['notification_ntfy_auth' => 'password']);

$this->assertEquals('password', $config->getNtfyAuthMethod());
$this->assertEquals('none', $config->getNtfyAuthMethod());
}

/**
Expand Down

0 comments on commit 3a2db0a

Please sign in to comment.