Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/phpunit-bridge
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.4.16
Choose a base ref
...
head repository: symfony/phpunit-bridge
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7.2
Choose a head ref

Commits on May 28, 2019

  1. updated version to 5.0

    fabpot committed May 28, 2019
    Copy the full SHA
    779c625 View commit details
  2. Copy the full SHA
    1faada1 View commit details

Commits on May 30, 2019

  1. Merge branch '4.4'

    * 4.4:
      [HttpKernel] Make DebugHandlersListener internal
      HttpKernel 4.4 is incompatible with Console 5 because of the EventDispatcher changes.
      Add missed use class for Symfony\Bundle\FrameworkBundle\Test\WebTestCase::$client
      bump Twig bridge dependency
      [HttpClient] Minor fix in an error message
      Fix parameter documentation for Inflector::pluralize() method
      Use a more appropriate group when deprecating mode
      Marked several components as incompatible with EventDispatcher 5.
      bumped Symfony version to 4.3.1
      updated VERSION for 4.3.0
      updated CHANGELOG for 4.3.0
      [FrameworkBundle] fix test fixture using deprecated controller and add missing deprecation
      exchanged $rootDir and $fileLinkFormatter arguments in DebugCommand
      [FrameworkBundle] Add a validation on the messenger section
    nicolas-grekas committed May 30, 2019
    Copy the full SHA
    04729e9 View commit details

Commits on Jun 9, 2019

  1. Copy the full SHA
    2a6baaf View commit details

Commits on Jun 11, 2019

  1. Merge branch '4.4'

    * 4.4:
      add back possibility to use form themes without translations
      [HttpClient] fix Psr18Client handling of non-200 response codes
      [HttpClient] make Psr18Client implement relevant PSR-17 factories
      [WebProfilerBundle] fix FC with HttpFoundation v5
      [OptionsResolver] fix adding $triggerDeprecation to Options::offsetGet()
      [Form] test case is not legacy
      Fix reporting unsilenced deprecations from insulated tests
      Changed EventDispatcherInterface dependency from Component to Contracts
      fix handling nested embeddables
      [WebProfilerBundle] Select default theme based on user preferences
      [FrameworkBundle] Allow dots in translation domains
      Added FormInterface to @return Form::getClickedButton docblock
    nicolas-grekas committed Jun 11, 2019
    Copy the full SHA
    928e5c9 View commit details

Commits on Jun 13, 2019

  1. Merge branch '4.4'

    * 4.4:
      fixed CS
      fixed CS
      fixed CS
      fixed CS
      Do not log or call the proxy function when the locale is the same
      Added missing required dependencies on psr/cache and psr/container in symfony/cache-contracts and symfony/service-contracts respectively.
      [HttpClient] fix closing debug stream prematurely
      [Mailer] made code more robust
      Restore compatibility with php 5.5
      fixed sender/recipients in SMTP Envelope
      collect called listeners information only once
      [HttpClient] add HttplugClient for compat with libs that need httplug v1 or v2
      [HttpKernel] Remove TestEventDispatcher.
    fabpot committed Jun 13, 2019
    Copy the full SHA
    a6522fc View commit details
  2. Merge branch '4.4'

    * 4.4:
      [Security] minor improvement
      fix merge
    nicolas-grekas committed Jun 13, 2019
    Copy the full SHA
    8c7b1c4 View commit details

Commits on Jun 17, 2019

  1. Merge branch '4.4'

    * 4.4:
      [PhpUnitBridge] Bump PHPUnit 7+8
      Prepare for PHP 7.4 preload
      prevent double deprecation message
      [Validator] Deprecate unused arg in ExpressionValidator
      [Config] Introduce find method in ArrayNodeDefinition to ease configuration tree manipulation
      [DomCrawler][Feature][DX] Add Form::getName() method
      [VarDumper] caster for HttpClient's response dumps all info
    nicolas-grekas committed Jun 17, 2019
    Copy the full SHA
    d3ccbc9 View commit details

Commits on Jun 26, 2019

  1. Merge branch '4.4'

    * 4.4: (43 commits)
      [PhpunitBridge] Read environment variable from superglobals
      [Bridge/PhpUnit] Fix PHP5.5 compat
      [PhpUnitBridge] More accurate grouping
      fixed CS
      [Form] remove comment about to-be-removed method as it is used in master by ButtonBuilder
      Extract unrecoverable exception to interface
      [FrameworkBundle] Fix calling Client::getProfile() before sending a request
      Fix type error
      [Security/Core] require libsodium >= 1.0.14
      [Workflow] re-add workflow.definition tag to workflow services
      [Security/Core] Don't use ParagonIE_Sodium_Compat
      revert #30525 due to performance penalty
      collect called listeners information only once
      [Lock] fix missing inherit docs in RedisStore
      [Messenger] fix retrying handlers using DoctrineTransactionMiddleware
      [Mailgun Mailer] fixed issue when using html body
      [Messenger] make all stamps final and mark stamp not meant to be sent
      [HttpClient] fix timing measurements with NativeHttpClient
      add return type declaration
      use proper return types in ErrorHandler and ArgumentResolver
      ...
    nicolas-grekas committed Jun 26, 2019
    Copy the full SHA
    ded5bdf View commit details
  2. Merge branch '4.4'

    * 4.4:
      Bump phpunit-bridge
    nicolas-grekas committed Jun 26, 2019
    Copy the full SHA
    acaf575 View commit details
  3. Merge branch '4.4'

    * 4.4:
      [PhpUnitBridge] Fix tests
    nicolas-grekas committed Jun 26, 2019
    Copy the full SHA
    0632d2b View commit details
  4. Merge branch '4.4'

    * 4.4:
      Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)"
    nicolas-grekas committed Jun 26, 2019
    Copy the full SHA
    a25bdb8 View commit details
  5. Merge branch '4.4'

    * 4.4:
      Reject phpunit-bridge v5 for now
      Revert "Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)""
    nicolas-grekas committed Jun 26, 2019
    Copy the full SHA
    e1ab8f0 View commit details

