File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Limenet \LaravelElasticaBridge \Tests ;
4
4
5
+ use Elastica \Client ;
6
+ use Elastica \Index ;
5
7
use Limenet \LaravelElasticaBridge \Tests \App \Elasticsearch \CustomerIndex ;
6
8
7
9
class IndexTest extends TestCase
@@ -15,11 +17,20 @@ public function setUp():void
15
17
$ this ->customerIndex = $ this ->app ->make (CustomerIndex::class);
16
18
}
17
19
/** @test */
18
- public function index_settings ()
20
+ public function raw_index ()
21
+ {
22
+ $ index = $ this ->customerIndex ->getElasticaIndex ();
23
+ $ this ->assertInstanceOf (Index::class, $ index );
24
+ $ this ->assertSame ($ this ->customerIndex ->getName (),$ index ->getName ());
25
+ }
26
+
27
+ /** @test */
28
+ public function settings ()
19
29
{
20
30
$ settings = $ this ->customerIndex ->getCreateArguments ();
21
- if ($ this ->customerIndex ->hasMapping ()) {
31
+ $ mappings = $ this ->customerIndex ->getMapping ();
32
+ $ this ->assertTrue ($ this ->customerIndex ->hasMapping ());
22
33
$ this ->assertArrayHasKey ('mappings ' , $ settings );
23
- }
34
+ $ this -> assertSame ( $ settings [ ' mappings ' ], $ mappings );
24
35
}
25
36
}
Original file line number Diff line number Diff line change 5
5
use Illuminate \Database \Eloquent \Factories \Factory ;
6
6
use Illuminate \Foundation \Testing \RefreshDatabase ;
7
7
use Limenet \LaravelElasticaBridge \LaravelElasticaBridgeServiceProvider ;
8
+ use Limenet \LaravelElasticaBridge \Tests \App \Elasticsearch \CustomerIndex ;
8
9
use Limenet \LaravelElasticaBridge \Tests \Database \Seeders \DatabaseSeeder ;
9
10
use Orchestra \Testbench \TestCase as Orchestra ;
10
11
use SetupTables ;
You can’t perform that action at this time.
0 commit comments