mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Adding tests for incorrect function used in form.ctp.
Fixing mistyped function name. Fixes #364
This commit is contained in:
parent
3ad0595b86
commit
3907893263
2 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,7 @@
|
|||
<?php
|
||||
echo "\t<?php\n";
|
||||
foreach ($fields as $field) {
|
||||
if (substr($action, 'add') !== false && $field == $primaryKey) {
|
||||
if (strpos($action, 'add') !== false && $field == $primaryKey) {
|
||||
continue;
|
||||
} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
|
||||
echo "\t\techo \$this->Form->input('{$field}');\n";
|
||||
|
|
|
@ -336,6 +336,11 @@ class ViewTaskTest extends CakeTestCase {
|
|||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result);
|
||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result);
|
||||
|
||||
$result = $this->Task->getContent('admin_add', $vars);
|
||||
$this->assertPattern("/input\('name'\)/", $result);
|
||||
$this->assertPattern("/input\('body'\)/", $result);
|
||||
$this->assertPattern('/List .+Test View Models/', $result);
|
||||
|
||||
Configure::write('Routing', $_back);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue