Passed
Pull Request — master (#372)
by Valentin
04:35
created

ArrayTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testOf() 0 11 1
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\Validation\Checkers;
13
14
use Spiral\Tests\Validation\BaseTest;
15
use Spiral\Validation\Checker\ArrayChecker;
16
17
class ArrayTest extends BaseTest
18
{
19
    public function testOf(): void
20
    {
21
        /** @var ArrayChecker $checker */
22
        $checker = $this->container->get(ArrayChecker::class);
23
24
        $this->assertTrue($checker->of([1], 'is_int'));
25
        $this->assertTrue($checker->of([1], 'integer'));
26
        $this->assertTrue($checker->of(['1'], 'is_string'));
27
28
        $this->assertFalse($checker->of(1, 'is_int'));
29
        $this->assertFalse($checker->of([1], 'is_string'));
30
    }
31
}
32