8p / EightPointsGuzzleBundle

⛽️ Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony
MIT License
440 stars 71 forks source link

Possibility to overwrite classnames with service container parameters #35

Closed sebastianblum closed 8 years ago

sebastianblum commented 8 years ago

I created the issue #34 (in german) and here is my code proposal.

please give me feedback that I can work on that pull request. Sebastian

florianpreusner commented 8 years ago

Cool, didn't know that this is possible. Checking details later and will provide some feedback.

florianpreusner commented 8 years ago

Why are you using fake classes instead of mocking?

sebastianblum commented 8 years ago

I wrote a lot of tests for debugging and then I left these tests.

I don't want to mock the container and before, I used stdClass while debugging. With the Fake classes I will show, that I can overwrite the class parameter and I will get an instance of that class.

I don't know a better pattern to test that.

sebastianblum commented 8 years ago

the symfony team uses stdClass and at the end a FooClass https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php#L721 or https://github.com/symfony/dependency-injection/blob/master/Tests/Fixtures/includes/classes.php

florianpreusner commented 8 years ago

:+1:

Thanks for contributing!