|
|
@ -58,93 +58,90 @@ class IslandoraTuqueTestCase extends IslandoraWebTestCase { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Tests that tuque does not exist and the user is not null. |
|
|
|
* Tests that tuque does not exist and the user is not null. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function testTuqueDoesNotExistAndUserIsNotNull() { |
|
|
|
public function testTuqueDoesNotExistAndUserIsNotNull() { |
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
$tuque = NULL; |
|
|
|
$tuque = NULL; |
|
|
|
|
|
|
|
|
|
|
|
$user_to_provide = user_load(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$new_tuque = islandora_get_tuque_connection($user_to_provide); |
|
|
|
$user_to_provide = user_load(0); |
|
|
|
$new_tuque_user_name = $new_tuque->connection->username; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertNotNull($new_tuque); |
|
|
|
$new_tuque = islandora_get_tuque_connection($user_to_provide); |
|
|
|
assertNotNull($tuque); |
|
|
|
$new_tuque_user_name = $new_tuque->connection->username; |
|
|
|
assertEqual($user_to_provide->name, $new_tuque_user_name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
assertNotNull($new_tuque); |
|
|
|
* Tests that tuque does not exist and the user is null. |
|
|
|
assertNotNull($tuque); |
|
|
|
*/ |
|
|
|
assertEqual($user_to_provide->name, $new_tuque_user_name); |
|
|
|
public function testTuqueDoesNotExistAndUserIsNull() { |
|
|
|
} |
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
|
|
|
|
$tuque = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$user_to_provide = NULL; |
|
|
|
/** |
|
|
|
|
|
|
|
* Tests that tuque does not exist and the user is null. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function testTuqueDoesNotExistAndUserIsNull() { |
|
|
|
|
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
|
|
|
|
$tuque = NULL; |
|
|
|
|
|
|
|
|
|
|
|
$new_tuque = islandora_get_tuque_connection($user_to_provide); |
|
|
|
$user_to_provide = NULL; |
|
|
|
$new_tuque_user_name = $new_tuque->connection->username; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global $user; |
|
|
|
$new_tuque = islandora_get_tuque_connection($user_to_provide); |
|
|
|
|
|
|
|
$new_tuque_user_name = $new_tuque->connection->username; |
|
|
|
|
|
|
|
|
|
|
|
assertNotNull($new_tuque); |
|
|
|
global $user; |
|
|
|
assertNotNull($tuque); |
|
|
|
|
|
|
|
assertEqual($new_tuque_user_name, $user); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
assertNotNull($new_tuque); |
|
|
|
* Test that tuque exists and the user is not null and the user is not tuque's |
|
|
|
assertNotNull($tuque); |
|
|
|
* user. |
|
|
|
assertEqual($new_tuque_user_name, $user); |
|
|
|
*/ |
|
|
|
} |
|
|
|
public function testTuqueExistsAndUserIsNotNullAndUserIsNotTuquesUser() { |
|
|
|
|
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
|
|
|
|
$user_to_provide = user_load(0); |
|
|
|
|
|
|
|
$new_tuque = islandora_get_tuque_connection($user_to_provide); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertNotNull($new_tuque); |
|
|
|
|
|
|
|
assertNotNull($tuque); |
|
|
|
|
|
|
|
assertNotEqual($user_to_provide->name, $new_tuque->connection->username); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Tests that tuque exists and the user is not null and the user is tuque's user |
|
|
|
* Test that tuque exists, the user is not null, the user is not tuque's user. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function testTuqueExistsAndUserIsNotNullAndUserIsTuquesUser() { |
|
|
|
public function testTuqueExistsAndUserIsNotNullAndUserIsNotTuquesUser() { |
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
$new_tuque = islandora_get_tuque_connection($tuque->connection->username); |
|
|
|
$user_to_provide = user_load(0); |
|
|
|
|
|
|
|
$new_tuque = islandora_get_tuque_connection($user_to_provide); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertNotNull($new_tuque); |
|
|
|
|
|
|
|
assertNotNull($tuque); |
|
|
|
|
|
|
|
assertNotEqual($user_to_provide->name, $new_tuque->connection->username); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
assertNotNull($new_tuque); |
|
|
|
/** |
|
|
|
assertNotNull($tuque); |
|
|
|
* Tests that tuque exists, the user is not null, the user is tuque's user. |
|
|
|
assertEqual($tuque->connection->username, $new_tuque->connection->username); |
|
|
|
*/ |
|
|
|
} |
|
|
|
public function testTuqueExistsAndUserIsNotNullAndUserIsTuquesUser() { |
|
|
|
|
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
|
|
|
|
$new_tuque = islandora_get_tuque_connection($tuque->connection->username); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
assertNotNull($new_tuque); |
|
|
|
* Tests that tuque exists and the user is null and the global user is not |
|
|
|
assertNotNull($tuque); |
|
|
|
* tuque's user. |
|
|
|
assertEqual($tuque->connection->username, $new_tuque->connection->username); |
|
|
|
*/ |
|
|
|
} |
|
|
|
public function testTuqueExistsAndUserIsNullAndGlobalUserIsNotTuquesUser() { |
|
|
|
|
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
|
|
|
|
global $user = NULL; |
|
|
|
|
|
|
|
$new_tuque = islandora_get_tuque_connection($user); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertNotNull($new_tuque); |
|
|
|
|
|
|
|
assertNotNull($tuque); |
|
|
|
|
|
|
|
assertNotEqual($new_tuque->connection->username, $user); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Tests that tuque exists and the user is null and the global user is tuque's |
|
|
|
* Tests that tuque exists, the user is null, global user is not tuque's user. |
|
|
|
* user. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function testTuqueExistsAndUserIsNullAndGlobalUserIsNotTuquesUser() { |
|
|
|
public function testTuqueExistsAndUserIsNullAndGlobalUserIsTuquesUser() { |
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
global $user = NULL; |
|
|
|
global $user = $tuque->connection->username; |
|
|
|
$new_tuque = islandora_get_tuque_connection($user); |
|
|
|
$new_tuque = islandora_get_tuque_connection($user); |
|
|
|
|
|
|
|
|
|
|
|
assertNotNull($new_tuque); |
|
|
|
assertNotNull($new_tuque); |
|
|
|
assertNotNull($tuque); |
|
|
|
assertNotNull($tuque); |
|
|
|
assertNotEqual($new_tuque->connection->username, $user); |
|
|
|
assertEqual($new_tuque->connection->username, $user); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Tests that tuque exists, the user is null, global user is tuque's user. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function testTuqueExistsAndUserIsNullAndGlobalUserIsTuquesUser() { |
|
|
|
|
|
|
|
$tuque = &drupal_static(__FUNCTION__); |
|
|
|
|
|
|
|
global $_islandora_user; |
|
|
|
|
|
|
|
$_islandora_user = $tuque->connection->username; |
|
|
|
|
|
|
|
$new_tuque = islandora_get_tuque_connection($user); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertNotNull($new_tuque); |
|
|
|
|
|
|
|
assertNotNull($tuque); |
|
|
|
|
|
|
|
assertEqual($new_tuque->connection->username, $user); |
|
|
|
|
|
|
|
} |
|
|
|