Code Duplication    Length = 11-14 lines in 4 locations

src/OroCRM/Bundle/ContactBundle/Tests/Functional/API/RestContactEmailApiTest.php 2 locations

@@ 76-89 (lines=14) @@
73
        $this->getJsonResponseContent($this->client->getResponse(), Codes::HTTP_BAD_REQUEST);
74
    }
75
76
    public function testDeleteEmailForbidden()
77
    {
78
        $contactEmail = $this->getReference('ContactEmail_Several_'. LoadContactEmailData::FIRST_ENTITY_NAME);
79
        $routeParams = [
80
            'id' => $contactEmail->getId()
81
        ];
82
        $this->client->request('DELETE', $this->getUrl('oro_api_delete_contact_email', $routeParams));
83
84
        $this->getJsonResponseContent($this->client->getResponse(), Codes::HTTP_INTERNAL_SERVER_ERROR);
85
        $this->assertEquals(
86
            '{"code":500,"message":"oro.contact.email.error.delete.more_one"}',
87
            $this->client->getResponse()->getContent()
88
        );
89
    }
90
91
    public function testDeleteEmailSuccess()
92
    {
@@ 91-101 (lines=11) @@
88
        );
89
    }
90
91
    public function testDeleteEmailSuccess()
92
    {
93
        $contactEmail = $this->getReference('ContactEmail_Single_'. LoadContactEmailData::FIRST_ENTITY_NAME);
94
        $routeParams = [
95
            'id' => $contactEmail->getId()
96
        ];
97
        $this->client->request('DELETE', $this->getUrl('oro_api_delete_contact_email', $routeParams));
98
99
        $this->getJsonResponseContent($this->client->getResponse(), Codes::HTTP_OK);
100
        $this->assertEquals('{"id":""}', $this->client->getResponse()->getContent());
101
    }
102
}
103

src/OroCRM/Bundle/ContactBundle/Tests/Functional/API/RestContactPhoneApiTest.php 2 locations

@@ 78-91 (lines=14) @@
75
        $this->getJsonResponseContent($this->client->getResponse(), Codes::HTTP_BAD_REQUEST);
76
    }
77
78
    public function testDeletePhoneForbidden()
79
    {
80
        $contactPhone = $this->getReference('ContactPhone_Several_'. LoadContactPhoneData::FIRST_ENTITY_NAME);
81
        $routeParams = [
82
            'id' => $contactPhone->getId()
83
        ];
84
        $this->client->request('DELETE', $this->getUrl('oro_api_delete_contact_phone', $routeParams));
85
86
        $this->getJsonResponseContent($this->client->getResponse(), Codes::HTTP_INTERNAL_SERVER_ERROR);
87
        $this->assertEquals(
88
            '{"code":500,"message":"oro.contact.phone.error.delete.more_one"}',
89
            $this->client->getResponse()->getContent()
90
        );
91
    }
92
93
    public function testDeletePhoneSuccess()
94
    {
@@ 93-103 (lines=11) @@
90
        );
91
    }
92
93
    public function testDeletePhoneSuccess()
94
    {
95
        $contactPhone = $this->getReference('ContactPhone_Single_'. LoadContactPhoneData::FIRST_ENTITY_NAME);
96
        $routeParams = [
97
            'id' => $contactPhone->getId()
98
        ];
99
        $this->client->request('DELETE', $this->getUrl('oro_api_delete_contact_phone', $routeParams));
100
101
        $this->getJsonResponseContent($this->client->getResponse(), Codes::HTTP_OK);
102
        $this->assertEquals('{"id":""}', $this->client->getResponse()->getContent());
103
    }
104
}
105