File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 20
20
<directory suffix =" .php" >./src</directory >
21
21
</include >
22
22
</source >
23
+ <php >
24
+ <server name =" DB_CONNECTION" value =" testing" />
25
+ </php >
23
26
</phpunit >
Original file line number Diff line number Diff line change 5
5
namespace Limenet \LaravelElasticaBridge \Tests ;
6
6
7
7
use Illuminate \Database \Eloquent \Factories \Factory ;
8
+ use Illuminate \Foundation \Testing \RefreshDatabase ;
8
9
use Limenet \LaravelElasticaBridge \LaravelElasticaBridgeServiceProvider ;
9
10
use Limenet \LaravelElasticaBridge \Tests \App \Elasticsearch \CustomerIndex ;
10
11
use Limenet \LaravelElasticaBridge \Tests \App \Elasticsearch \InvoiceIndex ;
15
16
16
17
class TestCase extends Orchestra
17
18
{
19
+ use RefreshDatabase;
20
+
18
21
protected function setUp (): void
19
22
{
20
23
parent ::setUp ();
@@ -48,14 +51,10 @@ protected function getPackageProviders($app)
48
51
];
49
52
}
50
53
51
- public function getEnvironmentSetUp ($ app ): void
54
+ protected function defineEnvironment ($ app ): void
52
55
{
53
- config ()->set ('database.default ' , 'testing ' );
54
-
55
- config ()->set ('elastica-bridge.elasticseach.host ' , env ('ELASTICSEARCH_HOST ' , 'localhost ' ));
56
- config ()->set ('elastica-bridge.elasticseach.port ' , 9200 );
57
-
58
56
$ migration = include __DIR__ .'/database/migrations/SetupTables.php ' ;
57
+
59
58
$ migration ->up ();
60
59
}
61
60
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function test_configured_client(): void
21
21
{
22
22
$ client = $ this ->elasticaClient ->getClient ();
23
23
24
- $ this ->assertSame (config ( ' elastica-bridge.elasticseach.host ' ) , $ client ->getConfig ('host ' ));
25
- $ this ->assertEquals (config ( ' elastica-bridge.elasticseach.port ' ) , $ client ->getConfig ('port ' ));
24
+ $ this ->assertSame (' localhost ' , $ client ->getConfig ('host ' ));
25
+ $ this ->assertEquals (9200 , $ client ->getConfig ('port ' ));
26
26
}
27
27
}
You can’t perform that action at this time.
0 commit comments