Completed
Push — master ( 884747...1c7964 )
by ABDULMALIK
11s
created

BaseTestCase::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Tests\Unit;
4
5
use Potievdev\SlimRbac\Models\RepositoryRegistry;
6
use Potievdev\SlimRbac\Structure\AuthOptions;
7
8
/**
9
 * Class BaseTestCase
10
 * @package Tests\Unit
11
 */
12
class BaseTestCase extends \PHPUnit_Framework_TestCase
13
{
14
    /** Moderator user identifier */
15
    const MODERATOR_USER_ID = 1;
16
    /** Admin user identifier */
17
    const ADMIN_USER_ID = 2;
18
    /** User with this id not exists in database */
19
    const NOT_USER_ID = 3;
20
21
    /** @var \Doctrine\ORM\EntityManager $entityManager */
22
    private $entityManager;
23
24
    /**
25
     * @return RepositoryRegistry
26
     */
27
    protected function createRepositoryRegistry()
28
    {
29
        return new RepositoryRegistry($this->entityManager);
30
    }
31
32
    /**
33
     * @return AuthOptions
34
     */
35
    protected function createAuthOptions()
36
    {
37
        $authOptions = new AuthOptions();
38
        $authOptions->setEntityManager($this->entityManager);
39
        return $authOptions;
40
    }
41
42
    /**
43
     * Initializing AuthOptions, AuthManager and AuthOptions
44
     */
45
    public function setUp()
46
    {
47
        $this->entityManager = require __DIR__ . '/../../config/sr-config.php';
48
    }
49
}
50