fix: map live service status to export wording
This commit is contained in:
1 parent
d8fe9a3875
commit
09610889f3
7 files changed
+129
-11
No files matched your search
@@ -19,9 +19,9 @@ use Symfony\Contracts\Cache\CacheInterface;
|
||||
/**
|
||||
* Tests that patchAvailabilities() carries the live service status, not just the contingent.
|
||||
*
|
||||
* When a Leistung's contingent runs out BusPro moves it to 'Anfrage' without necessarily
|
||||
* reporting frei="0", so the status is the only reliable signal. Dropping it meant every
|
||||
* availability rule read the status from the nightly XML export instead.
|
||||
* Dropping the status meant every availability rule read it from the nightly XML export instead.
|
||||
* The statuses here are already in export vocabulary; the parsers translate BusPro's live
|
||||
* "buchbar" / "ausgebucht" (see AvailabilitiesParserTest).
|
||||
*/
|
||||
class TravelLoaderAvailabilityTest extends TestCase
|
||||
{
|
||||
@@ -45,10 +45,10 @@ class TravelLoaderAvailabilityTest extends TestCase
|
||||
|
||||
$this->loader->patchAvailabilities(
|
||||
$travel,
|
||||
$this->createResponse([$this->createAvailability(60, Constants::STATUS_ON_REQUEST, 3)])
|
||||
$this->createResponse([$this->createAvailability(60, Constants::STATUS_BLOCKED, 3)])
|
||||
);
|
||||
|
||||
$this->assertSame(Constants::STATUS_ON_REQUEST, $service->status);
|
||||
$this->assertSame(Constants::STATUS_BLOCKED, $service->status);
|
||||
$this->assertSame(3, $service->available);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user