Code Duplication    Length = 14-15 lines in 2 locations

src/OroCRM/Bundle/ContactBundle/Tests/Functional/API/RestContactEmailApiTest.php 1 location

@@ 24-38 (lines=15) @@
21
        ]);
22
    }
23
24
    public function testCreateContactEmail()
25
    {
26
        $contact = $this->getReference('Contact_' . LoadContactEntitiesData::THIRD_ENTITY_NAME);
27
        $content = json_encode([
28
            'contactId' => $contact->getId(),
29
            'email' =>'[email protected]',
30
            'primary' => true
31
        ]);
32
33
        $this->client->request('POST', $this->getUrl('oro_api_post_contact_email'), [], [], [], $content);
34
        $contact = $this->getJsonResponseContent($this->client->getResponse(), Codes::HTTP_CREATED);
35
36
        $this->assertArrayHasKey('id', $contact);
37
        $this->assertNotEmpty($contact['id']);
38
    }
39
40
    public function testCreateSecondPrimaryEmail()
41
    {

src/OroCRM/Bundle/ContactBundle/Tests/Functional/API/RestContactPhoneApiTest.php 1 location

@@ 26-39 (lines=14) @@
23
        ]);
24
    }
25
26
    public function testCreateContactPhone()
27
    {
28
        $contact = $this->getReference('Contact_'. LoadContactEntitiesData::THIRD_ENTITY_NAME);
29
        $content = json_encode([
30
            'contactId' => $contact->getId(),
31
            'phone' => '111',
32
            'primary' => true
33
        ]);
34
        $this->client->request('POST', $this->getUrl('oro_api_post_contact_phone'), [], [], [], $content);
35
        $contact = $this->getJsonResponseContent($this->client->getResponse(), Codes::HTTP_CREATED);
36
37
        $this->assertArrayHasKey('id', $contact);
38
        $this->assertNotEmpty($contact['id']);
39
    }
40
41
    public function testCreateSecondPrimaryPhone()
42
    {