Skip to content

do not mock the ContainerInterface #53535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2024
Merged

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jan 13, 2024

Q A
Branch? 7.1
Bug fix? no
New feature? no
Deprecations? no
Issues
License MIT

@xabbuh xabbuh requested review from kbond and chalasr as code owners January 13, 2024 17:35
@carsonbot carsonbot added this to the 7.1 milestone Jan 13, 2024
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
use Symfony\Component\Routing\RouterInterface;

class RouterCacheWarmerTest extends TestCase
{
public function testWarmUpWithWarmableInterfaceWithBuildDir()
{
$containerMock = $this->getMockBuilder(ContainerInterface::class)->onlyMethods(['get', 'has'])->getMock();
$containerMock = new ContainerBuilder();
Copy link
Member

Choose a reason for hiding this comment

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

The variable name is not accurate anymore. Moreover, do we need a builder here?

Suggested change
$containerMock = new ContainerBuilder();
$container = new Container();

@xabbuh xabbuh force-pushed the container-interface-mock branch 2 times, most recently from 96b6b17 to 2960f36 Compare January 14, 2024 19:45
Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

So much better! Thanks a lot Christian.

@xabbuh xabbuh force-pushed the container-interface-mock branch from 4564a68 to 016e6d1 Compare January 17, 2024 16:02
@xabbuh xabbuh merged commit 4440c5d into symfony:7.1 Jan 17, 2024
@xabbuh xabbuh deleted the container-interface-mock branch January 17, 2024 16:14
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.

4 participants