Skip to content

Commit 5abf180

Browse files
committed
test shouldIndex()
1 parent 3d4dc81 commit 5abf180

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Feature/CommandTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace Limenet\LaravelElasticaBridge\Tests\Feature;
44

5+
use Elastica\Query\MatchQuery;
6+
use Limenet\LaravelElasticaBridge\Index\IndexInterface;
7+
58
class CommandTest extends TestCase
69
{
710
/** @test */
@@ -25,4 +28,12 @@ public function index_command_switches_blue_green()
2528
$this->index($this->productIndex);
2629
$this->assertNotSame($activeOld, $this->productIndex->getBlueGreenActiveElasticaIndex()->getName());
2730
}
31+
/** @test */
32+
public function index_command_respects_should_index()
33+
{
34+
$this->index($this->customerIndex);
35+
36+
$this->assertCount(0, $this->customerIndex->searchForElements(new MatchQuery(IndexInterface::DOCUMENT_MODEL_ID, 1)));
37+
$this->assertCount(1, $this->customerIndex->searchForElements(new MatchQuery(IndexInterface::DOCUMENT_MODEL_ID, 2)));
38+
}
2839
}

0 commit comments

Comments
 (0)