Completed
Push — master ( d55862...a85472 )
by Loïc
10s
created

AddressContext   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A thereAreAddressesLocatedAtCity() 0 13 2
1
<?php
2
3
/*
4
 * This file is part of Jedisjeux.
5
 *
6
 * (c) Loïc Frémont
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace AppBundle\Behat\Context\Setup;
13
14
use AppBundle\Behat\DefaultContext;
15
16
class AddressContext extends DefaultContext
17
{
18
    /**
19
     * @Given there are :count addresses located at :city
20
     */
21
    public function thereAreAddressesLocatedAtCity($count, $city)
22
    {
23
        $manager = $this->getEntityManager();
24
        $factory = $this->getExampleFactory('address');
25
26
        for ($i=0 ; $i<$count ; $i++) {
27
            $address = $factory->create(['city' => $city]);
28
29
            $manager->persist($address);
30
        }
31
32
        $manager->flush();
33
    }
34
}
35