Passed
Push — master ( 106687...22ee89 )
by WEBEWEB
02:59
created

SymfonyBCServiceTest::testGetSession()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2023 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Tests\Service;
13
14
use Throwable;
15
use WBW\Bundle\CoreBundle\Service\SymfonyBCService;
16
use WBW\Bundle\CoreBundle\Service\SymfonyBCServiceInterface;
17
use WBW\Bundle\CoreBundle\Tests\AbstractTestCase;
18
19
/**
20
 * Symfony backward compatibility service test.
21
 *
22
 * @author webeweb <https://github.com/webeweb>
23
 * @package WBW\Bundle\CoreBundle\Tests\Service
24
 */
25
class SymfonyBCServiceTest extends AbstractTestCase {
26
27
    /**
28
     * Tests getSession()
29
     *
30
     * @return void
31
     * @throws Throwable Throws an exception if an error occurs.
32
     */
33
    public function testGetSession(): void {
34
35
        $obj = new SymfonyBCService($this->containerBuilder);
36
37
        $this->assertSame($this->session, $obj->getSession());
38
    }
39
40
    /**
41
     * Tests __construct()
42
     *
43
     * @return void
44
     */
45
    public function test__construct(): void {
46
47
        $this->assertEquals("wbw.core.service.compatibility", SymfonyBCService::SERVICE_NAME);
48
49
        $obj = new SymfonyBCService($this->containerBuilder);
50
51
        $this->assertInstanceOf(SymfonyBCServiceInterface::class, $obj);
52
53
        $this->assertSame($this->containerBuilder, $obj->getContainer());
54
    }
55
}
56