Skip to content

Commit

Permalink
Merge branch '6.0' into 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 4, 2023
2 parents 85394b4 + e05c332 commit 1a69006
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/php/RunDeleteCacheJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace SilverStripe\StaticPublishQueue\Job;

use SilverStripe\Dev\FunctionalTest;
use SilverStripe\Subsites\State\SubsiteState;
use Symbiote\QueuedJobs\Services\QueuedJobService;

class RunDeleteCacheJobTest extends FunctionalTest
Expand All @@ -12,7 +13,14 @@ public function testHydrationAffectsSignature()
$job = new DeleteStaticCacheJob();
$data = $job->getJobData();
$signature = $job->getSignature();
$this->assertEmpty($data->jobData);
if (class_exists(SubsiteState::class)) {
// The subsite ID is added via `AbstractQueuedJob::getJobData()`
// Without accounting for that, this test fails in the kitchen sink.
$expected = ['SubsiteID' => SubsiteState::singleton()->getSubsiteId()];
$this->assertSame($expected, json_decode(json_encode($data->jobData), true));
} else {
$this->assertEmpty($data->jobData);
}
$this->assertFalse($data->isComplete);

$job->hydrate(['/' => 1], null);
Expand Down

0 comments on commit 1a69006

Please sign in to comment.