Browse Source

Merge pull request #6054 from ceeram/3.0-tests

3.0 tests
Mark Story 11 years ago
parent
commit
8e5eb7cbd3

+ 1 - 1
src/Cache/Engine/FileEngine.php

@@ -88,7 +88,7 @@ class FileEngine extends CacheEngine
         parent::init($config);
 
         if ($this->_config['path'] === null) {
-            $this->_config['path'] = sys_get_temp_dir();
+            $this->_config['path'] = sys_get_temp_dir() . DS . 'cake_cache' . DS;
         }
         if (DS === '\\') {
             $this->_config['isWindows'] = true;

+ 1 - 1
src/ORM/Association.php

@@ -206,7 +206,7 @@ abstract class Association
             }
         }
 
-        if (!$this->_className) {
+        if (empty($this->_className) && strpos($alias, '.')) {
             $this->_className = $alias;
         }
 

+ 20 - 0
tests/TestCase/Database/Type/DateTimeTypeTest.php

@@ -26,6 +26,13 @@ class DateTimeTypeTest extends TestCase
 {
 
     /**
+     * Original type map
+     *
+     * @var array
+     */
+    protected $_originalMap = [];
+
+    /**
      * Setup
      *
      * @return void
@@ -35,6 +42,19 @@ class DateTimeTypeTest extends TestCase
         parent::setUp();
         $this->type = Type::build('datetime');
         $this->driver = $this->getMock('Cake\Database\Driver');
+        $this->_originalMap = Type::map();
+    }
+
+    /**
+     * Restores Type class state
+     *
+     * @return void
+     */
+    public function tearDown()
+    {
+        parent::tearDown();
+
+        Type::map($this->_originalMap);
     }
 
     /**