Fix phpstan errors

This commit is contained in:
Oliver Davies 2025-06-15 17:22:37 +01:00
parent af83b3c431
commit 229cc62b03
8 changed files with 16 additions and 17 deletions

View file

@ -36,8 +36,12 @@ final class CallToActionTest extends ExistingSiteBase {
$email->set('title', 'Updated');
$email->save();
$value = $email->get('field_daily_email_cta')->getValue();
assert(is_array($value));
assert(isset($value[0]['target_id']));
$this->assertSame(
actual: $email->get('field_daily_email_cta')->getValue()[0]['target_id'],
actual: $value[0]['target_id'],
expected: $cta->id(),
);
}

View file

@ -23,17 +23,17 @@ class DailyEmailTokenTest extends BrowserTestBase {
public function test_the_token_returns_the_number_of_published_daily_emails(): void {
$this->createDailyEmailNode(
isPublished: TRUE,
title: $this->randomString(),
title: 'a',
);
$this->createDailyEmailNode(
isPublished: FALSE,
title: $this->randomString(),
title: 'b',
);
$this->createDailyEmailNode(
isPublished: TRUE,
title: $this->randomString(),
title: 'c',
);
$this->assertToken(