CounterpartFinderTest.php 882 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?php

namespace LQDN\Tests\Functional\Finder;

use LQDN\Tests\Functional\FunctionalTest;

class CounterpartFinderTest extends FunctionalTest
{
    public function testFindByUserId()
    {
        $counterparts = $this->container['counterpart_finder']->findByUserId(2);
        $this->assertCount(1, $counterparts);

        $firstCounterpart = reset($counterparts);

        // Check the first counterpart
        $expectedCounterpart = [
            'id' => '2',
            'user_id' => '2',
            'datec' => '2016-06-22 12:34:00',
            'quoi' => 'piplome',
22
            'taille' => '2',
23 24
            'status' => '1',
            'adresse_id' => null,
Okhin's avatar
Okhin committed
25
            'pdf_id' => '1',
26
            'pdf_nom' => 'Main',
Okhin's avatar
Okhin committed
27
            'pdf_url' => 'pdf',
28
            'commentaire' => '',
29 30 31 32
        ];
        $this->assertEquals($expectedCounterpart, $firstCounterpart);
    }
}