ServiceUnitTests   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 18
rs 10
c 2
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExceptionWhileConstruction() 0 12 1
1
<?php
2
namespace Mezon\Service\Tests;
3
4
use PHPUnit\Framework\TestCase;
5
use Mezon\Security\MockProvider;
6
use Mezon\Service\Tests\Mocks\TestingTransport;
7
8
/**
9
 * Class ServiceUnitTests
10
 *
11
 * @package Service
12
 * @subpackage ServiceUnitTests
13
 * @author Dodonov A.A.
14
 * @version v.1.0 (2019/08/17)
15
 * @copyright Copyright (c) 2019, aeon.org
16
 */
17
18
/**
19
 * Common service unit tests
20
 *
21
 * @author Dodonov A.A.
22
 * @psalm-suppress PropertyNotSetInConstructor
23
 */
24
class ServiceUnitTests extends TestCase
25
{
26
27
    /**
28
     * Testing method
29
     */
30
    public function testExceptionWhileConstruction(): void
31
    {
32
        // setup and test body
33
        ob_start();
34
        new ExceptionTestingService(new TestingTransport(new MockProvider()));
35
        $content = ob_get_contents();
36
        ob_end_clean();
37
38
        // assertions
39
        $this->assertStringContainsString("message", $content);
40
        $this->assertStringContainsString("code", $content);
41
        $this->assertTrue(is_array(json_decode($content, true)));
42
    }
43
}
44