Skip to content

Another TestContainer issue #216

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

Closed
b1rdex opened this issue Dec 6, 2021 · 2 comments · Fixed by #218
Closed

Another TestContainer issue #216

b1rdex opened this issue Dec 6, 2021 · 2 comments · Fixed by #218

Comments

@b1rdex
Copy link
Contributor

b1rdex commented Dec 6, 2021

This is a continuation of a problem described in #27, #210 and #212.

class ApartmentSubwaysTest extends \Symfony\Bundle\FrameworkBundle\Test\WebTestCase
{
	public function testFoo(): void
	{
		static::createClient()->getContainer()->get(UserRepository::class);
	}
}

\Symfony\Bundle\FrameworkBundle\KernelBrowser::getContainer():

/**
 * Returns the container.
 *
 * @return ContainerInterface
 */
public function getContainer()
{
    $container = $this->kernel->getContainer();

    return $container->has('test.service_container') ? $container->get('test.service_container') : $container;
}

So there should be one more stub added for KernelBrowser::getContainer()

@ondrejmirtes
Copy link
Member

Please send a PR.

b1rdex added a commit to b1rdex/phpstan-symfony that referenced this issue Dec 8, 2021
b1rdex added a commit to b1rdex/phpstan-symfony that referenced this issue Dec 8, 2021
ondrejmirtes pushed a commit that referenced this issue Jan 8, 2022
@github-actions
Copy link

github-actions bot commented Feb 9, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants