Skip to content

Commit 70abc7c

Browse files
limenetactions-user
authored andcommitted
Fix styling
1 parent 753d1fc commit 70abc7c

File tree

4 files changed

+24
-27
lines changed

4 files changed

+24
-27
lines changed

tests/Feature/CommandTest.php

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

33
namespace Limenet\LaravelElasticaBridge\Tests\Feature;
44

5-
use Limenet\LaravelElasticaBridge\Index\IndexInterface;
6-
75
class CommandTest extends TestCase
86
{
97
/** @test */

tests/Feature/QueryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class QueryTest extends TestCase
1111
/** @test */
1212
public function get_by_id()
1313
{
14-
$id=17;
14+
$id = 17;
1515
$this->index($this->productIndex);
16-
$elements=$this->productIndex->searchForElements(new MatchQuery(IndexInterface::DOCUMENT_MODEL_ID, $id));
16+
$elements = $this->productIndex->searchForElements(new MatchQuery(IndexInterface::DOCUMENT_MODEL_ID, $id));
1717

1818
$this->assertCount(1, $elements);
1919
$this->assertSame(17, $elements[0]->id);
@@ -23,10 +23,10 @@ public function size_and_from()
2323
{
2424
$this->index($this->productIndex);
2525

26-
$elements1=$this->productIndex->searchForElements(new BoolQuery(),5,0);
26+
$elements1 = $this->productIndex->searchForElements(new BoolQuery(), 5, 0);
2727
$this->assertCount(5, $elements1);
2828

29-
$elements2=$this->productIndex->searchForElements(new BoolQuery(),5,5);
29+
$elements2 = $this->productIndex->searchForElements(new BoolQuery(), 5, 5);
3030
$this->assertCount(5, $elements2);
3131
$this->assertEmpty(collect($elements1)->map->id->intersect(collect($elements2)->map->id)->toArray());
3232
}

tests/Feature/TestCase.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function setUp(): void
2424
$this->customerIndex = $this->app->make(CustomerIndex::class);
2525
$this->productIndex = $this->app->make(ProductIndex::class);
2626
$this->indexRepository = $this->app->make(IndexRepository::class);
27-
$this->elasticaClient=$this->app->make(ElasticaClient::class);
27+
$this->elasticaClient = $this->app->make(ElasticaClient::class);
2828

2929
$this->cleanupIndices();
3030
}
@@ -35,28 +35,28 @@ public function tearDown(): void
3535

3636
$this->cleanupIndices();
3737
}
38-
protected function cleanupIndices(){
39-
40-
foreach([$this->customerIndex, $this->productIndex] as $index){
41-
try{
42-
if($index->getElasticaIndex()->hasAlias($index->getName())){
43-
$index->getElasticaIndex()->removeAlias($index->getName());
44-
}
45-
$active=$index->getBlueGreenActiveElasticaIndex();
46-
$inactive=$index->getBlueGreenInactiveElasticaIndex();
47-
if($active->exists()){
48-
$active->delete();
49-
}
50-
if($inactive->exists()){
51-
$inactive->delete();
38+
protected function cleanupIndices()
39+
{
40+
foreach ([$this->customerIndex, $this->productIndex] as $index) {
41+
try {
42+
if ($index->getElasticaIndex()->hasAlias($index->getName())) {
43+
$index->getElasticaIndex()->removeAlias($index->getName());
44+
}
45+
$active = $index->getBlueGreenActiveElasticaIndex();
46+
$inactive = $index->getBlueGreenInactiveElasticaIndex();
47+
if ($active->exists()) {
48+
$active->delete();
49+
}
50+
if ($inactive->exists()) {
51+
$inactive->delete();
52+
}
53+
} catch (BaseException | ResponseException) {
5254
}
53-
}catch(BaseException|ResponseException){
54-
55-
}
5655
}
5756
}
5857

59-
protected function index(IndexInterface $index):int{
58+
protected function index(IndexInterface $index):int
59+
{
6060
return $this->artisan('elastica-bridge:index', ['index' => [$index->getName()]])->run();
6161
}
6262
}

tests/Unit/FacadeTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
namespace Limenet\LaravelElasticaBridge\Tests\Unit;
44

55
use Elastica\Client;
6-
use Limenet\LaravelElasticaBridge\Client\ElasticaClient;
76
use Limenet\LaravelElasticaBridge\LaravelElasticaBridgeFacade;
87

98
class FacadeTest extends TestCase
109
{
1110
/** @test */
1211
public function facade()
1312
{
14-
$this->assertInstanceOf(Client::class, LaravelElasticaBridgeFacade::getClient());
13+
$this->assertInstanceOf(Client::class, LaravelElasticaBridgeFacade::getClient());
1514
}
1615
}

0 commit comments

Comments
 (0)