Skip to content

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Aug 5, 2019

Provides documentaiton for the new features of PHPUnitBridge

Fixes #12092

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments from my side 👍

@OskarStark
Copy link
Contributor

@nicolas-grekas I would appreciate a review from your side here. Thanks

@OskarStark OskarStark added this to the 4.4 milestone Aug 16, 2019
@@ -24,6 +24,14 @@ It comes with the following features:
* Provides a modified version of PHPUnit that does not embed ``symfony/yaml`` nor
``prophecy`` to prevent any conflicts with these dependencies.

* Provides polyfills for methods that are not available in older version of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to remove the negation wat about:
Provides polyfills to augment older versions of PHPUnit with methods provided by its newest versions.

javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Oct 1, 2019
…PUnitBridge (jderusse)

This PR was merged into the 4.4 branch.

Discussion
----------

Add documentation for polyfill provided by the PHPUnitBridge

Provides documentaiton for the new features of PHPUnitBridge

Fixes symfony#12092

Commits
-------

d1e0bae Add documentation for polyfill provided by the PHPUnitBridge
@javiereguiluz javiereguiluz merged commit d1e0bae into symfony:4.4 Oct 1, 2019
@javiereguiluz
Copy link
Member

I finally merged this ... after making all changes requested by Oskar and Nicolas. Thanks for the reviews!

@jderusse thanks a lot for contributing these docs. I have two quick questions about things I wasn't entirely sure:

  • The three features (method polyfills, namespaced aliases, void removal) were introduced in Symfony 4.4? (I added versionadded:: 4.4 to all of them, but I want to be sure).
  • I don't understand the class MyTest extends TestCase example in the section Removing the Void Return Type:
    • Why do we have two doSetup() methods? You can use both at the same time or do you have to choose one?
    • I don't understand this comment: "visibility and return type-hint of method is free" What does "is free" mean?

Thanks!

@jderusse
Copy link
Member Author

jderusse commented Oct 1, 2019

Soory @javiereguiluz I was in holiday and missed the comment on that PR..

The three features [...] were introduced in Symfony 4.4?

yes

Why do we have two doSetup

it was to show that we are free to override method doSetup with or without return type. Maybe I should have write:

But it's confusing, we can remove this.

    class MyTest extends TestCase
    {
        use SetUpTearDownTrait;
        private $state;

        private function doSetup()
        {
            $this->state = 'demo';
        }
    }

    class MyTest extends TestCase
    {
        use SetUpTearDownTrait;
        private $state;

-       private function doSetup()
+       private function doSetup(): void // you can set a return type
        {
            $this->state = 'demo';
        }
    }

    class MyTest extends TestCase
    {
        use SetUpTearDownTrait;
        private $state;

-       private function doSetup()
+       protected function doSetup() // you can set a different visibility
        {
            $this->state = 'demo';
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants