Browse Source

Fixing yet another random fail in travis

Jose Lorenzo Rodriguez 10 years ago
parent
commit
7271a4cf55
2 changed files with 6 additions and 5 deletions
  1. 2 2
      src/I18n/DateFormatTrait.php
  2. 4 3
      tests/TestCase/Database/QueryTest.php

+ 2 - 2
src/I18n/DateFormatTrait.php

@@ -57,7 +57,7 @@ trait DateFormatTrait
     protected static $_jsonEncodeFormat = "yyyy-MM-dd'T'HH:mm:ssZ";
     protected static $_jsonEncodeFormat = "yyyy-MM-dd'T'HH:mm:ssZ";
 
 
     /**
     /**
-     * Caches whehter or not this class is a subclass of a Date or MutableDate
+     * Caches whether or not this class is a subclass of a Date or MutableDate
      *
      *
      * @var boolean
      * @var boolean
      */
      */
@@ -278,7 +278,7 @@ trait DateFormatTrait
                 is_subclass_of(static::class, MutableDate::class);
                 is_subclass_of(static::class, MutableDate::class);
         }
         }
 
 
-        $defaultTimezone =  static::$_isDateInstance ? 'UTC' : date_default_timezone_get();
+        $defaultTimezone = static::$_isDateInstance ? 'UTC' : date_default_timezone_get();
         $formatter = datefmt_create(
         $formatter = datefmt_create(
             static::$defaultLocale,
             static::$defaultLocale,
             $dateFormat,
             $dateFormat,

+ 4 - 3
tests/TestCase/Database/QueryTest.php

@@ -2448,21 +2448,22 @@ class QueryTest extends TestCase
     {
     {
         $query = new Query($this->connection);
         $query = new Query($this->connection);
 
 
-        $expr = $query->newExpr()->equalFields('title', 'author_id');
+        $expr = $query->newExpr()->equalFields('article_id', 'author_id');
 
 
-        $query->update('articles')
+        $query->update('comments')
             ->set($expr)
             ->set($expr)
             ->where(['id' => 1]);
             ->where(['id' => 1]);
         $result = $query->sql();
         $result = $query->sql();
 
 
         $this->assertQuotedQuery(
         $this->assertQuotedQuery(
-            'UPDATE <articles> SET <title> = \(<author_id>\) WHERE <id> = :',
+            'UPDATE <comments> SET <article_id> = \(<author_id>\) WHERE <id> = :',
             $result,
             $result,
             !$this->autoQuote
             !$this->autoQuote
         );
         );
 
 
         $result = $query->execute();
         $result = $query->execute();
         $this->assertCount(1, $result);
         $this->assertCount(1, $result);
+        $result->closeCursor();
     }
     }
 
 
     /**
     /**