Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • typo3 typo3
  • Project information
    • Project information
    • Activity
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Insights
    • Repository
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • typo3typo3
  • typo3typo3
  • Repository
Switch branch/tag
  • typo3
  • ..
  • Repository
  • PageRepositoryTest.php
Find file BlameHistoryPermalink
  • Alexander Schnitzler's avatar
    [TASK] Call static PHPUnit methods via self:: instead of $this-> · 362affba
    Alexander Schnitzler authored Oct 24, 2019 and Andreas Fernandez's avatar Andreas Fernandez 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: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
    Reviewed-by: Manuel Selbach's avatarManuel Selbach <manuel_selbach@yahoo.de>
    Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    Tested-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
    Tested-by: default avatarTYPO3com <noreply@typo3.com>
    Tested-by: Manuel Selbach's avatarManuel Selbach <manuel_selbach@yahoo.de>
    Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    362affba