CompositeTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testWithCallbackAttribute() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\TestEnvironments\Php81\Rule;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Validator\Tests\TestEnvironments\Support\Data\CompositeWithCallbackAttribute;
9
use Yiisoft\Validator\Validator;
10
11
final class CompositeTest extends TestCase
12
{
13
    public function testWithCallbackAttribute(): void
14
    {
15
        $result = (new Validator())->validate(new CompositeWithCallbackAttribute());
16
17
        $this->assertSame(
18
            [
19
                '' => ['Invalid A.'],
20
                'b' => ['Invalid B.'],
21
            ],
22
            $result->getErrorMessagesIndexedByAttribute()
23
        );
24
    }
25
}
26