Ensured events triggered as a result of a new visit are never skipped

This commit is contained in:
Alejandro Celaya
2021-04-08 14:09:26 +02:00
parent 86230d9bf3
commit 7b4456e73f
6 changed files with 17 additions and 11 deletions

View File

@@ -97,7 +97,7 @@ class LocateVisitTest extends TestCase
$this->em->flush()->shouldNotHaveBeenCalled();
$this->ipLocationResolver->resolveIpLocation(Argument::cetera())->shouldNotHaveBeenCalled();
$logWarning->shouldHaveBeenCalled();
$dispatch->shouldNotHaveBeenCalled();
$dispatch->shouldHaveBeenCalledOnce();
}
/** @test */

View File

@@ -84,6 +84,10 @@ class UpdateGeoLiteDbTest extends TestCase
$checkDbUpdate = $this->dbUpdater->checkDbUpdate(Argument::cetera())->will(
function (array $args) use ($total, $downloaded, $oldDbExists): void {
[, $secondCallback] = $args;
// Invoke several times to ensure the log is printed only once
$secondCallback($total, $downloaded, $oldDbExists);
$secondCallback($total, $downloaded, $oldDbExists);
$secondCallback($total, $downloaded, $oldDbExists);
},
);