UserFinderTest.php 958 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

namespace LQDN\Tests\Functional\Finder;

use LQDN\Tests\Functional\FunctionalTest;

class UserFinderTest extends FunctionalTest
{
    public function testFindById()
    {
        $user = $this->container['user_finder']->findById(1);

        $expectedUser = [
            'id' => '1',
            'status' => '1',
            'hash' => '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
            'cumul' => '2000',
            'email' => 'alice@example.org',
            'total' => '5000',
            'pseudo' => 'Alice',
            'expiration' => null,
            'commentaire' => 'RAS',
        ];
        $this->assertEquals($expectedUser, $user);
    }
Okhin's avatar
Okhin committed
26
27
28
29

    public function testAdminSearch()
    {
        $this->assertCount(1, $this->container['user_finder']->adminSearch($text='alice@example.org', $status=''));
Okhin's avatar
Okhin committed
30
        $this->assertCount(2, $this->container['user_finder']->adminSearch($text='', $status='1'));
Okhin's avatar
Okhin committed
31
32

    }
33
}