-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[DoctrineBridge] no-op RegisterUidTypePass if DBAL types aren't loaded #39401
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
Conversation
craue
commented
Dec 9, 2020
| Q | A |
|---|---|
| Branch? | 5.2 |
| Bug fix? | yes |
| New feature? | no |
| Deprecations? | no |
| Tickets | Fix #39400 |
| License | MIT |
|
Can we add a test for this please? |
|
@derrabus, how? |
<?php
namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection\CompilerPass;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterUidTypePass;
use Symfony\Bridge\Doctrine\Types\UlidType;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class RegisterUidTypePassTest extends TestCase
{
public function testRegistered()
{
$container = new ContainerBuilder();
$container->setParameter('doctrine.dbal.connection_factory.types', ['foo' => 'bar']);
(new RegisterUidTypePass())->process($container);
$expected = [
'foo' => 'bar',
'uuid' => ['class' => UuidType::class],
'ulid' => ['class' => UlidType::class],
];
$this->assertSame($expected, $container->getParameter('doctrine.dbal.connection_factory.types'));
}
public function testRegisteredDontFail()
{
$container = new ContainerBuilder();
(new RegisterUidTypePass())->process($container);
$this->expectNotToPerformAssertions();
}
} |
|
@jderusse, I see, thanks. Do you want to add it directly? |
Yes please, add this class in you PR. This should cover the Pass |
|
@jderusse, what I wanted to know is either if you want to add this commit on your own or if you want me to add it. 😏 I just did now. |
derrabus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great test, @craue! 😉
|
Thank you @craue. |