@@ -25,7 +25,7 @@ public function test_event_create_disabled_listener(): void
2525 $ this ->index ($ this ->productIndex );
2626 LaravelElasticaBridgeFacade::disableEventListener ();
2727 $ product = Product::factory ()->create ();
28- $ this ->assertNull ( $ this ->productIndex ->getDocumentInstance ($ product ));
28+ $ this ->assertNotInstanceOf (\ Elastica \Document::class, $ this ->productIndex ->getDocumentInstance ($ product ));
2929 }
3030
3131 public function test_event_create_enabled_listener (): void
@@ -44,7 +44,7 @@ public function test_event_update_disabled_listener(): void
4444 LaravelElasticaBridgeFacade::disableEventListener ();
4545 $ product = Product::all ()->random ();
4646 $ oldName = $ product ->name ;
47- $ newName = time ();
47+ $ newName = \ Carbon \Carbon:: now ()-> getTimestamp ();
4848 $ product ->name = $ newName ;
4949 $ this ->assertSame ($ oldName , $ this ->productIndex ->getDocumentInstance ($ product )->get ('name ' ));
5050 $ this ->assertNotSame ($ oldName , $ newName );
@@ -59,7 +59,7 @@ public function test_event_update_enabled_listener(): void
5959 LaravelElasticaBridgeFacade::enableEventListener ();
6060 $ product = Product::all ()->random ();
6161 $ oldName = $ product ->name ;
62- $ newName = time ();
62+ $ newName = \ Carbon \Carbon:: now ()-> getTimestamp ();
6363 $ product ->name = $ newName ;
6464 $ this ->assertSame ($ oldName , $ this ->productIndex ->getDocumentInstance ($ product )->get ('name ' ));
6565 $ this ->assertNotSame ($ oldName , $ newName );
@@ -82,15 +82,15 @@ public function test_event_delete_enabled_listener(): void
8282 LaravelElasticaBridgeFacade::enableEventListener ();
8383 $ product = Product::all ()->random ();
8484 $ product ->delete ();
85- $ this ->assertNull ( $ this ->productIndex ->getDocumentInstance ($ product ));
85+ $ this ->assertNotInstanceOf (\ Elastica \Document::class, $ this ->productIndex ->getDocumentInstance ($ product ));
8686 }
8787
8888 public function test_event_delete_model_not_in_index (): void
8989 {
9090 $ this ->index ($ this ->customerIndex );
9191 LaravelElasticaBridgeFacade::enableEventListener ();
9292 $ customer = Customer::findOrFail (1 );
93- $ this ->assertNull ( $ this ->customerIndex ->getDocumentInstance ($ customer ));
93+ $ this ->assertNotInstanceOf (\ Elastica \Document::class, $ this ->customerIndex ->getDocumentInstance ($ customer ));
9494 $ customer ->delete ();
9595 $ this ->assertNull ($ this ->customerIndex ->getDocumentInstance ($ customer ));
9696 }
0 commit comments