Browse Source

Fixed coding standards issues.

pull/396/head
Christian Selig 11 years ago
parent
commit
86d85e96d2
  1. 41
      islandora.module
  2. 15
      tests/islandora_tuque.test

41
islandora.module

@ -998,36 +998,6 @@ function islandora_get_tuque_connection($new_user = NULL, $url = NULL) {
global $user;
// $user_for_tuque = NULL;
//
// if TUQUE DOES NOT EXIST {
// if PROVIDED USER IS NOT NULL {
// MAKE TUQUE WITH PROVIDED USER
// }
// else
// {
// MAKE TUQUE WITH GLOBAL USER
// }
// }
// else {
// if PROVIDED USER IS NOT NULL {
// if PROVIDED USER IS NOT TUQUE'S USER {
// MAKE TUQUE WITH PROVIDED USER
// }
// else {
// LEAVE TUQUE ALONE
// }
// }
// else {
// if GLOBAL USER IS NOT TUQUE'S USER {
// MAKE TUQUE WITH GLOBAL USER
// }
// else {
// LEAVE TUQUE ALONE
// }
// }
// }
// If tuque is NULL.
if (!$tuque) {
// If the provided user is not null, pass it along to Tuque.
@ -1067,6 +1037,17 @@ function islandora_get_tuque_connection($new_user = NULL, $url = NULL) {
return $tuque;
}
/**
* Creates a singleton of tuque.
*
* @param object $user
* The user to create tuque with.
* @param string $url
* The URL to create tuque with.
*
* @return IslandoraTuque
* The singleton tuque object.
*/
function islandora_make_tuque($user, $url) {
if (IslandoraTuque::exists()) {
try {

15
tests/islandora_tuque.test

@ -95,8 +95,7 @@ class IslandoraTuqueTestCase extends IslandoraWebTestCase {
}
/**
* Test that tuque exists and the user is not null and the user is not tuque's
* user.
* Test that tuque exists, the user is not null, the user is not tuque's user.
*/
public function testTuqueExistsAndUserIsNotNullAndUserIsNotTuquesUser() {
$tuque = &drupal_static(__FUNCTION__);
@ -109,7 +108,7 @@ class IslandoraTuqueTestCase extends IslandoraWebTestCase {
}
/**
* Tests that tuque exists and the user is not null and the user is tuque's user
* Tests that tuque exists, the user is not null, the user is tuque's user.
*/
public function testTuqueExistsAndUserIsNotNullAndUserIsTuquesUser() {
$tuque = &drupal_static(__FUNCTION__);
@ -121,8 +120,7 @@ class IslandoraTuqueTestCase extends IslandoraWebTestCase {
}
/**
* Tests that tuque exists and the user is null and the global user is not
* tuque's user.
* Tests that tuque exists, the user is null, global user is not tuque's user.
*/
public function testTuqueExistsAndUserIsNullAndGlobalUserIsNotTuquesUser() {
$tuque = &drupal_static(__FUNCTION__);
@ -135,16 +133,15 @@ class IslandoraTuqueTestCase extends IslandoraWebTestCase {
}
/**
* Tests that tuque exists and the user is null and the global user is tuque's
* user.
* Tests that tuque exists, the user is null, global user is tuque's user.
*/
public function testTuqueExistsAndUserIsNullAndGlobalUserIsTuquesUser() {
$tuque = &drupal_static(__FUNCTION__);
global $user = $tuque->connection->username;
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);
}

Loading…
Cancel
Save