Passed
Pull Request — master (#277)
by Kirill
03:11
created

SnapshotTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A testSnapshot() 0 12 2
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Framework;
13
14
use Spiral\Snapshots\SnapshotInterface;
15
use Spiral\Snapshots\SnapshotterInterface;
16
17
class SnapshotTest extends BaseTest
18
{
19
    public function testSnapshot(): void
20
    {
21
        $app = $this->makeApp();
22
23
        try {
24
            throw new \Error('test error');
25
        } catch (\Error $e) {
26
            /** @var SnapshotInterface $s */
27
            $s = $app->get(SnapshotterInterface::class)->register($e);
28
        }
29
30
        $this->assertInstanceOf(\Error::class, $s->getException());
31
    }
32
}
33