UnexpectedRuleExceptionTest::testBase()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\Exception;
6
7
use PHPUnit\Framework\TestCase;
8
use stdClass;
9
use Yiisoft\Validator\Exception\UnexpectedRuleException;
10
use Yiisoft\Validator\Rule\Number;
11
12
final class UnexpectedRuleExceptionTest extends TestCase
13
{
14
    public function testBase(): void
15
    {
16
        $exception = new UnexpectedRuleException(Number::class, new stdClass());
17
18
        $this->assertSame('Expected "Yiisoft\Validator\Rule\Number", but "stdClass" given.', $exception->getMessage());
19
        $this->assertSame(0, $exception->getCode());
20
        $this->assertNull($exception->getPrevious());
21
    }
22
}
23