report_options: Syntax fix
[ninja.git] / test / unit_test / tests / user_Test.php
blob4a60cedcb2c9a119bcba0c10ea2b21c19ace29fa
1 <?php
2 /**
3 * Example Test.
5 * $Id$
7 * @package Unit_Test
8 * @author Kohana Team
9 * @copyright (c) 2007-2008 Kohana Team
10 * @license http://kohanaphp.com/license.html
12 class User_Test extends PHPUnit_Framework_TestCase {
13 public function test_table_ninja_settings_exists()
15 $db = Database::instance();
16 $table = 'ninja_settings';
17 $this->assertTrue($db->table_exists($table), "Unable to find table $table");
20 public function disabled_test_ldap_case_sensitivity() /* TODO */
22 $ldapauth = Auth::factory( array( 'driver' => 'LDAP' ) );
24 $this->assertTrue( is_object( $ldapauth ), "Could not create LDAP Auth module" );
25 $this->assertTrue( $ldapauth->driver instanceof Auth_LDAP_Driver, "Auth is not an Auth_LDAP_Driver. Auth is a ".get_class( $ldapauth->driver ) );
27 $this->assertTrue( $ldapauth->driver->login( 'test2', 'losen', false ), "Could not authenticate with LDAP user, correct case." );
28 $user1 = $ldapauth->get_user();
29 $this->assertTrue( $user1->username == 'test2', "Returned username isn't the same as database username with, using correct case for login" );
31 $this->assertTrue( $ldapauth->driver->login( 'TEst2', 'losen', false ), "Could not authenticate with LDAP user, incorrect case." );
32 $user2 = $ldapauth->get_user();
33 $this->assertTrue( $user2->username == 'test2', "Returned username isn't the same as database username with, using incorrect case for login" );
35 $this->assertTrue( $user1->id == $user2->id, "Same username with different case returns different user id:s" );
37 unset( $ldapauth );