Completed
Push — master ( 157467...db6785 )
by Artem
28:48
created

ConfigurationTest::testValidConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the FirebaseCloudMessagingBundle
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Fresh\FirebaseCloudMessagingBundle\Tests\DependencyInjection;
12
13
use Fresh\FirebaseCloudMessagingBundle\DependencyInjection\Configuration;
14
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
15
use PHPUnit\Framework\TestCase;
16
17
/**
18
 * ConfigurationTest.
19
 *
20
 * @author Artem Henvald <[email protected]>
21
 */
22
class ConfigurationTest extends TestCase
23
{
24
    use ConfigurationTestCaseTrait;
25
26
    public function testInvalidConfiguration()
27
    {
28
        $this->assertConfigurationIsInvalid(
29
            [
30
                [
31
                    'invalid_parameter' => 123,
32
                ],
33
            ],
34
            'invalid_parameter'
35
        );
36
    }
37
38
    public function testValidDefaultConfiguration()
39
    {
40
        $this->assertProcessedConfigurationEquals(
41
            [],
42
            [
43
                'endpoint' => 'https://fcm.googleapis.com/fcm/send',
44
                'guzzle_timeout' => 50,
45
            ]
46
        );
47
    }
48
49
    public function testValidConfiguration()
50
    {
51
        $this->assertProcessedConfigurationEquals(
52
            [
53
                [
54
                    'sender_id' => 1234567890,
55
                    'server_key' => 'some_key',
56
                ],
57
            ],
58
            [
59
                'sender_id' => 1234567890,
60
                'server_key' => 'some_key',
61
                'endpoint' => 'https://fcm.googleapis.com/fcm/send',
62
                'guzzle_timeout' => 50,
63
            ]
64
        );
65
    }
66
67
    protected function getConfiguration()
68
    {
69
        return new Configuration();
70
    }
71
}
72