Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 29... Línea 29...
29
 * @copyright  Damyon Wiese, Iñaki Arenaza 2014
29
 * @copyright  Damyon Wiese, Iñaki Arenaza 2014
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU Public License
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU Public License
31
 */
31
 */
32
class ldaplib_test extends \advanced_testcase {
32
class ldaplib_test extends \advanced_testcase {
Línea 33... Línea 33...
33
 
33
 
34
    public function test_ldap_addslashes() {
34
    public function test_ldap_addslashes(): void {
35
        // See http://tools.ietf.org/html/rfc4514#section-5.2 if you want
35
        // See http://tools.ietf.org/html/rfc4514#section-5.2 if you want
Línea 36... Línea 36...
36
        // to add additional tests.
36
        // to add additional tests.
37
 
37
 
Línea 74... Línea 74...
74
        foreach ($tests as $test) {
74
        foreach ($tests as $test) {
75
            $this->assertSame($test['expected'], ldap_addslashes($test['test']));
75
            $this->assertSame($test['expected'], ldap_addslashes($test['test']));
76
        }
76
        }
77
    }
77
    }
Línea 78... Línea 78...
78
 
78
 
79
    public function test_ldap_stripslashes() {
79
    public function test_ldap_stripslashes(): void {
80
        // See http://tools.ietf.org/html/rfc4514#section-5.2 if you want
80
        // See http://tools.ietf.org/html/rfc4514#section-5.2 if you want
Línea 81... Línea 81...
81
        // to add additional tests.
81
        // to add additional tests.
82
 
82
 
Línea 173... Línea 173...
173
     *
173
     *
174
     * @dataProvider ldap_normalise_objectclass_provider
174
     * @dataProvider ldap_normalise_objectclass_provider
175
     * @param array $args Arguments passed to ldap_normalise_objectclass
175
     * @param array $args Arguments passed to ldap_normalise_objectclass
176
     * @param string $expected The expected objectclass filter
176
     * @param string $expected The expected objectclass filter
177
     */
177
     */
178
    public function test_ldap_normalise_objectclass($args, $expected) {
178
    public function test_ldap_normalise_objectclass($args, $expected): void {
179
        $this->assertEquals($expected, call_user_func_array('ldap_normalise_objectclass', $args));
179
        $this->assertEquals($expected, call_user_func_array('ldap_normalise_objectclass', $args));
180
    }
180
    }
Línea 181... Línea 181...
181
 
181
 
182
    /**
182
    /**
Línea 221... Línea 221...
221
     * define('TEST_LDAPLIB_BIND_DN', 'cn=someuser,dc=example,dc=local');
221
     * define('TEST_LDAPLIB_BIND_DN', 'cn=someuser,dc=example,dc=local');
222
     * define('TEST_LDAPLIB_BIND_PW', 'somepassword');
222
     * define('TEST_LDAPLIB_BIND_PW', 'somepassword');
223
     * define('TEST_LDAPLIB_DOMAIN',  'dc=example,dc=local');
223
     * define('TEST_LDAPLIB_DOMAIN',  'dc=example,dc=local');
224
     *
224
     *
225
     */
225
     */
226
    public function test_ldap_get_entries_moodle() {
226
    public function test_ldap_get_entries_moodle(): void {
227
        $this->resetAfterTest();
227
        $this->resetAfterTest();
Línea 228... Línea 228...
228
 
228
 
229
        if (!defined('TEST_LDAPLIB_HOST_URL') or !defined('TEST_LDAPLIB_BIND_DN') or
229
        if (!defined('TEST_LDAPLIB_HOST_URL') or !defined('TEST_LDAPLIB_BIND_DN') or
230
                !defined('TEST_LDAPLIB_BIND_PW') or !defined('TEST_LDAPLIB_DOMAIN')) {
230
                !defined('TEST_LDAPLIB_BIND_PW') or !defined('TEST_LDAPLIB_DOMAIN')) {