소스 검색

Update travis.yml

Abdullah Almsaeed 6 년 전
부모
커밋
53673f575a
3개의 변경된 파일29개의 추가작업 그리고 64개의 파일을 삭제
  1. 1 3
      .travis.yml
  2. 0 61
      tests/DatabaseSeedersTable.php
  3. 28 0
      tests/UsersTableSeeder.php

+ 1 - 3
.travis.yml

@@ -50,9 +50,7 @@ before_script:
 
 script:
   # Link our repo to the modules directory
-  - cd sites/all/modules
-  - mv ../../../../tripal tripal
-  - cd ../../../
+  - cd ../tripal sites/all/modules/tripal
 
   # Run a docker container with tripal 2 pre-installed
   - docker run -it -d --rm --name tripal2 -v "$(pwd)/tripal":/modules/tripal statonlab/tripal2

+ 0 - 61
tests/DatabaseSeedersTable.php

@@ -1,61 +0,0 @@
-<?php
-
-namespace Tests\DatabaseSeeders;
-
-use StatonLab\TripalTestSuite\Database\Seeder;
-
-class UsersTableSeeder extends Seeder
-{
-    /**
-     * Whether to run the seeder automatically before
-     * starting our tests and destruct them automatically
-     * once the tests are completed.
-     *
-     * If you set this to false, you can run the seeder
-     * from your tests directly using UsersTableSeeder::seed()
-     * which returns an instance of the class the you can use
-     * to run the down() method whenever required.
-     *
-     * @var bool
-     */
-    public $auto_run = true;
-
-    /**
-     * The users that got created.
-     * We save this here to have them easily deleted
-     * in the down() method.
-     *
-     * @var array
-     */
-    protected $users = [];
-
-    /**
-     * Seeds the database with users.
-     */
-    public function up()
-    {
-        $new_user = [
-            'name' => 'test user',
-            'pass' => 'secret',
-            'mail' => 'test@example.com',
-            'status' => 1,
-            'init' => 'Email',
-            'roles' => [
-                DRUPAL_AUTHENTICATED_RID => 'authenticated user',
-            ],
-        ];
-
-        // The first parameter is sent blank so a new user is created.
-        $this->users[] = user_save(new \stdClass(), $new_user);
-    }
-
-    /**
-     * Cleans up the database from the created users.
-     */
-    public function down()
-    {
-        foreach ($this->users as $user) {
-            user_delete($user->uid);
-        }
-    }
-}

+ 28 - 0
tests/UsersTableSeeder.php

@@ -0,0 +1,28 @@
+<?php
+
+namespace Tests\DatabaseSeeders;
+
+use StatonLab\TripalTestSuite\Database\Seeder;
+
+class UsersTableSeeder extends Seeder
+{
+  /**
+   * Seeds the database with users.
+   */
+  public function up()
+  {
+    $new_user = [
+      'name' => 'test user',
+      'pass' => 'secret',
+      'mail' => 'test@example.com',
+      'status' => 1,
+      'init' => 'Email',
+      'roles' => [
+        DRUPAL_AUTHENTICATED_RID => 'authenticated user',
+      ],
+    ];
+
+    // The first parameter is sent blank so a new user is created.
+    user_save(new \stdClass(), $new_user);
+  }
+}