Passed
Push — master ( 35eebd...7b8a1a )
by Roman
16:45
created

PasswordAssertTest::testWithEmptyPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Game\Features\Registration;
6
7
use App\Game\Features\Registration\PasswordAssert;
8
use InvalidArgumentException;
9
use PHPUnit\Framework\TestCase;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase 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...
10
11
/**
12
 * @coversDefaultClass \App\Game\Features\Registration\PasswordAssert
13
 */
14
final class PasswordAssertTest extends TestCase
15
{
16
    /**
17
     * @covers ::assertValidPassword
18
     */
19
    public function testWithEmptyPassword(): void
20
    {
21
        $this->expectException(InvalidArgumentException::class);
22
23
        PasswordAssert::assertValidPassword('');
24
    }
25
26
    /**
27
     * @covers ::assertValidPassword
28
     */
29
    public function testRaiseExceptionWhenPasswordIsNotValid(): void
30
    {
31
        $this->expectException(InvalidArgumentException::class);
32
33
        PasswordAssert::assertValidPassword('12345');
34
    }
35
36
    /**
37
     * @covers ::assertValidPassword
38
     */
39
    public function testWithCorrectPasswordValidation(): void
40
    {
41
        PasswordAssert::assertValidPassword('1q2w3e4r');
42
43
        self::assertTrue(true);
44
    }
45
}
46