Commits on Jun 27, 2019

  1. Merge branch '4.4'

    * 4.4:
      [Mailer] fixed tests on Windows
      [PhpUnitBridge] fix tests
      [Mailer] fixed error message when connecting to a stream raises an error before connect()
      [Mailer] fixed timeout type hint
      improve error messages in the event dispatcher
      [Security/Core] work around sodium_compat issue
      bumped Symfony version to 4.3.3
      updated VERSION for 4.3.2
      updated CHANGELOG for 4.3.2
      bumped Symfony version to 4.2.11
      updated VERSION for 4.2.10
      updated CHANGELOG for 4.2.10
      bumped Symfony version to 3.4.30
      updated VERSION for 3.4.29
      update CONTRIBUTORS for 3.4.29
      updated CHANGELOG for 3.4.29
      Fixed type annotation.
    nicolas-grekas committed Jun 27, 2019
    Copy the full SHA
    f520183 View commit details

Commits on Jul 4, 2019

  1. Merge branch '4.4'

    * 4.4: (33 commits)
      [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
      [FrameworkBundle] reset cache pools between requests
      [HttpFoundation] Accept must take the lead for Request::getPreferredFormat()
      [FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client
      Use ConnectionRegistry instead of RegistryInterface.
      Fixes windows error
      Improving the request/response format autodetection
      [Messager] Simplified MessageBus::__construct()
      [WIP][Mailer] Overwrite envelope sender and recipients from config
      [Messenger] Added more test for MessageBus
      [Mime] Updated some PHPDoc contents
      [PropertyAccess] Adds entries to CHANGELOG and UPGRADE
      fixed typo
      [FrameworkBundle] Simplified some code in the DI configuration
      [Filesystem] added missing deprecations to UPGRADE-4.3.md
      [Filesystem] depreacte calling isAbsolutePath with a null
      Fix authentication for redis transport
      only decorate when an event dispatcher was passed
      [Messenger] Added support for auto trimming of redis streams
      [FrmaeworkBundle] More simplifications in the DI configuration
      ...
    nicolas-grekas committed Jul 4, 2019
    Copy the full SHA
    444c620 View commit details
  2. Merge branch '4.4'

    * 4.4:
      [Bridge/PhpUnit] fix running composer to install phpunit
      [ErrorCatcher] Pretty print JSON formatted errors
    nicolas-grekas committed Jul 4, 2019
    Copy the full SHA
    da3d101 View commit details
  3. Merge branch '4.4'

    * 4.4:
      bump phpunit-bridge cache ids
    nicolas-grekas committed Jul 4, 2019
    Copy the full SHA
    a28e90e View commit details

Commits on Jul 5, 2019

  1. Merge branch '4.4'

    * 4.4:
      [PhpUnitBridge] fix running simple-phpunit on Windows
      fixed UPGRADE
      fixed phpdocs
      fixed phpdocs
      [ErrorCatcher] Fixed some escaping in XML errors
      [Messenger] fix broken key normalization
      [FrameworkBundle] Allow creating chained cache pools by providing several adapters
      [FrameworkBundle] Use default_locale as default value for translator.fallbacks
    nicolas-grekas committed Jul 5, 2019
    Copy the full SHA
    bbccbc7 View commit details

Commits on Jul 11, 2019

  1. Merge branch '4.4'

    * 4.4: (53 commits)
      Fix Twig 1.x compatibility
      Deprecating templateExists method
      [Translator] Improve farsi(persian) translations for Form
      [Validator] Fix Changelog for #31511
      [Lock][Console] bump lock requirement in console
      [Lock] minor: add missing alias for PersistenStoreInterface
      Improve fa translations
      Dynamic bundle assets
      [Lock] rename and deprecate Factory into LockFactory
      [Debug] Restoring back the state of the Debug component (1st step)
      Spell "triggering" properly
      [Lock] Fix tests
      Added tests to cover the possibility of having scalars as services.
      fixed CS
      [Lock] Split \"StoreInterface\" into multiple interfaces with less responsability
      [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit
      [Validator] Allow to use property paths to get limits in range constraint
      Fix missing deprecations
      fixed tests on old PHP versions
      [FrameworkBundle] Inform the user when save_path will be ignored
      ...
    nicolas-grekas committed Jul 11, 2019
    Copy the full SHA
    3e3b3f1 View commit details

Commits on Jul 18, 2019

  1. Merge branch '4.4'

    * 4.4: (30 commits)
      fix merge
      fix merge
      [HttpClient] fix debug output added to stderr at shutdown
      fix cs
      [Mailer] fixed logic
      fixed missing license
      Add a new ErrorHandler component (mirror of the Debug component)
      Use mocks before replacing the error handler
      [Config] Do not use absolute path when computing the vendor freshness
      [Process] Path resolution for FCGI configuration
      Bump minimum version of symfony/phpunit-bridge
      Container*::getServiceIds() should return an array of string
      [Config][ReflectionClassResource] Use ternary instead of null coaelscing operator
      [Validator] Add missing Russian and Ukrainian translations
      [Translation] Use HTTPS and fix a url
      [Config] Fix for signatures of typed properties
      [Validator] Add missing Hungarian translations
      [Validator] Add Lithuanian translation for Range validator
      Add HTTPS to a URL
      sync translation files
      ...
    nicolas-grekas committed Jul 18, 2019
    Copy the full SHA
    a5d3bc8 View commit details
  2. Merge branch '4.4'

    * 4.4:
      [Lock] feature: lock split interface fix post-merge review
      Mute deprecations triggered from phpunit
    nicolas-grekas committed Jul 18, 2019
    Copy the full SHA
    b9ddb6f View commit details

Commits on Jul 31, 2019

  1. Copy the full SHA
    c051426 View commit details
  2. Copy the full SHA
    f3a6458 View commit details
  3. Copy the full SHA
    190f936 View commit details
  4. Merge branch '4.4'

    * 4.4:
      [Cache] fix cs
      Make tests support phpunit 8
      Allow Travis CI to build on PHP 7.4
      [DI] Allow dumping the container in one file instead of many files
    nicolas-grekas committed Jul 31, 2019
    Copy the full SHA
    eef2882 View commit details

Commits on Aug 1, 2019

  1. Merge branch '4.4'

    * 4.4:
      Fix assertInternalType deprecation in phpunit 9
      Micro-typo fix
      add parameter type declarations to private methods
    nicolas-grekas committed Aug 1, 2019
    Copy the full SHA
    617fb9c View commit details
  2. Merge branch '4.4'

    * 4.4:
      Fix assertInternalType deprecation in phpunit 9
      Fix assertInternalType deprecation in phpunit 9
      Ensure signatures for setUp|tearDown|setUpAfterClass|tearDownAfterClass methods in tests are compatible with phpunit 8.2
    nicolas-grekas committed Aug 1, 2019
    Copy the full SHA
    762104b View commit details
  3. Merge branch '4.4'

    * 4.4:
      [Yaml] fix test for PHP 7.4
      Add polyfill for TestCase::createMock()
      Skip tests that fatal-error on PHP 7.4 because of missing parent classes
    nicolas-grekas committed Aug 1, 2019
    Copy the full SHA
    98f6f0b View commit details
  4. Merge branch '4.4'

    * 4.4:
      Fix symfony/phpunit-bridge not up to date in phpunit 4.8 test suite
      Sync "not implementing the method" deprecations messages
      Twig's namespaces can be null
    nicolas-grekas committed Aug 1, 2019
    Copy the full SHA
    7bd7296 View commit details
  5. Copy the full SHA
    611dc21 View commit details
  6. minor #32869 [PhpUnitBridge] Add polyfill for expectException* method…

    …s (jderusse)
    
    This PR was merged into the 5.0-dev branch.
    
    Discussion
    ----------
    
    [PhpUnitBridge] Add polyfill for expectException* methods
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | no
    | New feature?  | yes
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | #32844
    | License       | MIT
    | Doc PR        | NA
    
    this PR provides a polyfill for methods `setException`, `setExceptionMessage`, `setExceptionMessageRegExp` and `setExceptionCode`
    
    Commits
    -------
    
    c7a8ce56dc [Bridge/PhpUnit] Add polyfill for expectException*
    nicolas-grekas committed Aug 1, 2019
    Copy the full SHA
    9c2b828 View commit details
  7. Merge branch '4.4'

    * 4.4:
      cs fix
      Replace calls to setExpectedException by Pollyfill
    nicolas-grekas committed Aug 1, 2019
    Copy the full SHA
    58cf06e View commit details

Commits on Aug 3, 2019

  1. Merge branch '4.4'

    * 4.4:
      Polyfill the method createPartialMock
    nicolas-grekas committed Aug 3, 2019
    Copy the full SHA
    60a698c View commit details
  2. Merge branch '4.4'

    * 4.4:
      [Bridge/PhpUnit] cleanup fix
      [PhpUnitBridge] Add polyfill for methods assertNan, assertFinite and assertInfinite
      [Mailer] fixed wrong error message when connection closes unexpectedly
      [Mailer] added debug info to TransportExceptionInterface
      [Mailer] fixed error that is masked by another error
      [Mailer] fixed the order of authenticators
    nicolas-grekas committed Aug 3, 2019
    Copy the full SHA
    8ed1b80 View commit details
  3. Merge branch '4.4'

    * 4.4:
      [PhpUnitBridge] add more assert*() polyfills
      [PhpUnitBridge] added polyfill for assertStringContainsString*()
      [PhpUnitBridge] cleanup implementation of expectException*()
    nicolas-grekas committed Aug 3, 2019
    Copy the full SHA
    6c60b91 View commit details
  4. Merge branch '4.4'

    * 4.4:
      Inject ForwardCompatibiliy in TestCase
    nicolas-grekas committed Aug 3, 2019
    Copy the full SHA
    67ecb98 View commit details
  5. Merge branch '4.4'

    * 4.4:
      Remove use of ForwardCompatTrait
      Remove deprecated methods assertArraySubset
    nicolas-grekas committed Aug 3, 2019
    Copy the full SHA
    645816e View commit details

Commits on Aug 4, 2019

  1. Merge branch '4.4'

    * 4.4:
      [PhpUnitBridge] fix internal annotation
      [Mime] added AbstractPart::asDebugString()
      [Mailer] added a name to the transport
      [Mailer] added missing entry in the CHANGELOG
      [FrameworkBundle] add config translator cache_dir
      [Yaml] Add flag to dump NULL as ~
    nicolas-grekas committed Aug 4, 2019
    Copy the full SHA
    9e2e38f View commit details
  2. Merge branch '4.4'

    * 4.4:
      Polyfill assertion method on Filesystem
      [Mailer] added message events logger
      fix typo
    nicolas-grekas committed Aug 4, 2019
    Copy the full SHA
    4479d6a View commit details

Commits on Aug 5, 2019

  1. Merge branch '4.4'

    * 4.4:
      fix case
      [Messenger] Removed named parameters and replaced with `?` placeholders for sqlsrv compatibility
      [FrameworkBundle] Detect indirect env vars in routing
      [Form] type cannot be a FormTypeInterface anymore
      [HttpClient] use "idle" instead of "inactivity" when telling about the timeout option
      Create mailBody with only attachments part present
      Remove calls to deprecated function assertAttributeX
      [PhpUnitBridge] make the bridge act as a polyfill for newest PHPUnit features
      [Intl] Order alpha2 to alpha3 mapping
      [Routing] added a warning about the getRouteCollection() method
      Allow sutFqcnResolver to return array
      [Messenger] Fix incompatibility with FrameworkBundle <4.3.1
      Created alias to FlattenException to avoid BC break
      [Ldap] Add security LdapUser and provider
      [HttpFoundation] Revert getClientIp @return docblock
    xabbuh committed Aug 5, 2019
    Copy the full SHA
    6a73457 View commit details
  2. Merge branch '4.4'

    * 4.4:
      Minor fixes
      [Mailer] fixed dispatcher not available in Mailer
      [HttpClient] Minor fixes
      Use namespaced Phpunit classes
      Add polyfill for PhpUnit namespace
      [Messenger] Fixed ConsumeMessagesCommand configuration
      [Form] remove leftover int child phpdoc
      Support DateTimeInterface in IntlDateFormatter::format
      [PhpUnitBridge] fixed PHPUnit 8.3 compatibility: method handleError was renamed to __invoke
      [Yaml] Removed unused $nullAsTilde property
      [Security] add support for opportunistic password migrations
      [Lock] Legacy test should implement legacy interface
      fixed phpdocs
      Use PHPunit assertion
      [Intl] Order alpha2 to alpha3 mapping + phpdoc fixes
    nicolas-grekas committed Aug 5, 2019
    Copy the full SHA
    a7ab672 View commit details

Commits on Aug 6, 2019

  1. Merge branch '4.4'

    * 4.4:
      Fix name of logical classes
      [Mailer] made the message logger permanent
    nicolas-grekas committed Aug 6, 2019
    Copy the full SHA
    6ce862d View commit details
  2. Copy the full SHA
    a96c0a9 View commit details
  3. Merge branch '4.4'

    * 4.4:
      bump phpunit-bridge cache-id
      removed unneeded phpdocs
      Use assertStringContainsString when needed
      Use assert assertContainsEquals when needed
      Use assertEqualsWithDelta when required
    nicolas-grekas committed Aug 6, 2019
    Copy the full SHA
    eb31dff View commit details

Commits on Aug 7, 2019

  1. Merge branch '4.4'

    * 4.4:
      fix merge
      Fix inconsistent return points.
      pass translation parameters to the trans filter
      [Mime] fixed wrong mimetype
      [ProxyManagerBridge] Polyfill for unmaintained version
      [HttpClient] Declare `$active` first to prevent weird issue
      Remove deprecated assertContains
      [HttpClient] fix tests
      SCA: dropped unused mocks, duplicate import and a function alias usage
      Added correct plural for box -> boxes
      [Config] fix test
      Fix remaining tests
      fix getName() when transport is null
      [Console] Check for ErrorHandler classes
      Improve fa (persian) translation
    nicolas-grekas committed Aug 7, 2019
    Copy the full SHA
    46aa6c5 View commit details

Commits on Aug 8, 2019

  1. Merge branch '4.4'

    * 4.4:
      Fix compatibility with PHPUnit 8
      Disable phpunit typehint patch on 4.3 branch
      Fix deprecation on 4.3
    nicolas-grekas committed Aug 8, 2019
    Copy the full SHA
    bf2645e View commit details

Commits on Aug 9, 2019

  1. Merge branch '4.4'

    * 4.4:
      Fix typo
      Fix unitialized variable in DeprecationErrorHandler
      fix Danish translations
      Support ISO 3166-1 Alpha-3 country codes
      Added the missing translations for the Slovak 'sk' locale.
      Add deprecation for method signature
      Add compatibility trait for PHPUnit constraint classes
      [HttpFoundation] Clear invalid session cookie
      Fix tst patern to handle callstack with/without return typehint
      Fix negative DateInterval
      [Validator] Allow objects implementing __toString() to be used as violation messages
      [FrameworkBundle][Routing] Private service route loaders
      [DoctrineBridge] Allow invokable event listeners
    nicolas-grekas committed Aug 9, 2019
    Copy the full SHA
    9c62747 View commit details

Commits on Aug 10, 2019

  1. Merge branch '4.4'

    * 4.4:
      cleanups
      Disable PHPUnit result cache on the CI
      [Security] Cleanup "Digest nonce has expired." translation
      [Translation] Highlight invalid translation status
      Added translations in validator for Serbian Cyrillic
      Added translations in validator for Serbian Latin
      [EventDispatcher] wrong Request class
      [DependencyInjection] improved exception message
    nicolas-grekas committed Aug 10, 2019
    Copy the full SHA
    f78f25f View commit details

Commits on Aug 14, 2019

  1. Merge branch '4.4'

    * 4.4:
      Remove superfluous phpdoc tags
    nicolas-grekas committed Aug 14, 2019
    Copy the full SHA
    e03db6c View commit details

Commits on Aug 20, 2019

  1. Merge branch '4.4'

    * 4.4:
      cs fix
      Fix inconsistent return points.
      [Config] Add handling for ignored keys in ArrayNode::mergeValues.
      Fix inconsistent return points.
      [Security/Core] UserInterface::getPassword() can return null
      cs fix
      cs fix
      Fix missing exporter in PHPUnit constraint poylfill
      added `Process::getLastOutputTime()` method
      [Router] Fix TraceableUrlMatcher behaviour with trailing slash
      [HttpKernel] Remove outdated docblock comment
      Fix handling for session parameters
      Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
    nicolas-grekas committed Aug 20, 2019
    Copy the full SHA
    c014fdf View commit details
Showing with 4,471 additions and 2,110 deletions.
  1. +1 −2 .gitattributes
  2. +8 −0 .github/PULL_REQUEST_TEMPLATE.md
  3. +20 −0 .github/workflows/close-pull-request.yml
  4. +54 −0 CHANGELOG.md
  5. +37 −11 ClassExistsMock.php
  6. +33 −9 ClockMock.php
  7. +3 −9 ConstraintTrait.php
  8. +102 −9 CoverageListener.php
  9. +178 −133 DeprecationErrorHandler.php
  10. +247 −70 DeprecationErrorHandler/Configuration.php
  11. +155 −102 DeprecationErrorHandler/Deprecation.php
  12. +57 −0 DeprecationErrorHandler/DeprecationGroup.php
  13. +49 −0 DeprecationErrorHandler/DeprecationNotice.php
  14. +21 −21 DnsMock.php
  15. +30 −0 ExpectDeprecationTrait.php
  16. +30 −0 ExpectUserDeprecationMessageTrait.php
  17. +39 −0 Extension/EnableClockMockSubscriber.php
  18. +39 −0 Extension/RegisterClockMockSubscriber.php
  19. +39 −0 Extension/RegisterDnsMockSubscriber.php
  20. +1 −1 LICENSE
  21. +0 −57 Legacy/CommandForV5.php
  22. +2 −7 Legacy/{CommandForV6.php → CommandForV7.php}
  23. +1 −6 Legacy/CommandForV9.php
  24. +0 −130 Legacy/ConstraintTraitForV6.php
  25. +1 −1 Legacy/ConstraintTraitForV7.php
  26. +0 −35 Legacy/CoverageListenerForV5.php
  27. +0 −41 Legacy/CoverageListenerForV6.php
  28. +0 −41 Legacy/CoverageListenerForV7.php
  29. +0 −160 Legacy/CoverageListenerTrait.php
  30. +45 −0 Legacy/ExpectDeprecationTraitBeforeV8_4.php
  31. +65 −0 Legacy/ExpectDeprecationTraitForV8_4.php
  32. +0 −402 Legacy/PolyfillAssertTrait.php
  33. +3 −98 Legacy/PolyfillTestCaseTrait.php
  34. +0 −70 Legacy/SetUpTearDownTraitForV5.php
  35. +0 −58 Legacy/SetUpTearDownTraitForV8.php
  36. +0 −54 Legacy/SymfonyTestsListenerForV5.php
  37. +0 −58 Legacy/SymfonyTestsListenerForV6.php
  38. +88 −65 Legacy/SymfonyTestsListenerTrait.php
  39. +7 −6 README.md
  40. +0 −28 SetUpTearDownTrait.php
  41. +133 −0 SymfonyExtension.php
  42. +1 −7 SymfonyTestsListener.php
  43. +0 −40 Tests/BootstrapTest.php
  44. +46 −0 Tests/ClassExistsMockTest.php
  45. +10 −0 Tests/ClockMockTest.php
  46. +40 −16 Tests/CoverageListenerTest.php
  47. +529 −101 Tests/DeprecationErrorHandler/ConfigurationTest.php
  48. +30 −0 Tests/DeprecationErrorHandler/DeprecationGroupTest.php
  49. +35 −0 Tests/DeprecationErrorHandler/DeprecationNoticeTest.php
  50. +19 −15 Tests/DeprecationErrorHandler/DeprecationTest.php
  51. +81 −0 Tests/DeprecationErrorHandler/baseline.phpt
  52. +76 −0 Tests/DeprecationErrorHandler/baseline2.phpt
  53. +79 −0 Tests/DeprecationErrorHandler/baseline3.phpt
  54. +41 −0 Tests/DeprecationErrorHandler/debug_class_loader_autoload.phpt
  55. +41 −0 Tests/DeprecationErrorHandler/debug_class_loader_deprecation.phpt
  56. +1 −1 Tests/DeprecationErrorHandler/deprecation/deprecation.php
  57. +37 −0 Tests/DeprecationErrorHandler/disabled_1.phpt
  58. +31 −1 Tests/DeprecationErrorHandler/fake_app/AppService.php
  59. +13 −0 Tests/DeprecationErrorHandler/fake_app/BarService.php
  60. +9 −0 Tests/DeprecationErrorHandler/fake_app/ExtendsDeprecatedFromVendor.php
  61. +10 −0 Tests/DeprecationErrorHandler/fake_vendor/acme/lib/ExtendsDeprecatedClassFromOtherVendor.php
  62. +15 −0 Tests/DeprecationErrorHandler/fake_vendor/acme/lib/PhpDeprecation.php
  63. +14 −5 Tests/DeprecationErrorHandler/fake_vendor/acme/lib/SomeService.php
  64. +7 −7 Tests/DeprecationErrorHandler/fake_vendor/acme/lib/deprecation_riddled.php
  65. +16 −0 Tests/DeprecationErrorHandler/fake_vendor/bar/lib/AnotherService.php
  66. +14 −3 Tests/DeprecationErrorHandler/fake_vendor/composer/autoload_real.php
  67. +10 −0 Tests/DeprecationErrorHandler/fake_vendor/fcy/lib/DeprecatedClass.php
  68. +1 −1 Tests/DeprecationErrorHandler/fake_vendor_bis/composer/autoload_real.php
  69. +1 −1 Tests/DeprecationErrorHandler/fake_vendor_bis/foo/lib/SomeOtherService.php
  70. +65 −0 Tests/DeprecationErrorHandler/generate_baseline.phpt
  71. +2 −2 Tests/DeprecationErrorHandler/generate_phar.php
  72. +80 −0 Tests/DeprecationErrorHandler/ignore.phpt
  73. +1 −1 Tests/DeprecationErrorHandler/lagging_vendor.phpt
  74. +60 −0 Tests/DeprecationErrorHandler/log_file.phpt
  75. +1 −1 Tests/DeprecationErrorHandler/multiple_autoloads.phpt
  76. +35 −0 Tests/DeprecationErrorHandler/partially_quiet.phpt
  77. +36 −0 Tests/DeprecationErrorHandler/partially_quiet2.phpt
  78. +43 −0 Tests/DeprecationErrorHandler/php_deprecation_from_vendor_class.phpt
  79. +1 −1 Tests/DeprecationErrorHandler/quiet.phpt
  80. +39 −0 Tests/DeprecationErrorHandler/quiet_but_failing.phpt
  81. +58 −0 Tests/DeprecationErrorHandler/trigger_deprecation_types.phpt
  82. +58 −0 Tests/DeprecationErrorHandler/trigger_error_types.phpt
  83. +3 −5 Tests/DeprecationErrorHandler/weak_vendors_on_vendor.phpt
  84. +82 −0 Tests/EnumExistsMockTest.php
  85. +92 −0 Tests/ExpectDeprecationTraitTest.php
  86. +3 −0 Tests/ExpectedDeprecationAnnotationTest.php
  87. +52 −0 Tests/FailTests/ExpectDeprecationTraitTestFail.php
  88. +34 −0 Tests/FailTests/NoAssertionsTestNotRisky.php
  89. +46 −0 Tests/FailTests/NoAssertionsTestRisky.php
  90. +16 −0 Tests/Fixtures/ExistingEnum.php
  91. +16 −0 Tests/Fixtures/ExistingEnumReal.php
  92. +12 −16 Tests/Fixtures/coverage/phpunit-with-listener.xml.dist
  93. +11 −14 Tests/Fixtures/coverage/phpunit-without-listener.xml.dist
  94. +1 −1 Tests/Fixtures/coverage/tests/BarCovTest.php
  95. 0 Tests/Fixtures/coverage/tests/{SutNotFindTest.php → SutNotFoundTest.php}
  96. +0 −10 Tests/Fixtures/coverage/tests/bootstrap.php
  97. +29 −0 Tests/Fixtures/symfonyextension/phpunit-with-extension.xml.dist
  98. +22 −0 Tests/Fixtures/symfonyextension/phpunit-without-extension.xml.dist
  99. +16 −0 Tests/Fixtures/symfonyextension/src/ClassExtendingFinalClass.php
  100. +19 −0 Tests/Fixtures/symfonyextension/src/FinalClass.php
  101. +32 −0 Tests/Fixtures/symfonyextension/tests/bootstrap.php
  102. +12 −1 Tests/ProcessIsolationTest.php
  103. +140 −0 Tests/SymfonyExtension.php
  104. +64 −0 Tests/SymfonyExtensionWithManualRegister.php
  105. +39 −0 Tests/expectdeprecationfail.phpt
  106. +20 −0 Tests/expectnotrisky.phpt
  107. +26 −0 Tests/expectrisky.phpt
  108. +32 −0 Tests/symfonyextension.phpt
  109. +296 −0 Tests/symfonyextensionnotregistered.phpt
  110. +2 −4 TextUI/Command.php
  111. +131 −57 bin/simple-phpunit.php
  112. +27 −98 bootstrap.php
  113. +13 −8 composer.json
  114. +9 −9 phpunit.xml.dist
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/Tests export-ignore
/phpunit.xml.dist export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.git* export-ignore
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---

Please submit your PR here instead:
https://github.com/symfony/symfony

This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
20 changes: 20 additions & 0 deletions .github/workflows/close-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Close Pull Request

on:
pull_request_target:
types: [opened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/symfony/symfony
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
CHANGELOG
=========

7.2
---

* Add a PHPUnit extension that registers the clock mock and DNS mock and the `DebugClassLoader` from the ErrorHandler component if present
* Add `ExpectUserDeprecationMessageTrait` with a polyfill of PHPUnit's `expectUserDeprecationMessage()`
* Use `total` for asserting deprecation count when a group is not defined

6.4
---

* Allow setting the locale using `SYMFONY_PHPUNIT_LOCALE` env var

6.3
---

* Add support for mocking the `enum_exists` function
* Enable reporting of deprecations triggered by Doctrine by default

6.2
---

* Add support for mocking the `hrtime()` function

6.1
---

* Add option `ignoreFile` to configure a file that lists deprecation messages to ignore

6.0
---

* Remove `SetUpTearDownTrait`

5.3
---

* bumped the minimum PHP version to 7.1.3
* bumped the minimum PHPUnit version to 7.5
* deprecated the `SetUpTearDownTrait` trait, use original methods with "void" return typehint.
* added `logFile` option to write deprecations to a file instead of echoing them

5.1.0
-----

* ignore verbosity settings when the build fails because of deprecations
* added per-group verbosity
* added `ExpectDeprecationTrait` to be able to define an expected deprecation from inside a test
* deprecated the `@expectedDeprecation` annotation, use the `ExpectDeprecationTrait::expectDeprecation()` method instead

5.0.0
-----

* removed `weak_vendor` mode, use `max[self]=0` instead

4.4.0
-----

48 changes: 37 additions & 11 deletions ClassExistsMock.php
Original file line number Diff line number Diff line change
@@ -18,34 +18,60 @@ class ClassExistsMock
{
private static $classes = [];

private static $enums = [];

/**
* Configures the classes to be checked upon existence.
*
* @param array $classes Mocked class names as keys (case sensitive, without leading root namespace slash) and booleans as values
* @param array $classes Mocked class names as keys (case-sensitive, without leading root namespace slash) and booleans as values
*/
public static function withMockedClasses(array $classes)
public static function withMockedClasses(array $classes): void
{
self::$classes = $classes;
}

public static function class_exists($name, $autoload = true)
/**
* Configures the enums to be checked upon existence.
*
* @param array $enums Mocked enums names as keys (case-sensitive, without leading root namespace slash) and booleans as values
*/
public static function withMockedEnums(array $enums): void
{
self::$enums = $enums;
self::$classes += $enums;
}

public static function class_exists($name, $autoload = true): bool
{
return (bool) (self::$classes[ltrim($name, '\\')] ?? \class_exists($name, $autoload));
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \class_exists($name, $autoload);
}

public static function interface_exists($name, $autoload = true)
public static function interface_exists($name, $autoload = true): bool
{
return (bool) (self::$classes[ltrim($name, '\\')] ?? \interface_exists($name, $autoload));
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \interface_exists($name, $autoload);
}

public static function trait_exists($name, $autoload = true)
public static function trait_exists($name, $autoload = true): bool
{
return (bool) (self::$classes[ltrim($name, '\\')] ?? \trait_exists($name, $autoload));
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \trait_exists($name, $autoload);
}

public static function enum_exists($name, $autoload = true):bool
{
$name = ltrim($name, '\\');

return isset(self::$enums[$name]) ? (bool) self::$enums[$name] : \enum_exists($name, $autoload);
}

public static function register($class)
public static function register($class): void
{
$self = \get_called_class();
$self = static::class;

$mockedNs = [substr($class, 0, strrpos($class, '\\'))];
if (0 < strpos($class, '\\Tests\\')) {
@@ -55,7 +81,7 @@ public static function register($class)
$mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6);
}
foreach ($mockedNs as $ns) {
foreach (['class', 'interface', 'trait'] as $type) {
foreach (['class', 'interface', 'trait', 'enum'] as $type) {
if (\function_exists($ns.'\\'.$type.'_exists')) {
continue;
}
42 changes: 33 additions & 9 deletions ClockMock.php
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ class ClockMock
{
private static $now;

public static function withClockMock($enable = null)
public static function withClockMock($enable = null): ?bool
{
if (null === $enable) {
return null !== self::$now;
@@ -30,7 +30,7 @@ public static function withClockMock($enable = null)
return null;
}

public static function time()
public static function time(): int
{
if (null === self::$now) {
return \time();
@@ -39,7 +39,7 @@ public static function time()
return (int) self::$now;
}

public static function sleep($s)
public static function sleep($s): int
{
if (null === self::$now) {
return \sleep($s);
@@ -50,7 +50,7 @@ public static function sleep($s)
return 0;
}

public static function usleep($us)
public static function usleep($us): void
{
if (null === self::$now) {
\usleep($us);
@@ -59,6 +59,9 @@ public static function usleep($us)
}
}

/**
* @return string|float
*/
public static function microtime($asFloat = false)
{
if (null === self::$now) {
@@ -69,10 +72,10 @@ public static function microtime($asFloat = false)
return self::$now;
}

return sprintf('%0.6f00 %d', self::$now - (int) self::$now, (int) self::$now);
return \sprintf('%0.6f00 %d', self::$now - (int) self::$now, (int) self::$now);
}

public static function date($format, $timestamp = null)
public static function date($format, $timestamp = null): string
{
if (null === $timestamp) {
$timestamp = self::time();
@@ -81,7 +84,7 @@ public static function date($format, $timestamp = null)
return \date($format, $timestamp);
}

public static function gmdate($format, $timestamp = null)
public static function gmdate($format, $timestamp = null): string
{
if (null === $timestamp) {
$timestamp = self::time();
@@ -90,9 +93,25 @@ public static function gmdate($format, $timestamp = null)
return \gmdate($format, $timestamp);
}

public static function register($class)
/**
* @return array|int|float
*/
public static function hrtime($asNumber = false)
{
$self = \get_called_class();
$ns = (self::$now - (int) self::$now) * 1000000000;

if ($asNumber) {
$number = \sprintf('%d%d', (int) self::$now, $ns);

return \PHP_INT_SIZE === 8 ? (int) $number : (float) $number;
}

return [(int) self::$now, (int) $ns];
}

public static function register($class): void
{
$self = static::class;

$mockedNs = [substr($class, 0, strrpos($class, '\\'))];
if (0 < strpos($class, '\\Tests\\')) {
@@ -137,6 +156,11 @@ function gmdate(\$format, \$timestamp = null)
{
return \\$self::gmdate(\$format, \$timestamp);
}
function hrtime(\$asNumber = false)
{
return \\$self::hrtime(\$asNumber);
}
EOPHP
);
}
12 changes: 3 additions & 9 deletions ConstraintTrait.php
Original file line number Diff line number Diff line change
@@ -12,20 +12,14 @@
namespace Symfony\Bridge\PhpUnit;

use PHPUnit\Framework\Constraint\Constraint;
use ReflectionClass;

$r = new ReflectionClass(Constraint::class);
if (\PHP_VERSION_ID < 70000 || !$r->getMethod('matches')->hasReturnType()) {
trait ConstraintTrait
{
use Legacy\ConstraintTraitForV6;
}
} elseif ($r->getProperty('exporter')->isProtected()) {
$r = new \ReflectionClass(Constraint::class);
if ($r->getProperty('exporter')->isProtected()) {
trait ConstraintTrait
{
use Legacy\ConstraintTraitForV7;
}
} elseif (\PHP_VERSION < 70100 || !$r->getMethod('evaluate')->hasReturnType()) {
} elseif (!$r->getMethod('evaluate')->hasReturnType()) {
trait ConstraintTrait
{
use Legacy\ConstraintTraitForV8;
Loading