Failed Conditions
Pull Request — master (#11)
by Adrien
15:48 queued 12:33
created

tests/Acl/Assertion/OneTest.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Acl\Assertion;
6
7
use Ecodev\Felix\Acl\Acl;
8
use Ecodev\Felix\Acl\Assertion\One;
1 ignored issue
show
The type Ecodev\Felix\Acl\Assertion\One was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Laminas\Permissions\Acl\Assertion\AssertionInterface;
10
use PHPUnit\Framework\TestCase;
11
12
class OneTest extends TestCase
13
{
14
    /**
15
     * @dataProvider providerAssert
16
     */
17
    public function testAssert(array $input, bool $expected): void
18
    {
19
        $assertions = [];
20
        foreach ($input as $value) {
21
            $internalAssertion = $this->createMock(AssertionInterface::class);
22
            $internalAssertion->expects(self::atMost(1))
23
                ->method('assert')
24
                ->willReturn($value);
25
26
            $assertions[] = $internalAssertion;
27
        }
28
29
        $assertion = new One(...$assertions);
30
31
        $acl = $this->createMock(Acl::class);
32
        self::assertSame($expected, $assertion->assert($acl));
33
    }
34
35
    public function providerAssert(): array
36
    {
37
        return [
38
            [[], false],
39
            [[true], true],
40
            [[true, true], true],
41
            [[true, false], true],
42
            [[false, true], true],
43
            [[false, false], false],
44
            [[false], false],
45
        ];
46
    }
47
}
48