Browse Source

Merge 3.x into 3.next

mscherer 6 years ago
parent
commit
8299c27cc2

+ 2 - 2
.appveyor.yml

@@ -8,9 +8,9 @@ cache:
 
 branches:
   only:
-    - master
+    - 3.x
     - 3.next
-    - 4.x
+
 environment:
   matrix:
     - db: '2012'

+ 2 - 2
README.md

@@ -7,8 +7,8 @@
     <a href="LICENSE" target="_blank">
         <img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square">
     </a>
-    <a href="https://travis-ci.org/cakephp/cakephp" target="_blank">
-        <img alt="Build Status" src="https://img.shields.io/travis/cakephp/cakephp/master.svg?style=flat-square">
+    <a href="https://travis-ci.com/cakephp/cakephp" target="_blank">
+        <img alt="Build Status" src="https://img.shields.io/travis/com/cakephp/cakephp/master.svg?style=flat-square">
     </a>
     <a href="https://codecov.io/github/cakephp/cakephp" target="_blank">
         <img alt="Coverage Status" src="https://img.shields.io/codecov/c/github/cakephp/cakephp.svg?style=flat-square">

+ 2 - 2
src/Database/Dialect/SqlserverDialectTrait.php

@@ -380,7 +380,7 @@ trait SqlserverDialectTrait
      */
     public function disableForeignKeySQL()
     {
-        return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
+        return 'EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
     }
 
     /**
@@ -388,6 +388,6 @@ trait SqlserverDialectTrait
      */
     public function enableForeignKeySQL()
     {
-        return 'EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
+        return 'EXEC sp_MSforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
     }
 }

+ 3 - 2
src/Datasource/EntityInterface.php

@@ -24,9 +24,10 @@ use JsonSerializable;
  * In 4.x the following methods will officially be added to the interface:
  *
  * @method $this setHidden(array $properties, $merge = false)
- * @method array getHidden()
+ * @method string[] getHidden()
  * @method $this setVirtual(array $properties, $merge = false)
- * @method array getVirtual()
+ * @method string[] getVirtual()
+ * @method string[] getDirty()
  * @method $this setDirty($property, $isDirty = true)
  * @method bool isDirty($property = null)
  * @method bool hasErrors($includeNested = true)

+ 1 - 1
src/Datasource/EntityTrait.php

@@ -528,7 +528,7 @@ trait EntityTrait
     /**
      * Sets the virtual properties on this entity.
      *
-     * @param array $properties An array of properties to treat as virtual.
+     * @param string[] $properties An array of properties to treat as virtual.
      * @param bool $merge Merge the new properties with the existing. By default false.
      * @return $this
      */

+ 1 - 1
src/Mailer/Email.php

@@ -2458,7 +2458,7 @@ class Email implements JsonSerializable, Serializable
                 $tmpLine .= $char;
                 $tmpLineLength++;
                 if ($tmpLineLength === $wrapLength) {
-                    $nextChar = $line[$i + 1];
+                    $nextChar = isset($line[$i + 1]) ? $line[$i + 1] : '';
                     if ($nextChar === ' ' || $nextChar === '<') {
                         $formatted[] = trim($tmpLine);
                         $tmpLine = '';

+ 6 - 0
tests/TestCase/Mailer/EmailTest.php

@@ -2868,6 +2868,12 @@ class EmailTest extends TestCase
         $expected = $str1 . str_repeat('x', Email::LINE_LENGTH_MUST - $length + 1) . sprintf("\r\n%s\r\n\r\n", trim($str2));
         $this->assertEquals($expected, $result['message']);
         $this->assertLineLengths($result['message']);
+
+        $line = 'some text <b>with html</b>';
+        $trailing = str_repeat('X', Email::LINE_LENGTH_MUST - strlen($line));
+        $result = $this->Email->send($line . $trailing);
+        $expected = 'some text <b>with' . "\r\nhtml</b>" . $trailing . "\r\n\r\n";
+        $this->assertEquals($expected, $result['message']);
     }
 
     /**

+ 4 - 1
tests/phpunit_aliases.php

@@ -15,6 +15,9 @@ if (class_exists('PHPUnit_Runner_Version')) {
         class_alias('PHPUnit_Framework_Error_Notice', 'PHPUnit\Framework\Error\Notice');
         class_alias('PHPUnit_Framework_Error_Warning', 'PHPUnit\Framework\Error\Warning');
         class_alias('PHPUnit_Framework_ExpectationFailedException', 'PHPUnit\Framework\ExpectationFailedException');
-        class_alias('PHPUnit_Framework_MockObject_MockBuilder', 'PHPUnit\Framework\MockObject\MockBuilder');
     }
 }
+
+if (!class_exists('PHPUnit\Framework\MockObject\MockBuilder')) {
+    class_alias('PHPUnit_Framework_MockObject_MockBuilder', 'PHPUnit\Framework\MockObject\MockBuilder');
+}