Skip to content
Permalink
Browse files

Fix CS.

  • Loading branch information...
dereuromark committed Jul 6, 2014
1 parent 804ad32 commit 5cde7849b7464db01986264b8b7690cafa927e3f
@@ -434,7 +434,7 @@ protected function _addConditions(array $conditions, array $types) {
if ($numericKey && empty($c)) {
continue;
}
if (is_callable($c)) {
$expr = new QueryExpression([], $typeMap);
$c = $c($expr, $this);
@@ -1149,23 +1149,23 @@ public static function prefix($name, $callback) {
}
/**
* Add plugin routes.
*
* This method creates a scoped route collection that includes
* relevant plugin information.
*
* The plugin name will be inflected to the underscore version to create
* the routing path. If you want a custom path name, use the `path` option.
*
* Routes connected in the scoped collection will have the correct path segment
* prepended, and have a matching plugin routing key set.
*
* @param string $path The path name to use for the prefix.
* @param array|callable $options Either the options to use, or a callback.
* @param callable $callback The callback to invoke that builds the plugin routes.
* Only required when $options is defined.
* @return void
*/
* Add plugin routes.
*
* This method creates a scoped route collection that includes
* relevant plugin information.
*
* The plugin name will be inflected to the underscore version to create
* the routing path. If you want a custom path name, use the `path` option.
*
* Routes connected in the scoped collection will have the correct path segment
* prepended, and have a matching plugin routing key set.
*
* @param string $path The path name to use for the prefix.
* @param array|callable $options Either the options to use, or a callback.
* @param callable $callback The callback to invoke that builds the plugin routes.
* Only required when $options is defined.
* @return void
*/
public static function plugin($name, $options = [], $callback = null) {
if ($callback === null) {
$callback = $options;
@@ -481,23 +481,23 @@ public function prefix($name, callable $callback) {
}
/**
* Add plugin routes.
*
* This method creates a new scoped route collection that includes
* relevant plugin information.
*
* The plugin name will be inflected to the underscore version to create
* the routing path. If you want a custom path name, use the `path` option.
*
* Routes connected in the scoped collection will have the correct path segment
* prepended, and have a matching plugin routing key set.
*
* @param string $path The path name to use for the prefix.
* @param array|callable $options Either the options to use, or a callback.
* @param callable $callback The callback to invoke that builds the plugin routes.
* Only required when $options is defined.
* @return void
*/
* Add plugin routes.
*
* This method creates a new scoped route collection that includes
* relevant plugin information.
*
* The plugin name will be inflected to the underscore version to create
* the routing path. If you want a custom path name, use the `path` option.
*
* Routes connected in the scoped collection will have the correct path segment
* prepended, and have a matching plugin routing key set.
*
* @param string $path The path name to use for the prefix.
* @param array|callable $options Either the options to use, or a callback.
* @param callable $callback The callback to invoke that builds the plugin routes.
* Only required when $options is defined.
* @return void
*/
public function plugin($name, $options = [], $callback = null) {
if ($callback === null) {
$callback = $options;
@@ -716,8 +716,7 @@ public function testBakeTableValidation() {
$this->assertContains("->add('email', 'valid', ['rule' => 'email'])", $result);
$this->assertContains(
"->add('email', 'unique', ['rule' => 'validateUnique', 'provider' => 'table'])",
$result)
;
$result);
$this->assertContains("->allowEmpty('id', 'create')", $result);
$this->assertContains("->allowEmpty('email')", $result);
$this->assertContains("->validatePresence('name', 'create')", $result);
@@ -111,7 +111,7 @@ public function testDisabledDriver() {
*
* @expectedException \Cake\Database\Error\MissingConnectionException
* @return void
**/
*/
public function testWrongCredentials() {
$config = ConnectionManager::config('test');
$this->skipIf(isset($config['dsn']), 'Datasource has dsn, skipping.');
@@ -123,7 +123,7 @@ public function testWrongCredentials() {
* Tests creation of prepared statements
*
* @return void
**/
*/
public function testPrepare() {
$sql = 'SELECT 1 + 1';
$result = $this->connection->prepare($sql);
@@ -141,7 +141,7 @@ public function testPrepare() {
* Tests executing a simple query using bound values
*
* @return void
**/
*/
public function testExecuteWithArguments() {
$sql = 'SELECT 1 + ?';
$statement = $this->connection->execute($sql, [1], array('integer'));
@@ -169,7 +169,7 @@ public function testExecuteWithArguments() {
* Tests executing a query with params and associated types
*
* @return void
**/
*/
public function testExecuteWithArgumentsAndTypes() {
$sql = "SELECT '2012-01-01' = ?";
$statement = $this->connection->execute($sql, [new \DateTime('2012-01-01')], ['date']);
@@ -183,7 +183,7 @@ public function testExecuteWithArgumentsAndTypes() {
*
* @expectedException \InvalidArgumentException
* @return void
**/
*/
public function testExecuteWithMissingType() {
$sql = 'SELECT ?';
$statement = $this->connection->execute($sql, [new \DateTime('2012-01-01')], ['bar']);
@@ -193,7 +193,7 @@ public function testExecuteWithMissingType() {
* Tests executing a query with no params also works
*
* @return void
**/
*/
public function testExecuteWithNoParams() {
$sql = 'SELECT 1';
$statement = $this->connection->execute($sql);
@@ -207,7 +207,7 @@ public function testExecuteWithNoParams() {
* Tests it is possible to insert data into a table using matching types by key name
*
* @return void
**/
*/
public function testInsertWithMatchingTypes() {
$data = ['id' => '3', 'title' => 'a title', 'body' => 'a body'];
$result = $this->connection->insert(
@@ -228,7 +228,7 @@ public function testInsertWithMatchingTypes() {
* Tests it is possible to insert data into a table using matching types by array position
*
* @return void
**/
*/
public function testInsertWithPositionalTypes() {
$data = ['id' => '3', 'title' => 'a title', 'body' => 'a body'];
$result = $this->connection->insert(
@@ -249,7 +249,7 @@ public function testInsertWithPositionalTypes() {
* Tests an statement class can be reused for multiple executions
*
* @return void
**/
*/
public function testStatementReusing() {
$total = $this->connection->execute('SELECT COUNT(*) AS total FROM things');
$result = $total->fetch('assoc');
@@ -271,7 +271,7 @@ public function testStatementReusing() {
* Tests rows can be updated without specifying any conditions nor types
*
* @return void
**/
*/
public function testUpdateWithoutConditionsNorTypes() {
$title = 'changed the title!';
$body = 'changed the body!';
@@ -285,7 +285,7 @@ public function testUpdateWithoutConditionsNorTypes() {
* Tests it is possible to use key => value conditions for update
*
* @return void
**/
*/
public function testUpdateWithConditionsNoTypes() {
$title = 'changed the title!';
$body = 'changed the body!';
@@ -299,7 +299,7 @@ public function testUpdateWithConditionsNoTypes() {
* Tests it is possible to use key => value and string conditions for update
*
* @return void
**/
*/
public function testUpdateWithConditionsCombinedNoTypes() {
$title = 'changed the title!';
$body = 'changed the body!';
@@ -313,7 +313,7 @@ public function testUpdateWithConditionsCombinedNoTypes() {
* Tests you can bind types to update values
*
* @return void
**/
*/
public function testUpdateWithTypes() {
$title = 'changed the title!';
$body = new \DateTime('2012-01-01');
@@ -332,7 +332,7 @@ public function testUpdateWithTypes() {
* Tests you can bind types to update values
*
* @return void
**/
*/
public function testUpdateWithConditionsAndTypes() {
$title = 'changed the title!';
$body = new \DateTime('2012-01-01');
@@ -349,7 +349,7 @@ public function testUpdateWithConditionsAndTypes() {
* Tests delete from table with no conditions
*
* @return void
**/
*/
public function testDeleteNoConditions() {
$this->connection->delete('things');
$result = $this->connection->execute('SELECT * FROM things');
@@ -360,7 +360,7 @@ public function testDeleteNoConditions() {
/**
* Tests delete from table with conditions
* @return void
**/
*/
public function testDeleteWithConditions() {
$this->connection->delete('things', ['id' => '1-rest-is-ommited'], ['id' => 'integer']);
$result = $this->connection->execute('SELECT * FROM things');
@@ -382,7 +382,7 @@ public function testDeleteWithConditions() {
* Tests that it is possible to use simple database transactions
*
* @return void
**/
*/
public function testSimpleTransactions() {
$this->connection->begin();
$this->connection->delete('things', ['id' => 1]);
@@ -403,7 +403,7 @@ public function testSimpleTransactions() {
* with early rollback algorithm
*
* @return void
**/
*/
public function testVirtualNestedTrasanction() {
//starting 3 virtual transaction
$this->connection->begin();
@@ -426,7 +426,7 @@ public function testVirtualNestedTrasanction() {
* with early rollback algorithm
*
* @return void
**/
*/
public function testVirtualNestedTrasanction2() {
//starting 3 virtual transaction
$this->connection->begin();
@@ -447,7 +447,7 @@ public function testVirtualNestedTrasanction2() {
* with early rollback algorithm
*
* @return void
**/
*/
public function testVirtualNestedTrasanction3() {
//starting 3 virtual transaction
@@ -470,7 +470,7 @@ public function testVirtualNestedTrasanction3() {
* Tests that it is possible to real use nested transactions
*
* @return void
**/
*/
public function testSavePoints() {
$this->skipIf(!$this->connection->useSavePoints(true));
@@ -498,7 +498,7 @@ public function testSavePoints() {
* Tests that it is possible to real use nested transactions
*
* @return void
**/
*/
public function testSavePoints2() {
$this->skipIf(!$this->connection->useSavePoints(true));
@@ -526,7 +526,7 @@ public function testSavePoints2() {
* Tests connection can quote values to be safely used in query strings
*
* @return void
**/
*/
public function testQuote() {
$this->skipIf(!$this->connection->supportsQuoting());
$expected = "'2012-01-01'";
@@ -19,7 +19,7 @@
/**
* Tests FunctionExpression class
*
**/
*/
class FunctionExpressionTest extends \Cake\TestSuite\TestCase {
/**
@@ -22,7 +22,7 @@
/**
* Tests IdentifierExpression class
*
**/
*/
class IdentifierExpressionTest extends TestCase {
/**
@@ -22,7 +22,7 @@
/**
* Tests TupleComparison class
*
**/
*/
class TupleComparisonTest extends TestCase {
/**
@@ -19,7 +19,7 @@
/**
* Tests FunctionsBuilder class
*
**/
*/
class FunctionsBuilderTest extends \Cake\TestSuite\TestCase {
/**
@@ -19,7 +19,7 @@
/**
* Tests LoggedQuery class
*
**/
*/
class LoggedQueryTest extends \Cake\TestSuite\TestCase {
/**
@@ -20,7 +20,7 @@
/**
* Tests LoggingStatement class
*
**/
*/
class LoggingStatementTest extends \Cake\TestSuite\TestCase {
/**
Oops, something went wrong.

0 comments on commit 5cde784

Please sign in to comment.
You can’t perform that action at this time.