[Bridge/Doctrine+Ldap] Fix tests

This commit is contained in:
Nicolas Grekas 2015-11-29 17:07:42 +01:00
parent afe1668b41
commit 4819a702d7
3 changed files with 14 additions and 8 deletions

View File

@ -995,13 +995,13 @@ class EntityTypeTest extends TypeTestCase
'property3' => 2, 'property3' => 2,
)); ));
$choiceList1 = $form->get('property1')->getConfig()->getOption('choice_list'); $choiceLoader1 = $form->get('property1')->getConfig()->getOption('choice_loader');
$choiceList2 = $form->get('property2')->getConfig()->getOption('choice_list'); $choiceLoader2 = $form->get('property2')->getConfig()->getOption('choice_loader');
$choiceList3 = $form->get('property3')->getConfig()->getOption('choice_list'); $choiceLoader3 = $form->get('property3')->getConfig()->getOption('choice_loader');
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\ChoiceListInterface', $choiceList1); $this->assertInstanceOf('Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface', $choiceLoader1);
$this->assertSame($choiceList1, $choiceList2); $this->assertSame($choiceLoader1, $choiceLoader2);
$this->assertSame($choiceList1, $choiceList3); $this->assertSame($choiceLoader1, $choiceLoader3);
} }
public function testCacheChoiceLists() public function testCacheChoiceLists()
@ -1024,8 +1024,8 @@ class EntityTypeTest extends TypeTestCase
'choice_label' => 'name', 'choice_label' => 'name',
)); ));
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\ChoiceListInterface', $field1->getConfig()->getOption('choice_list')); $this->assertInstanceOf('Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface', $field1->getConfig()->getOption('choice_loader'));
$this->assertSame($field1->getConfig()->getOption('choice_list'), $field2->getConfig()->getOption('choice_list')); $this->assertSame($field1->getConfig()->getOption('choice_loader'), $field2->getConfig()->getOption('choice_loader'));
} }
/** /**

View File

@ -16,6 +16,9 @@ use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\User\User; use Symfony\Component\Security\Core\User\User;
use Symfony\Component\Ldap\Exception\ConnectionException; use Symfony\Component\Ldap\Exception\ConnectionException;
/**
* @requires extension ldap
*/
class LdapBindAuthenticationProviderTest extends \PHPUnit_Framework_TestCase class LdapBindAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
{ {
/** /**

View File

@ -14,6 +14,9 @@ namespace Symfony\Component\Security\Core\Tests\User;
use Symfony\Component\Security\Core\User\LdapUserProvider; use Symfony\Component\Security\Core\User\LdapUserProvider;
use Symfony\Component\Ldap\Exception\ConnectionException; use Symfony\Component\Ldap\Exception\ConnectionException;
/**
* @requires extension ldap
*/
class LdapUserProviderTest extends \PHPUnit_Framework_TestCase class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
{ {
/** /**