From b071160cdc99f1667f6726efc83af6cbf913c8ca Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Tue, 22 Oct 2013 16:24:49 +0200 Subject: [PATCH] Fix tests for ldap and login mask refs #4941 --- .../library/Icinga/Protocol/Ldap/QueryTest.php | 17 +++++++++++------ test/php/regression/LoginMaskBroken4459Test.php | 11 +++++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php index 8f07dc5a5..c449243cb 100644 --- a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php +++ b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php @@ -3,6 +3,7 @@ namespace Tests\Icinga\Protocol\Ldap; require_once '../../library/Icinga/Protocol/Ldap/Query.php'; require_once '../../library/Icinga/Protocol/Ldap/Connection.php'; require_once '../../library/Icinga/Protocol/Ldap/LdapUtils.php'; +require_once('Zend/Config.php'); /** * * Test class for Query @@ -13,12 +14,16 @@ class QueryTest extends \PHPUnit_Framework_TestCase { private function emptySelect() { - $connection = new \Icinga\Protocol\Ldap\Connection((object) array( - 'hostname' => 'localhost', - 'root_dn' => 'dc=example,dc=com', - 'bind_dn' => 'cn=user,ou=users,dc=example,dc=com', - 'bind_pw' => '***' - )); + $config = new \Zend_Config( + array( + 'hostname' => 'localhost', + 'root_dn' => 'dc=example,dc=com', + 'bind_dn' => 'cn=user,ou=users,dc=example,dc=com', + 'bind_pw' => '***' + ) + ); + + $connection = new \Icinga\Protocol\Ldap\Connection($config); return $connection->select(); } diff --git a/test/php/regression/LoginMaskBroken4459Test.php b/test/php/regression/LoginMaskBroken4459Test.php index 724017609..76520f2cd 100644 --- a/test/php/regression/LoginMaskBroken4459Test.php +++ b/test/php/regression/LoginMaskBroken4459Test.php @@ -46,10 +46,13 @@ namespace Tests\Icinga\Regression { $request = $this->getRequest(); - $request->setMethod("POST")->setPost(array( - "username" => "test", - "password" => "test" - )); + $request->setMethod("POST")->setPost( + array( + "username" => "test", + "password" => "test", + "btn_submit" => "1" + ) + ); $view = new \Zend_View(); $form = new LoginForm();