forked from DamienHarper/auditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigurationTest.php
54 lines (41 loc) · 1.41 KB
/
ConfigurationTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace DH\Auditor\Tests;
use DH\Auditor\Tests\Traits\AuditorConfigurationTrait;
use PHPUnit\Framework\TestCase;
/**
* @internal
*/
final class ConfigurationTest extends TestCase
{
use AuditorConfigurationTrait;
public function testIsEnabledByDefault(): void
{
$configuration = $this->createAuditorConfiguration();
self::assertTrue($configuration->isEnabled(), 'Auditor is enabled by default.');
}
public function testDisable(): void
{
$configuration = $this->createAuditorConfiguration();
$configuration->disable();
self::assertFalse($configuration->isEnabled(), 'Auditor is disabled.');
}
public function testEnable(): void
{
$configuration = $this->createAuditorConfiguration();
$configuration->disable();
$configuration->enable();
self::assertTrue($configuration->isEnabled(), 'Auditor is enabled.');
}
public function testDefaultTimezoneIsUTC(): void
{
$configuration = $this->createAuditorConfiguration();
self::assertSame('UTC', $configuration->getTimezone(), 'Default timezone is UTC.');
}
public function testCustomTimezone(): void
{
$configuration = $this->createAuditorConfiguration([
'timezone' => 'Europe/Paris',
]);
self::assertSame('Europe/Paris', $configuration->getTimezone(), 'Custom timezone is "Europe/Paris".');
}
}