Code Duplication    Length = 16-18 lines in 2 locations

app/Containers/Localization/UI/API/Tests/Functional/CheckLocalizationMiddlewareTest.php 2 locations

@@ 29-44 (lines=16) @@
26
    /**
27
     * @test
28
     */
29
    public function test_if_middleware_sets_default_app_language()
30
    {
31
        $data = [];
32
        $requestHeaders = [];
33
34
        // send the HTTP request
35
        $response = $this->makeCall($data, $requestHeaders);
36
37
        // assert the response status
38
        $response->assertStatus(200);
39
40
        $defaultLanguage = Config::get('app.locale');
41
42
        // check if the header is properly set
43
        $response->assertHeader('content-language', $defaultLanguage);
44
    }
45
46
    public function test_if_middleware_sets_custom_language()
47
    {
@@ 46-63 (lines=18) @@
43
        $response->assertHeader('content-language', $defaultLanguage);
44
    }
45
46
    public function test_if_middleware_sets_custom_language()
47
    {
48
        $language = 'fr';
49
50
        $data = [];
51
        $requestHeaders = [
52
            'accept-language' => $language,
53
        ];
54
55
        // send the HTTP request
56
        $response = $this->makeCall($data, $requestHeaders);
57
58
        // assert the response status
59
        $response->assertStatus(200);
60
61
        // check if the header is properly set
62
        $response->assertHeader('content-language', $language);
63
    }
64
65
    public function test_if_middleware_throws_error_on_wrong_language()
66
    {