Code Duplication    Length = 22-22 lines in 2 locations

tests/IndexTest.php 2 locations

@@ 118-139 (lines=22) @@
115
        $client->getIndex($aliasName)->search('ruflin');
116
    }
117
118
    public function testCount(): void
119
    {
120
        $index = $this->_createIndex();
121
122
        // Add document to normal index
123
        $doc1 = new Document(null, ['name' => 'ruflin']);
124
        $doc2 = new Document(null, ['name' => 'nicolas']);
125
126
        $index->addDocument($doc1);
127
        $index->addDocument($doc2);
128
129
        $index->refresh();
130
131
        $this->assertEquals(2, $index->count());
132
133
        $query = new Term();
134
        $key = 'name';
135
        $value = 'nicolas';
136
        $query->setTerm($key, $value);
137
138
        $this->assertEquals(1, $index->count($query));
139
    }
140
141
    public function testCountGet(): void
142
    {
@@ 141-162 (lines=22) @@
138
        $this->assertEquals(1, $index->count($query));
139
    }
140
141
    public function testCountGet(): void
142
    {
143
        $index = $this->_createIndex();
144
145
        // Add document to normal index
146
        $doc1 = new Document(null, ['name' => 'ruflin']);
147
        $doc2 = new Document(null, ['name' => 'nicolas']);
148
149
        $index->addDocument($doc1);
150
        $index->addDocument($doc2);
151
152
        $index->refresh();
153
154
        $this->assertEquals(2, $index->count('', Request::GET));
155
156
        $query = new Term();
157
        $key = 'name';
158
        $value = 'nicolas';
159
        $query->setTerm($key, $value);
160
161
        $this->assertEquals(1, $index->count($query, Request::GET));
162
    }
163
164
    public function testDeleteByQueryWithQueryString(): void
165
    {