File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3- xsi : noNamespaceSchemaLocation =" https://schema. phpunit.de/9.3 /phpunit.xsd"
3+ xsi : noNamespaceSchemaLocation =" vendor/ phpunit/phpunit /phpunit.xsd"
44 backupGlobals =" false"
55 backupStaticAttributes =" false"
66 bootstrap =" vendor/autoload.php"
2424
2525 <php >
2626 <server name =" ELASTICSEARCH_HOSTS" value =" http://127.0.0.1:9200" />
27+ <server name =" RECREATE_INDEX" value =" true" />
2728 </php >
2829
2930 <coverage processUncoveredFiles =" true" >
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ protected function getPackageProviders($app): array
1818 ];
1919 }
2020
21+ protected function getEnvironmentSetUp ($ app )
22+ {
23+ config ()->set ('tests.recreate_index ' , env ('RECREATE_INDEX ' , true ));
24+ }
25+
2126 protected function tearDown (): void
2227 {
2328 ElasticQuery::disableQueryLog ();
Original file line number Diff line number Diff line change @@ -11,10 +11,15 @@ abstract class IndexSeeder
1111 protected array $ settings = [];
1212 protected array $ fixtures = [];
1313
14- protected bool $ recreate = false ;
14+ protected bool $ recreate ;
1515
1616 protected ?Client $ client ;
1717
18+ public function __construct ()
19+ {
20+ $ this ->recreate = config ('tests.recreate_index ' , true );
21+ }
22+
1823 public function setClient (Client $ client ): void
1924 {
2025 $ this ->client = $ client ;
@@ -78,6 +83,8 @@ protected function loadFixtures(): void
7883 foreach ($ this ->fixtures as $ fixture ) {
7984 $ this ->loadFixture ($ baseDir .$ fixture );
8085 }
86+
87+ sleep (1 );
8188 }
8289
8390 protected function loadFixture (string $ path ): void
You can’t perform that action at this time.
0 commit comments