This is a followup to #3054185: Test a FillPdfForm's availability in FillPdfLinkManipulator::parseLink() while remaining unit testable.

We may further simplify FillPdfLinkManipulator::parseLink() and FillPdfLinkManipulator::parseEntityIds().

Particularly, in parseLink(), we don't have to fall back to the 'node' entity type, as parseEntityIds() will already do so.
Furthermore, when falling back on the defaults, we may simply set entity_type and entity_id. No need to build an entity_ids array.
This, plus some obvious simplifications in parseEntityIds().

Also adding another test case, and making sure our tests don't sanitize the input.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pancho created an issue. See original summary.

Pancho’s picture

Pancho’s picture

Status: Needs review » Needs work

The last submitted patch, 3: fillpdf_refactor_parselink_3059104-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Pancho’s picture

Let's do it this way around to ensure all $context keys are set.

  • Pancho committed 280d514 on 8.x-4.x
    Issue #3059104 by Pancho: Refactor FillPdfLinkManipulator::parseLink()
    
Pancho’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.