UnexpectedRuleExceptionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBase() 0 7 1
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