Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Coding standards fixes

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8260 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit f88cc56cfe01b9441845d8121828d9815fa6e67e 1 parent 47cd941
@tim-kos tim-kos authored
Showing with 105 additions and 110 deletions.
  1. +1 −1  cake/console/libs/schema.php
  2. +1 −1  cake/console/libs/shell.php
  3. +7 −7 cake/console/libs/tasks/controller.php
  4. +4 −4 cake/console/libs/tasks/model.php
  5. +3 −3 cake/console/libs/tasks/project.php
  6. +1 −1  cake/console/libs/tasks/test.php
  7. +3 −3 cake/console/libs/templates/views/form.ctp
  8. +1 −1  cake/console/libs/templates/views/home.ctp
  9. +2 −2 cake/console/libs/templates/views/index.ctp
  10. +9 −9 cake/console/libs/templates/views/view.ctp
  11. +7 −7 cake/libs/controller/components/cookie.php
  12. +3 −3 cake/libs/http_socket.php
  13. +15 −20 cake/libs/model/datasources/dbo/dbo_mysqli.php
  14. +2 −2 cake/libs/model/schema.php
  15. +3 −3 cake/libs/view/errors/missing_action.ctp
  16. +3 −3 cake/libs/view/errors/missing_component_class.ctp
  17. +2 −2 cake/libs/view/errors/missing_component_file.ctp
  18. +3 −3 cake/libs/view/errors/missing_controller.ctp
  19. +2 −2 cake/libs/view/errors/missing_helper_class.ctp
  20. +3 −3 cake/libs/view/errors/missing_helper_file.ctp
  21. +3 −3 cake/libs/view/errors/missing_layout.ctp
  22. +2 −2 cake/libs/view/errors/missing_model.ctp
  23. +2 −2 cake/libs/view/errors/missing_scaffolddb.ctp
  24. +2 −2 cake/libs/view/errors/missing_table.ctp
  25. +2 −2 cake/libs/view/errors/missing_view.ctp
  26. +2 −2 cake/libs/view/errors/private_action.ctp
  27. +1 −1  cake/libs/view/errors/scaffold_error.ctp
  28. +2 −2 cake/libs/view/scaffolds/edit.ctp
  29. +2 −2 cake/libs/view/scaffolds/index.ctp
  30. +8 −8 cake/libs/view/scaffolds/view.ctp
  31. +2 −2 cake/tests/cases/libs/http_socket.test.php
  32. +2 −2 cake/tests/cases/libs/sanitize.test.php
