Completed
Push — master ( b5cc88...0bd59e )
by Razon
02:05
created

SessionFactoryTest::testCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
1
<?php
2
namespace App\Tests\Unit\Factory;
3
4
use App\Factory\SessionFactory;
5
use App\Model\Session;
6
use Codeception\Test\Unit;
7
use Yii;
8
9
class SessionFactoryTest extends Unit
10
{
11
    /**
12
     * @dataProvider dataCreate
13
     */
14
    public function testCreate(int $userId, int $duration, int $refeshDuration, Request $request): void
0 ignored issues
show
Bug introduced by
The type App\Tests\Unit\Factory\Request 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...
15
    {
16
        $session = SessionFactory::create($userId, $duration, $refeshDuration, $request);
17
        $this->assertSame($userId, $session->user_id);
18
    }
19
20
    public function dataCreate(): array
21
    {
22
        return [
23
            [1, 3600, 7200, Yii::$app->getRequest()],
24
            [2, 3600, 7200, Yii::$app->getRequest()],
25
        ];
26
    }
27
}
28