Skip to content

Commit

Permalink
Merge branch 'master' into 3.next
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 3, 2018
2 parents 5b5eba4 + ddbfcdb commit 00cdb32
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/Cache/Engine/FileEngine.php
Expand Up @@ -413,7 +413,7 @@ protected function _setKey($key, $createKey = false)
}

/**
* Determine is cache directory is writable
* Determine if cache directory is writable
*
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Console/CommandRunner.php
Expand Up @@ -298,7 +298,7 @@ protected function getShell(ConsoleIo $io, CommandCollection $commands, $name)
/**
* Resolve the command name into a name that exists in the collection.
*
* Apply backwards compatibile inflections and aliases.
* Apply backwards compatible inflections and aliases.
*
* @param \Cake\Console\CommandCollection $commands The command collection to check.
* @param \Cake\Console\ConsoleIo $io ConsoleIo object for errors.
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Controller.php
Expand Up @@ -499,7 +499,7 @@ public function enableAutoRender()
}

/**
* Disbale automatic action rendering.
* Disable automatic action rendering.
*
* @return $this
* @since 3.6.0
Expand Down
2 changes: 1 addition & 1 deletion src/Database/FunctionsBuilder.php
Expand Up @@ -205,7 +205,7 @@ public function extract($part, $expression, $types = [])
* Add the time unit to the date expression
*
* @param string $expression Expression to obtain the date part from.
* @param string $value Value to be added. Use negative to substract.
* @param string $value Value to be added. Use negative to subtract.
* @param string $unit Unit of the value e.g. hour or day.
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Schema/MysqlSchema.php
Expand Up @@ -139,7 +139,7 @@ protected function _convertColumn($column)
}
if (strpos($col, 'blob') !== false || $col === 'binary') {
$lengthName = substr($col, 0, -4);
$length = isset(TableSchema::$columnLengths[$lengthName]) ? TableSchema::$columnLengths[$lengthName] : null;
$length = isset(TableSchema::$columnLengths[$lengthName]) ? TableSchema::$columnLengths[$lengthName] : $length;

return ['type' => TableSchema::TYPE_BINARY, 'length' => $length];
}
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Schema/SqliteSchema.php
Expand Up @@ -102,8 +102,8 @@ protected function _convertColumn($column)
if ($col === 'binary' && $length === 16) {
return ['type' => TableSchema::TYPE_BINARY_UUID, 'length' => null];
}
if (in_array($col, ['blob', 'clob'])) {
return ['type' => TableSchema::TYPE_BINARY, 'length' => null];
if (in_array($col, ['blob', 'clob', 'binary'])) {
return ['type' => TableSchema::TYPE_BINARY, 'length' => $length];
}
if (in_array($col, ['date', 'time', 'timestamp', 'datetime'])) {
return ['type' => $col, 'length' => null];
Expand Down
2 changes: 1 addition & 1 deletion src/Datasource/EntityTrait.php
Expand Up @@ -981,7 +981,7 @@ public function setErrors(array $fields, $overwrite = false)

// String messages are appended to the list,
// while more complex error structures need their
// keys perserved for nested validator.
// keys preserved for nested validator.
if (is_string($error)) {
$this->_errors[$f][] = $error;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/EncryptedCookieMiddleware.php
Expand Up @@ -45,7 +45,7 @@ class EncryptedCookieMiddleware
protected $cookieNames;

/**
* Encrpytion key to use.
* Encryption key to use.
*
* @var string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Http/ServerRequestFactory.php
Expand Up @@ -79,7 +79,7 @@ public static function createUri(array $server = [])
* Build a UriInterface object.
*
* Add in some CakePHP specific logic/properties that help
* perserve backwards compatibility.
* preserve backwards compatibility.
*
* @param array $server The server parameters.
* @param array $headers The normalized headers
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/Table.php
Expand Up @@ -1848,7 +1848,7 @@ public function exists($conditions)
* listeners will receive the entity and the options array as arguments. The type
* of operation performed (insert or update) can be determined by checking the
* entity's method `isNew`, true meaning an insert and false an update.
* - Model.afterSaveCommit: Will be triggered after the transaction is commited
* - Model.afterSaveCommit: Will be triggered after the transaction is committed
* for atomic save, listeners will receive the entity and the options array
* as arguments.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/RouteBuilder.php
Expand Up @@ -1062,7 +1062,7 @@ public function applyMiddleware(...$names)
throw new RuntimeException($message);
}
}
$this->middleware = array_merge($this->middleware, $names);
$this->middleware = array_unique(array_merge($this->middleware, $names));

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/Crypto/Mcrypt.php
Expand Up @@ -33,7 +33,7 @@ class Mcrypt
* @param string $key Key to use as the encryption key for encrypted data.
* @param string $operation Operation to perform, encrypt or decrypt
* @throws \LogicException When there are errors.
* @return string Encrytped binary string data, or decrypted data depending on operation.
* @return string Encrypted binary string data, or decrypted data depending on operation.
* @deprecated 3.3.0 This method will be removed in 4.0.0.
*/
public static function rijndael($text, $key, $operation)
Expand Down
4 changes: 2 additions & 2 deletions src/Validation/Validation.php
Expand Up @@ -1373,7 +1373,7 @@ public static function imageSize($file, $options)
* Validates the image width.
*
* @param array $file The uploaded file data from PHP.
* @param string $operator Comparision operator.
* @param string $operator Comparison operator.
* @param int $width Min or max width.
* @return bool
*/
Expand All @@ -1391,7 +1391,7 @@ public static function imageWidth($file, $operator, $width)
* Validates the image width.
*
* @param array $file The uploaded file data from PHP.
* @param string $operator Comparision operator.
* @param string $operator Comparison operator.
* @param int $height Min or max width.
* @return bool
*/
Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase/Database/Schema/MysqlSchemaTest.php
Expand Up @@ -123,6 +123,10 @@ public static function convertColumnProvider()
'BINARY(16)',
['type' => 'binaryuuid', 'length' => null]
],
[
'BINARY(1)',
['type' => 'binary', 'length' => 1]
],
[
'TEXT',
['type' => 'text', 'length' => null]
Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase/Database/Schema/SqliteSchemaTest.php
Expand Up @@ -87,6 +87,10 @@ public static function convertColumnProvider()
'BINARY(16)',
['type' => 'binaryuuid', 'length' => null]
],
[
'BINARY(1)',
['type' => 'binary', 'length' => 1]
],
[
'BLOB',
['type' => 'binary', 'length' => null]
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Database/Schema/SqlserverSchemaTest.php
Expand Up @@ -198,7 +198,7 @@ public static function convertColumnProvider()
50,
null,
null,
// Sqlserver returns double lenghts for unicode columns
// Sqlserver returns double lengths for unicode columns
['type' => 'string', 'length' => 25]
],
[
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/I18n/I18nTest.php
Expand Up @@ -266,7 +266,7 @@ public function testBasicTranslateFunction()
}

