Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • C CMS
  • Project information
    • Project information
    • Activity
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare revisions
    • Locked files
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • typo3typo3
  • CI
  • CMS
  • Repository
  • cms
  • ..
  • Persistence
  • EnableFieldsTest.php
Find file Blame History Permalink
  • Alexander Schnitzler's avatar
    [TASK] Call static PHPUnit methods via self:: instead of $this-> · 362affba
    Alexander Schnitzler authored Oct 24, 2019 and afernandez's avatar afernandez committed Oct 24, 2019
    Class \PHPUnit\Framework\TestCase provides many assertion methods
    that can be called statically and dynamically in the context of
    tests. Sebastian Bergmann states that neither using $this nor
    self/static is right or wrong.
    
    There are two reasons to use self/static however. First of all
    IDE's like PhpStorm support code inspections that tell you to
    not call static methods dynamically and therefore make your
    code look like a christmas tree. Secondly, there is a rule
    for php-cs-fixer that can take care of the initial change
    and which helps sticking to one specific format, unifying
    the code style overall.
    
    Releases: master
    Resolves: #89499
    Change-Id: Ib4a43a94a0df220b052b88b3c3e37e716560e996
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62095
    
    
    Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
    Reviewed-by: default avatarManuel Selbach <manuel_selbach@yahoo.de>
    Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
    Tested-by: default avatarTYPO3com <noreply@typo3.com>
    Tested-by: default avatarManuel Selbach <manuel_selbach@yahoo.de>
    Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    362affba