View
2  cake/console/libs/schema.php
@@ -199,7 +199,7 @@ function dump() {
}
}
$db =& ConnectionManager::getDataSource($this->Schema->connection);
- $contents = "#". $Schema->name ." sql generated on: " . date('Y-m-d H:i:s') . " : ". time()."\n\n";
+ $contents = "#" . $Schema->name . " sql generated on: " . date('Y-m-d H:i:s') . " : " . time() . "\n\n";
$contents .= $db->dropSchema($Schema) . "\n\n". $db->createSchema($Schema);
if ($write) {
if (strpos($write, '.sql') === false) {
View
2  cake/console/libs/shell.php
@@ -297,7 +297,7 @@ function loadTasks() {
}
if (!isset($this->{$taskName})) {
- $this->err("Task '".$taskName."' could not be loaded");
+ $this->err("Task '" . $taskName . "' could not be loaded");
$this->_stop();
}
}
View
14 cake/console/libs/tasks/controller.php
@@ -273,7 +273,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n";
}
$actions .= "\t\t}\n";
- $actions .= "\t\t\$this->set('".$singularName."', \$this->{$currentModelName}->read(null, \$id));\n";
+ $actions .= "\t\t\$this->set('" . $singularName . "', \$this->{$currentModelName}->read(null, \$id));\n";
$actions .= "\t}\n";
$actions .= "\n";
@@ -284,7 +284,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$actions .= "\t\t\t\$this->{$currentModelName}->create();\n";
$actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
if ($wannaUseSession) {
- $actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n";
+ $actions .= "\t\t\t\t\$this->Session->setFlash(__('The " . $singularHumanName . " has been saved', true));\n";
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n";
} else {
$actions .= "\t\t\t\t\$this->flash(__('{$currentModelName} saved.', true), array('action'=>'index'));\n";
@@ -313,7 +313,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
}
}
if (!empty($compact)) {
- $actions .= "\t\t\$this->set(compact(".join(', ', $compact)."));\n";
+ $actions .= "\t\t\$this->set(compact(" . join(', ', $compact) . "));\n";
}
$actions .= "\t}\n";
$actions .= "\n";
@@ -332,10 +332,10 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$actions .= "\t\tif (!empty(\$this->data)) {\n";
$actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
if ($wannaUseSession) {
- $actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n";
+ $actions .= "\t\t\t\t\$this->Session->setFlash(__('The " . $singularHumanName . " has been saved', true));\n";
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n";
} else {
- $actions .= "\t\t\t\t\$this->flash(__('The ".$singularHumanName." has been saved.', true), array('action'=>'index'));\n";
+ $actions .= "\t\t\t\t\$this->flash(__('The " . $singularHumanName . " has been saved.', true), array('action'=>'index'));\n";
}
$actions .= "\t\t\t} else {\n";
if ($wannaUseSession) {
@@ -365,7 +365,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
}
}
if (!empty($compact)) {
- $actions .= "\t\t\$this->set(compact(".join(',', $compact)."));\n";
+ $actions .= "\t\t\$this->set(compact(" . join(',', $compact) . "));\n";
}
$actions .= "\t}\n";
$actions .= "\n";
@@ -484,7 +484,7 @@ function bakeTest($className) {
$this->out("\nBaking unit test for $className...");
$header = '$Id';
- $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ."Controller Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
+ $content = "<?php \n/* SVN FILE: $header$ */\n/* " . $className . "Controller Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
return $this->createFile($path . $filename, $content);
}
/**
View
8 cake/console/libs/tasks/model.php
@@ -733,7 +733,7 @@ function bakeTest($className, $useTable = null, $associations = array()) {
$this->out("\nBaking unit test for $className...");
$header = '$Id';
- $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
+ $content = "<?php \n/* SVN FILE: $header$ */\n/* " . $className . " Test cases generated on: " . date('Y-m-d H:i:s') . " : " . time() . "*/\n{$out}?>";
return $this->createFile($path . $filename, $content);
}
return false;
@@ -905,7 +905,7 @@ function fixture($model, $useTable = null) {
$col = "\t\t'indexes' => array(";
$props = array();
foreach ((array)$value as $key => $index) {
- $props[] = "'{$key}' => array(".join(', ', $schema->__values($index)).")";
+ $props[] = "'{$key}' => array(" . join(', ', $schema->__values($index)) . ")";
}
$col .= join(', ', $props);
}
@@ -925,9 +925,9 @@ function fixture($model, $useTable = null) {
$pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS;
$path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS;
}
- $filename = Inflector::underscore($model).'_fixture.php';
+ $filename = Inflector::underscore($model) . '_fixture.php';
$header = '$Id';
- $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $model ." Fixture generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
+ $content = "<?php \n/* SVN FILE: $header$ */\n/* " . $model . " Fixture generated on: " . date('Y-m-d H:i:s') . " : " . time() . "*/\n{$out}?>";
$this->out("\nBaking test fixture for $model...");
if ($this->createFile($path . $filename, $content)) {
return str_replace("\t\t", "\t\t\t", $records);
View
6 cake/console/libs/tasks/project.php
@@ -153,7 +153,7 @@ function bake($path, $skel = null, $skip = array('empty')) {
$this->out(sprintf(__("Created: %s in %s", true), $app, $path));
$this->hr();
} else {
- $this->err(" '".$app."' could not be created properly");
+ $this->err(" '" . $app . "' could not be created properly");
return false;
}
@@ -219,7 +219,7 @@ function corePath($path) {
$File =& new File($path . 'webroot' . DS . 'index.php');
$contents = $File->read();
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
- $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $contents);
+ $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
if (!$File->write($result)) {
return false;
}
@@ -230,7 +230,7 @@ function corePath($path) {
$File =& new File($path . 'webroot' . DS . 'test.php');
$contents = $File->read();
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
- $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $contents);
+ $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
if (!$File->write($result)) {
return false;
}
View
2  cake/console/libs/tasks/test.php
@@ -181,7 +181,7 @@ function bake($class, $name = null, $cases = array()) {
}
$header = '$Id';
- $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $name ." Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
+ $content = "<?php \n/* SVN FILE: $header$ */\n/* " . $name . " Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
return $this->createFile($this->filePath . Inflector::underscore($name) . '.test.php', $content);
}
/**
View
6 cake/console/libs/templates/views/form.ctp
@@ -25,7 +25,7 @@
<div class="<?php echo $pluralVar;?> form">
<?php echo "<?php echo \$form->create('{$modelClass}');?>\n";?>
<fieldset>
- <legend><?php echo "<?php __('".Inflector::humanize($action)." {$singularHumanName}');?>";?></legend>
+ <legend><?php echo "<?php __('" . Inflector::humanize($action) . " {$singularHumanName}');?>";?></legend>
<?php
echo "\t<?php\n";
foreach ($fields as $field) {
@@ -58,8 +58,8 @@
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
- echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
- echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
+ echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
+ echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
$done[] = $details['controller'];
}
}
View
2  cake/console/libs/templates/views/home.ctp
@@ -1,5 +1,5 @@
<?php
-$output = "<h2>Sweet, \"".Inflector::humanize($app)."\" got Baked by CakePHP!</h2>\n";
+$output = "<h2>Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP!</h2>\n";
$output .="
<?php
if (Configure::read() > 0):
View
4 cake/console/libs/templates/views/index.ctp
@@ -88,8 +88,8 @@ echo "<?php endforeach; ?>\n";
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
- echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
- echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
+ echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
+ echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
$done[] = $details['controller'];
}
}
View
18 cake/console/libs/templates/views/view.ctp
@@ -32,14 +32,14 @@ foreach ($fields as $field) {
foreach ($associations['belongsTo'] as $alias => $details) {
if ($field === $details['foreignKey']) {
$isKey = true;
- echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize(Inflector::underscore($alias))."'); ?></dt>\n";
+ echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('" . Inflector::humanize(Inflector::underscore($alias)) . "'); ?></dt>\n";
echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t&nbsp;\n\t\t</dd>\n";
break;
}
}
}
if ($isKey !== true) {
- echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize($field)."'); ?></dt>\n";
+ echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('" . Inflector::humanize($field) . "'); ?></dt>\n";
echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \${$singularVar}['{$modelClass}']['{$field}']; ?>\n\t\t\t&nbsp;\n\t\t</dd>\n";
}
}
@@ -58,8 +58,8 @@ foreach ($fields as $field) {
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
- echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
- echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
+ echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
+ echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
$done[] = $details['controller'];
}
}
@@ -71,12 +71,12 @@ foreach ($fields as $field) {
if (!empty($associations['hasOne'])) :
foreach ($associations['hasOne'] as $alias => $details): ?>
<div class="related">
- <h3><?php echo "<?php __('Related ".Inflector::humanize($details['controller'])."');?>";?></h3>
+ <h3><?php echo "<?php __('Related " . Inflector::humanize($details['controller']) . "');?>";?></h3>
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?>
<dl><?php echo "\t<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?>
<?php
foreach ($details['fields'] as $field) {
- echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize($field)."');?></dt>\n";
+ echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('" . Inflector::humanize($field) . "');?></dt>\n";
echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t<?php echo \${$singularVar}['{$alias}']['{$field}'];?>\n&nbsp;</dd>\n";
}
?>
@@ -84,7 +84,7 @@ if (!empty($associations['hasOne'])) :
<?php echo "<?php endif; ?>\n";?>
<div class="actions">
<ul>
- <li><?php echo "<?php echo \$html->link(__('Edit ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?>
+ <li><?php echo "<?php echo \$html->link(__('Edit " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?>
</ul>
</div>
</div>
@@ -110,7 +110,7 @@ foreach ($relations as $alias => $details):
<tr>
<?php
foreach ($details['fields'] as $field) {
- echo "\t\t<th><?php __('".Inflector::humanize($field)."'); ?></th>\n";
+ echo "\t\t<th><?php __('" . Inflector::humanize($field) . "'); ?></th>\n";
}
?>
<th class="actions"><?php echo "<?php __('Actions');?>";?></th>
@@ -143,7 +143,7 @@ echo "\t<?php endforeach; ?>\n";
<?php echo "<?php endif; ?>\n\n";?>
<div class="actions">
<ul>
- <li><?php echo "<?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?> </li>
+ <li><?php echo "<?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?> </li>
</ul>
</div>
</div>
View
14 cake/libs/controller/components/cookie.php
@@ -203,10 +203,10 @@ function write($key, $value = null, $encrypt = true, $expires = null) {
if (count($name) > 1) {
$this->__values[$name[0]][$name[1]] = $value;
- $this->__write("[".$name[0]."][".$name[1]."]", $value);
+ $this->__write("[" . $name[0] . "][" . $name[1] . "]", $value);
} else {
$this->__values[$name[0]] = $value;
- $this->__write("[".$name[0]."]", $value);
+ $this->__write("[" . $name[0] . "]", $value);
}
} else {
foreach ($key as $names => $value) {
@@ -214,10 +214,10 @@ function write($key, $value = null, $encrypt = true, $expires = null) {
if (count($name) > 1) {
$this->__values[$name[0]][$name[1]] = $value;
- $this->__write("[".$name[0]."][".$name[1]."]", $value);
+ $this->__write("[" . $name[0] . "][" . $name[1] . "]", $value);
} else {
$this->__values[$name[0]] = $value;
- $this->__write("[".$name[0]."]", $value);
+ $this->__write("[" . $name[0] . "]", $value);
}
}
}
@@ -278,17 +278,17 @@ function del($key) {
$name = $this->__cookieVarNames($key);
if (count($name) > 1) {
if (isset($this->__values[$name[0]])) {
- $this->__delete("[".$name[0]."][".$name[1]."]");
+ $this->__delete("[" . $name[0] . "][" . $name[1] . "]");
unset($this->__values[$name[0]][$name[1]]);
}
} else {
if (isset($this->__values[$name[0]])) {
if (is_array($this->__values[$name[0]])) {
foreach ($this->__values[$name[0]] as $key => $value) {
- $this->__delete("[".$name[0]."][".$key."]");
+ $this->__delete("[" . $name[0] . "][" . $key . "]");
}
}
- $this->__delete("[".$name[0]."]");
+ $this->__delete("[" . $name[0] . "]");
unset($this->__values[$name[0]]);
}
}
View
6 cake/libs/http_socket.php
@@ -202,10 +202,10 @@ function request($request = array()) {
}
if (isset($this->request['auth']['user']) && isset($this->request['auth']['pass'])) {
- $this->request['header']['Authorization'] = $this->request['auth']['method'] ." ". base64_encode($this->request['auth']['user'] .":".$this->request['auth']['pass']);
+ $this->request['header']['Authorization'] = $this->request['auth']['method'] . " " . base64_encode($this->request['auth']['user'] . ":" . $this->request['auth']['pass']);
}
if (isset($this->request['uri']['user']) && isset($this->request['uri']['pass'])) {
- $this->request['header']['Authorization'] = $this->request['auth']['method'] ." ". base64_encode($this->request['uri']['user'] .":".$this->request['uri']['pass']);
+ $this->request['header']['Authorization'] = $this->request['auth']['method'] . " " . base64_encode($this->request['uri']['user'] . ":" . $this->request['uri']['pass']);
}
if (is_array($this->request['body'])) {
@@ -812,7 +812,7 @@ function parseHeader($header) {
return false;
}
- preg_match_all("/(.+):(.+)(?:(?<![\t ])".$this->lineBreak."|\$)/Uis", $header, $matches, PREG_SET_ORDER);
+ preg_match_all("/(.+):(.+)(?:(?<![\t ])" . $this->lineBreak . "|\$)/Uis", $header, $matches, PREG_SET_ORDER);
$header = array();
foreach ($matches as $match) {
View
35 cake/libs/model/datasources/dbo/dbo_mysqli.php
@@ -105,9 +105,8 @@ function disconnect() {
function _execute($sql) {
if (preg_match('/^\s*call/i', $sql)) {
return $this->_executeProcedure($sql);
- } else {
- return mysqli_query($this->connection, $sql);
}
+ return mysqli_query($this->connection, $sql);
}
/**
* Executes given SQL statement (procedure call).
@@ -140,15 +139,15 @@ function listSources() {
if (!$result) {
return array();
- } else {
- $tables = array();
+ }
- while ($line = mysqli_fetch_array($result)) {
- $tables[] = $line[0];
- }
- parent::listSources($tables);
- return $tables;
+ $tables = array();
+
+ while ($line = mysqli_fetch_array($result)) {
+ $tables[] = $line[0];
}
+ parent::listSources($tables);
+ return $tables;
}
/**
* Returns an array of the fields in given table name.
@@ -201,14 +200,15 @@ function value($data, $column = null, $safe = false) {
if ($parent != null) {
return $parent;
}
-
- if ($data === null) {
+ if ($data === null || (is_array($data) && empty($data))) {
return 'NULL';
}
-
if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
return "''";
}
+ if (empty($column)) {
+ $column = $this->introspectType($data);
+ }
switch ($column) {
case 'boolean':
@@ -217,9 +217,6 @@ function value($data, $column = null, $safe = false) {
case 'integer' :
case 'float' :
case null :
- if ($data === '') {
- return 'NULL';
- }
if ((is_int($data) || is_float($data) || $data === '0') || (
is_numeric($data) && strpos($data, ',') === false &&
$data[0] != '0' && strpos($data, 'e') === false)) {
@@ -278,7 +275,6 @@ function lastInsertId($source = null) {
if ($id !== false && !empty($id) && !empty($id[0]) && isset($id[0]['insertID'])) {
return $id[0]['insertID'];
}
-
return null;
}
/**
@@ -337,11 +333,11 @@ function column($real) {
function length($real) {
$col = str_replace(array(')', 'unsigned'), '', $real);
$limit = null;
-
+
if (strpos($col, '(') !== false) {
list($col, $limit) = explode('(', $col);
}
-
+
if ($limit != null) {
return intval($limit);
}
@@ -389,9 +385,8 @@ function fetchResult() {
$i++;
}
return $resultRow;
- } else {
- return false;
}
+ return false;
}
/**
* Gets the database encoding
View
4 cake/libs/model/schema.php
@@ -338,7 +338,7 @@ function write($object, $options = array()) {
$col = "\t\t'indexes' => array(";
$props = array();
foreach ((array)$value as $key => $index) {
- $props[] = "'{$key}' => array(".join(', ', $this->__values($index)).")";
+ $props[] = "'{$key}' => array(" . join(', ', $this->__values($index)) . ")";
}
$col .= join(', ', $props);
}
@@ -446,7 +446,7 @@ function __values($values) {
if (is_array($values)) {
foreach ($values as $key => $val) {
if (is_array($val)) {
- $vals[] = "'{$key}' => array('".join("', '", $val)."')";
+ $vals[] = "'{$key}' => array('" . join("', '", $val) . "')";
} else if (!is_numeric($key)) {
$val = var_export($val, true);
$vals[] = "'{$key}' => {$val}";
View
6 cake/libs/view/errors/missing_action.ctp
@@ -25,11 +25,11 @@
<h2><?php echo sprintf(__('Missing Method in %s', true), $controller);?></h2>
<p class="error">
<strong><?php __('Error') ?>: </strong>
- <?php echo sprintf(__('The action %1$s is not defined in controller %2$s', true), "<em>".$action."</em>", "<em>".$controller."</em>");?>
+ <?php echo sprintf(__('The action %1$s is not defined in controller %2$s', true), "<em>" . $action . "</em>", "<em>" . $controller . "</em>");?>
</p>
<p class="error">
<strong><?php __('Error') ?>: </strong>
- <?php echo sprintf(__('Create %1$s%2$s in file: %3$s.', true), "<em>".$controller."::</em>", "<em>".$action."()</em>", APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?>
+ <?php echo sprintf(__('Create %1$s%2$s in file: %3$s.', true), "<em>" . $controller . "::</em>", "<em>" . $action . "()</em>", APP_DIR . DS . "controllers" . DS . Inflector::underscore($controller) . ".php");?>
</p>
<pre>
&lt;?php
@@ -47,5 +47,5 @@ class <?php echo $controller;?> extends AppController {
</pre>
<p class="notice">
<strong><?php __('Notice') ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s.', true), APP_DIR.DS."views".DS."errors".DS."missing_action.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s.', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_action.ctp");?>
</p>
View
6 cake/libs/view/errors/missing_component_class.ctp
@@ -25,11 +25,11 @@
<h2><?php __('Missing Component Class'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Component class %1$s in %2$s was not found.', true), "<em>". $component ."Component</em>", "<em>". $controller ."Controller</em>");?>
+ <?php echo sprintf(__('Component class %1$s in %2$s was not found.', true), "<em>" . $component . "Component</em>", "<em>" . $controller . "Controller</em>");?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Create the class %s in file: %s', true), "<em>". $component ."Component</em>", APP_DIR.DS."controllers".DS."components".DS.$file);?>
+ <?php echo sprintf(__('Create the class %s in file: %s', true), "<em>" . $component . "Component</em>", APP_DIR . DS . "controllers" . DS . "components" . DS . $file);?>
</p>
<pre>
&lt;?php
@@ -40,5 +40,5 @@ class <?php echo $component;?>Component extends Object {<br />
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_component_class.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_component_class.ctp");?>
</p>
View
4 cake/libs/view/errors/missing_component_file.ctp
@@ -29,7 +29,7 @@
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Create the class %s in file: %s', true), "<em>". $component ."Component</em>", APP_DIR.DS."controllers".DS."components".DS.$file);?>
+ <?php echo sprintf(__('Create the class %s in file: %s', true), "<em>" . $component . "Component</em>", APP_DIR . DS . "controllers" . DS . "components" . DS . $file);?>
</p>
<pre>
&lt;?php
@@ -40,5 +40,5 @@ class <?php echo $component;?>Component extends Object {<br />
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_component_file.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_component_file.ctp");?>
</p>
View
6 cake/libs/view/errors/missing_controller.ctp
@@ -25,11 +25,11 @@
<h2><?php __('Missing Controller'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('%s could not be found.', true), "<em>".$controller."</em>");?>
+ <?php echo sprintf(__('%s could not be found.', true), "<em>" . $controller . "</em>");?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Create the class %s below in file: %s', true), "<em>".$controller."</em>", APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?>
+ <?php echo sprintf(__('Create the class %s below in file: %s', true), "<em>" . $controller . "</em>", APP_DIR . DS . "controllers" . DS . Inflector::underscore($controller) . ".php");?>
</p>
<pre>
&lt;?php
@@ -41,5 +41,5 @@ class <?php echo $controller;?> extends AppController {
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_controller.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_controller.ctp");?>
</p>
View
4 cake/libs/view/errors/missing_helper_class.ctp
@@ -29,7 +29,7 @@
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."views".DS."helpers".DS.$file);?>
+ <?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR . DS . "views" . DS . "helpers" . DS . $file);?>
</p>
<pre>
&lt;?php
@@ -40,5 +40,5 @@ class <?php echo $helperClass;?> extends AppHelper {
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_helper_class.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_helper_class.ctp");?>
</p>
View
6 cake/libs/view/errors/missing_helper_file.ctp
@@ -25,11 +25,11 @@
<h2><?php __('Missing Helper File'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__("The helper file %s can not be found or does not exist.", true), APP_DIR.DS."views".DS."helpers".DS.$file);?>
+ <?php echo sprintf(__("The helper file %s can not be found or does not exist.", true), APP_DIR . DS . "views" . DS . "helpers" . DS . $file);?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."views".DS."helpers".DS.$file);?>
+ <?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR . DS . "views" . DS . "helpers" . DS . $file);?>
</p>
<pre>
&lt;?php
@@ -40,5 +40,5 @@ class <?php echo $helperClass;?> extends AppHelper {
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_helper_file.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_helper_file.ctp");?>
</p>
View
6 cake/libs/view/errors/missing_layout.ctp
@@ -25,13 +25,13 @@
<h2><?php __('Missing Layout'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__("The layout file %s can not be found or does not exist.", true), "<em>". $file ."</em>");?>
+ <?php echo sprintf(__("The layout file %s can not be found or does not exist.", true), "<em>" . $file . "</em>");?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Confirm you have created the file: %s', true), "<em>". $file ."</em>");?>
+ <?php echo sprintf(__('Confirm you have created the file: %s', true), "<em>" . $file . "</em>");?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_layout.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_layout.ctp");?>
</p>
View
4 cake/libs/view/errors/missing_model.ctp
@@ -29,7 +29,7 @@
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Create the class %s in file: %s', true), "<em>". $model . "</em>", APP_DIR.DS."models".DS.Inflector::underscore($model).".php");?>
+ <?php echo sprintf(__('Create the class %s in file: %s', true), "<em>" . $model . "</em>", APP_DIR . DS . "models" . DS . Inflector::underscore($model) . ".php");?>
</p>
<pre>
&lt;?php
@@ -42,5 +42,5 @@ class <?php echo $model;?> extends AppModel {
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_model.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_model.ctp");?>
</p>
View
4 cake/libs/view/errors/missing_scaffolddb.ctp
@@ -29,9 +29,9 @@
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Confirm you have created the file: %s', true), APP_DIR.DS."config".DS."database.php");?>
+ <?php echo sprintf(__('Confirm you have created the file: %s', true), APP_DIR . DS . "config" . DS . "database.php");?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_scaffolddb.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_scaffolddb.ctp");?>
</p>
View
4 cake/libs/view/errors/missing_table.ctp
@@ -25,9 +25,9 @@
<h2><?php __('Missing Database Table'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('Database table %1$s for model %2$s was not found.', true),"<em>". $table ."</em>", "<em>". $model ."</em>");?>
+ <?php echo sprintf(__('Database table %1$s for model %2$s was not found.', true),"<em>" . $table . "</em>", "<em>" . $model . "</em>");?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_table.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_table.ctp");?>
</p>
View
4 cake/libs/view/errors/missing_view.ctp
@@ -25,7 +25,7 @@
<h2><?php __('Missing View'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__('The view for %1$s%2$s was not found.', true), "<em>". $controller."Controller::</em>", "<em>". $action ."()</em>");?>
+ <?php echo sprintf(__('The view for %1$s%2$s was not found.', true), "<em>" . $controller . "Controller::</em>", "<em>". $action . "()</em>");?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
@@ -33,5 +33,5 @@
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_view.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "missing_view.ctp");?>
</p>
View
4 cake/libs/view/errors/private_action.ctp
@@ -25,9 +25,9 @@
<h2><?php echo sprintf(__('Private Method in %s', true), $controller);?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
- <?php echo sprintf(__("%s%s cannot be accessed directly.", true), "<em>". $controller ."::</em>", "<em>". $action ."()</em>");?>
+ <?php echo sprintf(__("%s%s cannot be accessed directly.", true), "<em>" . $controller . "::</em>", "<em>" . $action . "()</em>");?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."private_action.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "private_action.ctp");?>
</p>
View
2  cake/libs/view/errors/scaffold_error.ctp
@@ -29,7 +29,7 @@
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
- <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."scaffold_error.ctp");?>
+ <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . "views" . DS . "errors" . DS . "scaffold_error.ctp");?>
</p>
<pre>
&lt;?php
View
4 cake/libs/view/scaffolds/edit.ctp
@@ -40,8 +40,8 @@
foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
- echo "\t\t<li>".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index'))."</li>\n";
- echo "\t\t<li>".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add'))."</li>\n";
+ echo "\t\t<li>" . $html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n";
+ echo "\t\t<li>" . $html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n";
$done[] = $_details['controller'];
}
}
View
4 cake/libs/view/scaffolds/index.ctp
@@ -86,8 +86,8 @@ echo "\n";
foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
- echo "\t\t<li>".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index'))."</li>\n";
- echo "\t\t<li>".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add'))."</li>\n";
+ echo "\t\t<li>" . $html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
+ echo "\t\t<li>" . $html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
$done[] = $_details['controller'];
}
}
View
16 cake/libs/view/scaffolds/view.ctp
@@ -37,14 +37,14 @@ foreach ($scaffoldFields as $_field) {
foreach ($associations['belongsTo'] as $_alias => $_details) {
if ($_field === $_details['foreignKey']) {
$isKey = true;
- echo "\t\t<dt{$class}>".Inflector::humanize($_alias)."</dt>\n";
+ echo "\t\t<dt{$class}>" . Inflector::humanize($_alias) . "</dt>\n";
echo "\t\t<dd{$class}>\n\t\t\t" . $html->link(${$singularVar}[$_alias][$_details['displayField']], array('controller' => $_details['controller'], 'action' => 'view', ${$singularVar}[$_alias][$_details['primaryKey']])) . "\n\t\t&nbsp;</dd>\n";
break;
}
}
}
if ($isKey !== true) {
- echo "\t\t<dt{$class}>".Inflector::humanize($_field)."</dt>\n";
+ echo "\t\t<dt{$class}>" . Inflector::humanize($_field) . "</dt>\n";
echo "\t\t<dd{$class}>\n\t\t\t{${$singularVar}[$modelClass][$_field]}\n&nbsp;\t\t</dd>\n";
}
}
@@ -63,8 +63,8 @@ foreach ($scaffoldFields as $_field) {
foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
- echo "\t\t<li>".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index'))."</li>\n";
- echo "\t\t<li>".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add'))."</li>\n";
+ echo "\t\t<li>" . $html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
+ echo "\t\t<li>" . $html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
$done[] = $_details['controller'];
}
}
@@ -87,8 +87,8 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
- echo "\t\t<dt{$class}>".Inflector::humanize($_field)."</dt>\n";
- echo "\t\t<dd{$class}>\n\t" .${$singularVar}[$_alias][$_field] ."\n&nbsp;</dd>\n";
+ echo "\t\t<dt{$class}>" . Inflector::humanize($_field) . "</dt>\n";
+ echo "\t\t<dd{$class}>\n\t" . ${$singularVar}[$_alias][$_field] . "\n&nbsp;</dd>\n";
}
?>
</dl>
@@ -122,7 +122,7 @@ $otherSingularVar = Inflector::variable($_alias);
<?php
$otherFields = array_keys(${$singularVar}[$_alias][0]);
foreach ($otherFields as $_field) {
- echo "\t\t<th>".Inflector::humanize($_field)."</th>\n";
+ echo "\t\t<th>" . Inflector::humanize($_field) . "</th>\n";
}
?>
<th class="actions">Actions</th>
@@ -137,7 +137,7 @@ $otherSingularVar = Inflector::variable($_alias);
echo "\t\t<tr{$class}>\n";
foreach ($otherFields as $_field) {
- echo "\t\t\t<td>".${$otherSingularVar}[$_field]."</td>\n";
+ echo "\t\t\t<td>" . ${$otherSingularVar}[$_field] . "</td>\n";
}
echo "\t\t\t<td class=\"actions\">\n";
View
4 cake/tests/cases/libs/http_socket.test.php
@@ -399,12 +399,12 @@ function testRequest() {
$this->Socket->setReturnValue('read', false);
$this->Socket->_mock->_call_counts['read'] = 0;
$number = mt_rand(0, 9999999);
- $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n<h1>Hello, your lucky number is ".$number."</h1>";
+ $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n<h1>Hello, your lucky number is " . $number . "</h1>";
$this->Socket->setReturnValueAt(0, 'read', $serverResponse);
$this->Socket->expect('write', array("GET / HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\n\r\n"));
$this->Socket->expectCallCount('read', 2);
$response = $this->Socket->request($request);
- $this->assertIdentical($response, "<h1>Hello, your lucky number is ".$number."</h1>");
+ $this->assertIdentical($response, "<h1>Hello, your lucky number is " . $number . "</h1>");
$this->Socket->reset();
$serverResponse = "HTTP/1.x 200 OK\r\nSet-Cookie: foo=bar\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n<h1>This is a cookie test!</h1>";
View
4 cake/tests/cases/libs/sanitize.test.php
@@ -298,8 +298,8 @@ function testStripScripts() {
$result = Sanitize::stripScripts($string);
$this->assertEqual($result, $expected);
- $string = '<link href="/css/styles.css" media="screen" rel="stylesheet" />'."\n".'<link rel="icon" href="/favicon.ico" type="image/x-icon" />'."\n".'<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />'."\n".'<link rel="alternate" href="/feed.xml" title="RSS Feed" type="application/rss+xml" />';
- $expected = "\n".'<link rel="icon" href="/favicon.ico" type="image/x-icon" />'."\n".'<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />'."\n".'<link rel="alternate" href="/feed.xml" title="RSS Feed" type="application/rss+xml" />';
+ $string = '<link href="/css/styles.css" media="screen" rel="stylesheet" />' . "\n" . '<link rel="icon" href="/favicon.ico" type="image/x-icon" />' . "\n" . '<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />' . "\n" . '<link rel="alternate" href="/feed.xml" title="RSS Feed" type="application/rss+xml" />';
+ $expected = "\n" . '<link rel="icon" href="/favicon.ico" type="image/x-icon" />' . "\n" . '<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />'."\n".'<link rel="alternate" href="/feed.xml" title="RSS Feed" type="application/rss+xml" />';
$result = Sanitize::stripScripts($string);
$this->assertEqual($result, $expected);
Please sign in to comment.
Something went wrong with that request. Please try again.