/**
* Tests the __() functions with explict null params
* Tests the __() functions with explicit null params
*
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php
Expand Up @@ -173,7 +173,7 @@ public function testFindTranslationsFormatResultsIteration()

/**
* Tests that fields from a translated model use the I18n class locale
* and that it propogates to associated models
* and that it propagates to associated models
*
* @return void
*/
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/ORM/TableTest.php
Expand Up @@ -4986,7 +4986,7 @@ public function testReplaceHasManyOnErrorDependentCascadeCallbacks()
}

/**
* Integration test for replacing entities with HasMany and an empty target list. The transaction must be successfull
* Integration test for replacing entities with HasMany and an empty target list. The transaction must be successful
*
* @return void
*/
Expand Down Expand Up @@ -5028,7 +5028,7 @@ public function testReplaceHasManyEmptyList()
}

/**
* Integration test for replacing entities with HasMany and no already persisted entities. The transaction must be successfull.
* Integration test for replacing entities with HasMany and no already persisted entities. The transaction must be successful.
* Replace operation should prevent considering 0 changed records an error when they are not found in the table
*
* @return void
Expand Down Expand Up @@ -6542,7 +6542,7 @@ public function testSetEntitySource()

/**
* Tests that passing a coned entity that was marked as new to save() will
* actaully save it as a new entity
* actually save it as a new entity
*
* @group save
* @return void
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Routing/Route/RouteTest.php
Expand Up @@ -582,7 +582,7 @@ public function testComplexRouteCompilingAndParsing()
$this->assertRegExp($result, '/source/view');
$this->assertRegExp($result, '/source/view/other/params');
$this->assertNotRegExp($result, '/chaw_test/wiki');
$this->assertNotRegExp($result, '/source/wierd_action');
$this->assertNotRegExp($result, '/source/weird_action');
}

/**
Expand Down
19 changes: 19 additions & 0 deletions tests/TestCase/Routing/RouteBuilderTest.php
Expand Up @@ -1081,6 +1081,25 @@ public function testApplyMiddlewareMerges()
$this->assertAttributeEquals(['test', 'test2'], 'middleware', $routes);
}

/**
* Test that applyMiddleware() uses unique middleware set
*
* @return void
*/
public function testApplyMiddlewareUnique()
{
$func = function () {
};
$routes = new RouteBuilder($this->collection, '/api');
$routes->registerMiddleware('test', $func)
->registerMiddleware('test2', $func);

$routes->applyMiddleware('test', 'test2');
$routes->applyMiddleware('test2', 'test');

$this->assertAttributeEquals(['test', 'test2'], 'middleware', $routes);
}

