|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Tests; |
| 4 | + |
| 5 | +use Stackkit\LaravelDatabaseEmails\Config; |
| 6 | + |
| 7 | +class ConfigTest extends TestCase |
| 8 | +{ |
| 9 | + /** @test */ |
| 10 | + public function test_max_attempt_count() |
| 11 | + { |
| 12 | + $this->assertEquals(3, Config::maxAttemptCount()); |
| 13 | + |
| 14 | + $this->app['config']->set('laravel-database-emails.attempts', 5); |
| 15 | + |
| 16 | + $this->assertEquals(5, Config::maxAttemptCount()); |
| 17 | + } |
| 18 | + |
| 19 | + /** @test */ |
| 20 | + public function test_encrypt_emails() |
| 21 | + { |
| 22 | + $this->assertFalse(Config::encryptEmails()); |
| 23 | + |
| 24 | + $this->app['config']->set('laravel-database-emails.encrypt', true); |
| 25 | + |
| 26 | + $this->assertTrue(Config::encryptEmails()); |
| 27 | + } |
| 28 | + |
| 29 | + /** @test */ |
| 30 | + public function test_testing() |
| 31 | + { |
| 32 | + $this->assertFalse(Config::testing()); |
| 33 | + |
| 34 | + $this->app['config']->set('laravel-database-emails.testing.enabled', true); |
| 35 | + |
| 36 | + $this->assertTrue(Config::testing()); |
| 37 | + } |
| 38 | + |
| 39 | + /** @test */ |
| 40 | + public function test_test_email_address() |
| 41 | + { |
| 42 | + $this-> assertEquals( '[email protected]', Config:: testEmailAddress()); |
| 43 | + |
| 44 | + $this-> app[ 'config']-> set( 'laravel-database-emails.testing.email', '[email protected]'); |
| 45 | + |
| 46 | + $this-> assertEquals( '[email protected]', Config:: testEmailAddress()); |
| 47 | + } |
| 48 | + |
| 49 | + /** @test */ |
| 50 | + public function test_cronjob_email_limit() |
| 51 | + { |
| 52 | + $this->assertEquals(20, Config::cronjobEmailLimit()); |
| 53 | + |
| 54 | + $this->app['config']->set('laravel-database-emails.limit', 15); |
| 55 | + |
| 56 | + $this->assertEquals(15, Config::cronjobEmailLimit()); |
| 57 | + } |
| 58 | +} |
0 commit comments