diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ebdaaa6d23..cd279abf06 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -13,6 +13,8 @@ + + diff --git a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php index 6d478d6911..df30ec85a2 100644 --- a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php +++ b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php @@ -19,7 +19,7 @@ use Symfony\Component\Ldap\LdapInterface; /** * @requires extension ldap */ -class AdapterTest extends \PHPUnit_Framework_TestCase +class AdapterTest extends LdapTestCase { public function testLdapEscape() { @@ -33,7 +33,7 @@ class AdapterTest extends \PHPUnit_Framework_TestCase */ public function testLdapQuery() { - $ldap = new Adapter(array('host' => 'localhost', 'port' => 3389)); + $ldap = new Adapter($this->getLdapConfig()); $ldap->getConnection()->bind('cn=admin,dc=symfony,dc=com', 'symfony'); $query = $ldap->createQuery('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))', array()); diff --git a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php index 6bf1003de1..fa9c7ba156 100644 --- a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php @@ -19,14 +19,14 @@ use Symfony\Component\Ldap\Exception\LdapException; /** * @requires extension ldap */ -class LdapManagerTest extends \PHPUnit_Framework_TestCase +class LdapManagerTest extends LdapTestCase { /** @var Adapter */ private $adapter; protected function setUp() { - $this->adapter = new Adapter(array('host' => 'localhost', 'port' => 3389)); + $this->adapter = new Adapter($this->getLdapConfig()); $this->adapter->getConnection()->bind('cn=admin,dc=symfony,dc=com', 'symfony'); } diff --git a/src/Symfony/Component/Ldap/Tests/LdapTestCase.php b/src/Symfony/Component/Ldap/Tests/LdapTestCase.php new file mode 100644 index 0000000000..8ebd51ed5f --- /dev/null +++ b/src/Symfony/Component/Ldap/Tests/LdapTestCase.php @@ -0,0 +1,14 @@ + getenv('LDAP_HOST'), + 'port' => getenv('LDAP_PORT'), + ); + } +} diff --git a/src/Symfony/Component/Ldap/phpunit.xml.dist b/src/Symfony/Component/Ldap/phpunit.xml.dist index 82f3331146..fc0f698420 100644 --- a/src/Symfony/Component/Ldap/phpunit.xml.dist +++ b/src/Symfony/Component/Ldap/phpunit.xml.dist @@ -8,6 +8,8 @@ > + +