Code Duplication    Length = 16-17 lines in 4 locations

src/AppBundle/Tests/Controller/InventoryControllerTest.php 1 location

@@ 9-25 (lines=17) @@
6
7
class InventoryControllerTest extends WebTestCase
8
{
9
    public function testCreate()
10
    {
11
        $client = static::createClient();
12
        $crawler = $client->request('GET', '/inventory/');
13
        $this->assertCount(0, $crawler->filter('table.records_list tbody tr'));
14
        $crawler = $client->click($crawler->filter('.new_entry a')->link());
15
        $form = $crawler->filter('form button[type="submit"]')->form(array(
16
            'inventory[date]' => new \DateTime(),
17
            'inventory[active]' => true,
18
            'inventory[amount]' => 10.99,
19
            'inventory[file]' => 'Lorem ipsum dolor sit amet',
20
                    ));
21
        $client->submit($form);
22
        $crawler = $client->followRedirect();
23
        $crawler = $client->click($crawler->filter('.record_actions a')->link());
24
        $this->assertCount(1, $crawler->filter('table.records_list tbody tr'));
25
    }
26
27
    public function testCreateError()
28
    {

src/AppBundle/Tests/Controller/Settings/SettingsControllerTest.php 1 location

@@ 9-25 (lines=17) @@
6
7
class SettingsControllerTest extends WebTestCase
8
{
9
    public function testCreate()
10
    {
11
        $client = static::createClient();
12
        $crawler = $client->request('GET', '/admin/settings/');
13
        $this->assertCount(0, $crawler->filter('table.records_list tbody tr'));
14
        $crawler = $client->click($crawler->filter('.new_entry a')->link());
15
        $form = $crawler->filter('form button[type="submit"]')->form(array(
16
            'settings[inventoryStyle]' => 'Lorem ipsum dolor sit amet',
17
            'settings[calculation]' => 'Lorem ipsum dolor sit amet',
18
            'settings[firstInventory]' => new \DateTime(),
19
            'settings[currency]' => 'Lorem ipsum dolor sit amet',
20
                    ));
21
        $client->submit($form);
22
        $crawler = $client->followRedirect();
23
        $crawler = $client->click($crawler->filter('.record_actions a')->link());
24
        $this->assertCount(1, $crawler->filter('table.records_list tbody tr'));
25
    }
26
27
    public function testCreateError()
28
    {

src/AppBundle/Tests/Controller/SupplierControllerTest.php 1 location

@@ 9-25 (lines=17) @@
6
7
class SupplierControllerTest extends WebTestCase
8
{
9
    public function testCreate()
10
    {
11
        $client = static::createClient();
12
        $crawler = $client->request('GET', '/suppliers/');
13
        $this->assertCount(0, $crawler->filter('table.records_list tbody tr'));
14
        $crawler = $client->click($crawler->filter('.new_entry a')->link());
15
        $form = $crawler->filter('form button[type="submit"]')->form(array(
16
            'supplier[delaydeliv]' => 42,
17
            'supplier[orderdate]' => 'Lorem ipsum dolor sit amet',
18
            'supplier[active]' => true,
19
            'supplier[slug]' => 'Lorem ipsum dolor sit amet',
20
                    ));
21
        $client->submit($form);
22
        $crawler = $client->followRedirect();
23
        $crawler = $client->click($crawler->filter('.record_actions a')->link());
24
        $this->assertCount(1, $crawler->filter('table.records_list tbody tr'));
25
    }
26
27
    public function testCreateError()
28
    {

src/AppBundle/Tests/Controller/Settings/Divers/UnitStorageControllerTest.php 1 location

@@ 9-24 (lines=16) @@
6
7
class UnitStorageControllerTest extends WebTestCase
8
{
9
    public function testCreate()
10
    {
11
        $client = static::createClient();
12
        $crawler = $client->request('GET', '/admin/Settings/Divers/UnitStorage/');
13
        $this->assertCount(0, $crawler->filter('table.records_list tbody tr'));
14
        $crawler = $client->click($crawler->filter('.new_entry a')->link());
15
        $form = $crawler->filter('form button[type="submit"]')->form(array(
16
            'unitstorage[name]' => 'Lorem ipsum dolor sit amet',
17
            'unitstorage[abbr]' => 'Lorem ipsum dolor sit amet',
18
            'unitstorage[slug]' => 'Lorem ipsum dolor sit amet',
19
                    ));
20
        $client->submit($form);
21
        $crawler = $client->followRedirect();
22
        $crawler = $client->click($crawler->filter('.record_actions a')->link());
23
        $this->assertCount(1, $crawler->filter('table.records_list tbody tr'));
24
    }
25
26
    public function testCreateError()
27
    {