Skip to content

Commit

Permalink
minor #16743 [Bridge/Doctrine+Ldap] Fix tests (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.8 branch.

Discussion
----------

[Bridge/Doctrine+Ldap] Fix tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Using "choice_list" is deprecated and thus can't work with 3.0 deps loaded. Test upgrades backported from #16725
@csarrazi : the Ldap tests now require the ldap extension. Annotations added.

Commits
-------

4819a70 [Bridge/Doctrine+Ldap] Fix tests
  • Loading branch information
nicolas-grekas committed Nov 29, 2015
2 parents afe1668 + 4819a70 commit 6ff5015
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
Expand Up @@ -995,13 +995,13 @@ public function testLoaderCaching()
'property3' => 2,
));

$choiceList1 = $form->get('property1')->getConfig()->getOption('choice_list');
$choiceList2 = $form->get('property2')->getConfig()->getOption('choice_list');
$choiceList3 = $form->get('property3')->getConfig()->getOption('choice_list');
$choiceLoader1 = $form->get('property1')->getConfig()->getOption('choice_loader');
$choiceLoader2 = $form->get('property2')->getConfig()->getOption('choice_loader');
$choiceLoader3 = $form->get('property3')->getConfig()->getOption('choice_loader');

$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\ChoiceListInterface', $choiceList1);
$this->assertSame($choiceList1, $choiceList2);
$this->assertSame($choiceList1, $choiceList3);
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface', $choiceLoader1);
$this->assertSame($choiceLoader1, $choiceLoader2);
$this->assertSame($choiceLoader1, $choiceLoader3);
}

public function testCacheChoiceLists()
Expand All @@ -1024,8 +1024,8 @@ public function testCacheChoiceLists()
'choice_label' => 'name',
));

$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\ChoiceListInterface', $field1->getConfig()->getOption('choice_list'));
$this->assertSame($field1->getConfig()->getOption('choice_list'), $field2->getConfig()->getOption('choice_list'));
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface', $field1->getConfig()->getOption('choice_loader'));
$this->assertSame($field1->getConfig()->getOption('choice_loader'), $field2->getConfig()->getOption('choice_loader'));
}

/**
Expand Down
Expand Up @@ -16,6 +16,9 @@
use Symfony\Component\Security\Core\User\User;
use Symfony\Component\Ldap\Exception\ConnectionException;

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

/**
* @requires extension ldap
*/
class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
{
/**
Expand Down

0 comments on commit 6ff5015

Please sign in to comment.