Completed
Pull Request — master (#456)
by Vincent
12:26
created

BackendHealthCheckTest::setUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\NotificationBundle\Tests\Notification;
15
16
use Laminas\Diagnostics\Result\Success;
17
use PHPUnit\Framework\TestCase;
18
use Sonata\NotificationBundle\Backend\BackendHealthCheck;
19
use Sonata\NotificationBundle\Backend\BackendInterface;
20
21
class BackendHealthCheckTest extends TestCase
22
{
23
    public function testCheck(): void
24
    {
25
        $result = new Success('Test check', 'OK');
26
27
        $backend = $this->createMock(BackendInterface::class);
28
        $backend->expects($this->once())->method('getStatus')->willReturn($result);
29
30
        $health = new BackendHealthCheck($backend);
31
32
        $this->assertSame($result, $health->check());
33
    }
34
}
35