Fix PHPUnit errors: 'TypeError: 'Behat\Mink\Element\TraversableElement::findButton(): Argument #1 ($locator) must be of type string, Drupal\Core\StringTranslation\TranslatableMarkup given'

Created on 4 March 2024, 9 months ago
Updated 19 March 2024, 8 months ago

Problem/Motivation

  • Fix PHPUnit errors:
    TypeError: 'Behat\Mink\Element\TraversableElement::findButton(): Argument #1 ($locator) must be of type string, Drupal\Core\StringTranslation\TranslatableMarkup given
πŸ› Bug report
Status

Fixed

Version

7.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States yas California πŸ‡ΊπŸ‡Έ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @yas
  • πŸ‡ΊπŸ‡ΈUnited States yas California πŸ‡ΊπŸ‡Έ
  • Pipeline finished with Failed
    9 months ago
    Total: 907s
    #110368
  • Status changed to Needs review 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States yas California πŸ‡ΊπŸ‡Έ

    @baldwinlouie

    Can you please review the patch? Thanks!

  • Pipeline finished with Failed
    9 months ago
    Total: 946s
    #111063
  • Status changed to Needs work 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States baldwinlouie

    @yas, I started to add comments to the code. But since my idea applies to all the changes, I will post it here.

    Instead of casting the to (string) $this->t('Save'), would it be better to use the following $this->t('Save')->render()?

    What do you think?

  • Pipeline finished with Failed
    9 months ago
    Total: 745s
    #111220
  • Status changed to Needs review 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States yas California πŸ‡ΊπŸ‡Έ

    @baldwinlouie

    Thank you for your review and suggestion. I changed from casting (string) to using ->render(). Can you review the patch again? Thanks

  • Status changed to RTBC 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States baldwinlouie

    @yas, thank you for the updated patch. It looks good to me now.

  • πŸ‡ΊπŸ‡ΈUnited States yas California πŸ‡ΊπŸ‡Έ

    @baldwinlouie

    Thank you for your review. I'll merge the patch to 6.x and 7.x, and close this issue as Fixed.

  • Pipeline finished with Skipped
    9 months ago
    #111256
  • Pipeline finished with Skipped
    9 months ago
    #111257
    • yas β†’ committed c1ff627c on 7.x
      Issue #3425376 by yas, baldwinlouie: Fix PHPUnit errors: 'TypeError: '...
  • Status changed to Fixed 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States yas California πŸ‡ΊπŸ‡Έ
  • Pipeline finished with Failed
    8 months ago
    #111483
  • Status changed to RTBC 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States yas California πŸ‡ΊπŸ‡Έ

    @baldwinlouie

    I found there are some uncovered codes for ->render(), so I'll merge the hotfix to 7.x, and close this issue as Fixed.

  • Pipeline finished with Skipped
    8 months ago
    #111577
    • yas β†’ committed 3761c37f on 7.x
      Issue #3425376 by yas: Fix PHPUnit errors: 'TypeError: 'Behat\Mink\...
  • Status changed to Fixed 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States yas California πŸ‡ΊπŸ‡Έ

    @baldwinlouie

    I found there are some uncovered codes for ->render(), so I'll merge the hotfix to 7.x, and close this issue as Fixed.

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

Production build 0.71.5 2024