Browse Source

Fix Docroot Path for Minion

Puskás Zsolt 6 years ago
parent
commit
df2132f7d2
3 changed files with 29 additions and 2 deletions
  1. 1 1
      modules/unittest/bootstrap.php
  2. 1 1
      public/index.php
  3. 27 0
      system/tests/kohana/MinionTaskTest.php

+ 1 - 1
modules/unittest/bootstrap.php

@@ -38,7 +38,7 @@ define('EXT', '.php');
  * this bootstrap file somewhere else then you'll need to modify this value to 
  * compensate.
  */
-define('DOCROOT', realpath(dirname(__FILE__).'/../../').DIRECTORY_SEPARATOR);
+define('DOCROOT', realpath(__DIR__.'/../../') . DIRECTORY_SEPARATOR);
 
 /**
  * Set the PHP error reporting level. If you set this in php.ini, you remove this.

+ 1 - 1
public/index.php

@@ -54,7 +54,7 @@ error_reporting(E_ALL);
  */
 
 // Set the full path to the docroot
-define('DOCROOT', realpath('../').DIRECTORY_SEPARATOR);
+define('DOCROOT', realpath(__DIR__.'/../').DIRECTORY_SEPARATOR);
 
 // Make the application relative to the docroot, for symlink'd index.php
 if ( ! is_dir($application) AND is_dir(DOCROOT.$application))

+ 27 - 0
system/tests/kohana/MinionTaskTest.php

@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Tests the Minion library
+ *
+ * @group kohana
+ * @group kohana.core
+ * @group kohana.core.config
+ *
+ * @package    Koseven
+ * @category   Tests
+ * @author     Koseven Team
+ * @author     Piotr Gołasz <pgolasz@gmail.com>
+ * @copyright  (c) Koseven Team
+ * @license    https://koseven.ga/LICENSE.md
+ */
+class MinionTaskTest extends Unittest_TestCase {
+
+	/**
+	 * Tests that Minion Task Help works assuming all other tasks work aswell
+	 */
+	public function test_minion_runnable()
+	{
+		$minion_response = Minion_Task::factory(['task' => 'help']);
+		$this->assertInstanceOf('Task_Help', $minion_response);
+	}
+}