Kaynağa Gözat

Issue #44: Update tests to use actingAs().

Lacey Sanderson 5 yıl önce
ebeveyn
işleme
68665b4839
2 değiştirilmiş dosya ile 295 ekleme ve 199 silme
  1. 293 189
      composer.lock
  2. 2 10
      tests/BlastDBNodeTest.php

Dosya farkı çok büyük olduğundan ihmal edildi
+ 293 - 189
composer.lock


+ 2 - 10
tests/BlastDBNodeTest.php

@@ -45,8 +45,7 @@ class BlastDBNodeTest extends TripalTestCase {
     module_load_include('inc', 'node', 'node.pages');
 
     // Log in the god user.
-    global $user;
-    $user = user_load(1);
+    $this->actingAs(1);
 
     $node = array('type' => 'blastdb');
 
@@ -76,9 +75,6 @@ class BlastDBNodeTest extends TripalTestCase {
     $result = db_query('SELECT * FROM {blastdb} WHERE name=:name',
       array(':name' => $form_state['values']['db_name']));
     $this->assertEquals(1, $result->rowCount(), 'Unable to select the blast database using the name.');
-
-    // log out the god user.
-    $user = drupal_anonymous_user();
   }
 
   /**
@@ -88,8 +84,7 @@ class BlastDBNodeTest extends TripalTestCase {
     module_load_include('inc', 'node', 'node.pages');
 
     // Log in the god user.
-    global $user;
-    $user = user_load(1);
+    $this->actingAs(1);
 
     // Create the node in the first place.
     $seeder = DatabaseSeeders\BlastDBNodeSeeder::seed();
@@ -123,9 +118,6 @@ class BlastDBNodeTest extends TripalTestCase {
       array(':name' => $form_state['values']['db_name'], ':type' => $form_state['values']['db_dbtype']));
     $this->assertEquals(1, $result->rowCount(), 'Unable to select the blast database using the new name and type.');
 
-    // log out the god user.
-    $user = drupal_anonymous_user();
-
   }
 
   /**

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor