createNode([ 'type' => 'daily_email_cta', ]); $email = $this->createNode([ 'field_daily_email_cta' => NULL, 'type' => 'daily_email', ]); $this->assertNotEmpty($email->get('field_daily_email_cta')->getValue()); // TODO: assert the returned text. } public function test_saving_an_email_node_with_a_cta_will_keep_the_same_cta(): void { $cta = $this->createNode([ 'type' => 'daily_email_cta', ]); $email = $this->createNode([ 'field_daily_email_cta' => $cta, 'type' => 'daily_email', ]); $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: $value[0]['target_id'], expected: $cta->id(), ); } }