AddressFinderTest.php 835 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 26 27 28 29 30
<?php

namespace LQDN\Tests\Functional\Finder;

use LQDN\Tests\Functional\FunctionalTest;

class AddressFinderTest extends FunctionalTest
{
    public function testFindByUserId()
    {
        $addresses = $this->container['address_finder']->findByUserId(1);
        $this->assertCount(3, $addresses);

        // Check the third address which have an id of 4
        $expectedAddress = [
            'id' => '4',
            'nom' => 'Third address',
            'adresse' => '3 rue Ménars',
            'adresse2' => null,
            'codepostal' => '75003',
            'ville' => 'Paris',
            'etat' => null,
            'pays' => 'France',
            'alias' => 'Third address',
            'user_id' => '1',
            'defaut' => '0',
        ];
        $this->assertEquals($expectedAddress, $addresses[4]);
    }
}