Completed
Push — master ( 17598f...abee1f )
by Kirill
13s queued 11s
created

SnapshotTest::testSnapshot()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 1
nop 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
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