/**
* Test applying middleware results in middleware attached to the route.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Utility/HashTest.php
Expand Up @@ -1189,7 +1189,7 @@ public function testExtractWildcard()
}

/**
* Test the attribute presense selector.
* Test the attribute presence selector.
*
* @dataProvider articleDataSets
* @return void
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Utility/TextTest.php
Expand Up @@ -468,7 +468,7 @@ public function testWrapIndent()
}

/**
* test wrapBlock() indentical to wrap()
* test wrapBlock() identical to wrap()
*
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Validation/ValidationTest.php
Expand Up @@ -1978,7 +1978,7 @@ public function testEmail()
*/
public function testEmailDeep()
{
$this->skipIf((bool)gethostbynamel('example.abcd'), 'Your DNS service responds for non-existant domains, skipping deep email checks.');
$this->skipIf((bool)gethostbynamel('example.abcd'), 'Your DNS service responds for non-existent domains, skipping deep email checks.');

$this->assertTrue(Validation::email('abc.efg@cakephp.org', true));
$this->assertFalse(Validation::email('abc.efg@caphpkeinvalid.com', true));
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/Helper/PaginatorHelperTest.php
Expand Up @@ -842,7 +842,7 @@ public function testUrlGenerationResetsToPage1($field, $options, $expected)
/**
* Returns data sets of:
* * the name of the field being sorted on
* * url paramters to pass to paginator sort
* * url parameters to pass to paginator sort
* * expected result as a string
*
* @return array
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/View/ViewTest.php
Expand Up @@ -1941,7 +1941,7 @@ public function testExtendMissingElement()
}

/**
* Test extend() preceeded by an element()
* Test extend() preceded by an element()
*
* @return void
*/
Expand All @@ -1958,7 +1958,7 @@ public function testExtendWithElementBeforeExtend()
}

/**
* Test extend() preceeded by an element()
* Test extend() preceded by an element()
*
* @return void
*/
Expand Down

0 comments on commit 00cdb32

Please sign in to comment.