Code Duplication    Length = 26-31 lines in 2 locations

tests/Transport/HttpTest.php 2 locations

@@ 24-49 (lines=26) @@
21
    /**
22
     * @group functional
23
     */
24
    public function testCurlNobodyOptionIsResetAfterHeadRequest(): void
25
    {
26
        $client = $this->_getClient();
27
        $index = $client->getIndex('curl_test');
28
        $index->create([], [
29
            'recreate' => true,
30
        ]);
31
        $this->_waitForAllocation($index);
32
33
        // Force HEAD request to set CURLOPT_NOBODY = true
34
        $index->exists();
35
36
        $id = 1;
37
        $data = ['id' => $id, 'name' => 'Item 1'];
38
        $doc = new Document($id, $data);
39
40
        $index->addDocument($doc);
41
42
        $index->refresh();
43
44
        $doc = $index->getDocument($id);
45
46
        // Document should be retrieved correctly
47
        $this->assertSame($data, $doc->getData());
48
        $this->assertEquals($id, $doc->getId());
49
    }
50
51
    /**
52
     * @group functional
@@ 54-84 (lines=31) @@
51
    /**
52
     * @group functional
53
     */
54
    public function testUnicodeData(): void
55
    {
56
        $client = $this->_getClient();
57
        $index = $client->getIndex('curl_test');
58
        $index->create([], [
59
            'recreate' => true,
60
        ]);
61
        $this->_waitForAllocation($index);
62
63
        // Force HEAD request to set CURLOPT_NOBODY = true
64
        $index->exists();
65
66
        $id = 22;
67
        $data = ['id' => $id, 'name' => '
68
            Сегодня, я вижу, особенно грустен твой взгляд, /
69
            И руки особенно тонки, колени обняв. /
70
            Послушай: далеко, далеко, на озере Чад /
71
            Изысканный бродит жираф.'];
72
73
        $doc = new Document($id, $data);
74
75
        $index->addDocument($doc);
76
77
        $index->refresh();
78
79
        $doc = $index->getDocument($id);
80
81
        // Document should be retrieved correctly
82
        $this->assertSame($data, $doc->getData());
83
        $this->assertEquals($id, $doc->getId());
84
    }
85
86
    /**
87
     * @group functional