Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
midnite81 committed Jul 13, 2018
1 parent 696f7c3 commit e44d7e9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Services/LaravelNotificationTest.php
Expand Up @@ -28,6 +28,15 @@ public function it_uses_default_device_if_not_specified()
$this->assertContains(config('prowl')['keys'][config('prowl')['defaultKey']], $notification->getApiKeys());
}

/**
* Overrides the method which is only needed on the base test
* since Laravel will auto inject the key
*/
public function it_returns_null_if_no_api_key_is_set()
{

}

/**
* @return LaravelNotification
* @throws \Midnite81\Prowl\Exceptions\IncorrectPriorityValueException
Expand Down
33 changes: 33 additions & 0 deletions tests/Services/NotificationTest.php
Expand Up @@ -118,6 +118,39 @@ public function it_can_add_more_than_one_key_to_the_class()
$this->assertContains('test123', $notification->getApiKeys());
}

/**
* @test
*/
public function it_sets_message_to_class()
{
$notification = $this->factoryCreateFromArray();

$notification->setMessage('Test Message');

$this->assertEquals('Test Message', $notification->getMessage());
}

/**
* @test
*/
public function it_returns_null_if_no_api_key_is_set()
{
$notification = $this->factoryCreateFromArray();

$this->assertNull($notification->getApiKeys());
}

/**
* @test
* @expectedException \Midnite81\Prowl\Exceptions\ValueTooLongException
*/
public function it_throws_exception_when_the_provider_key_is_too_long()
{
$notification = $this->factoryCreateFromArray();

$notification->setProviderKey($this->stringLength(41));
}

/**
* @test
*/
Expand Down

0 comments on commit e44d7e9

Please sign in to comment.