Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix most coding standards in Test/Case/View

  • Loading branch information...
commit f5804cb4caca2dc3f98e42fa64c4de35055bc17d 1 parent 6a55749
@markstory markstory authored
View
5 lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
@@ -49,6 +49,7 @@ public function cache_parsing() {
$this->set('batman', 'bruce wayne');
$this->set('spiderman', 'peter parker');
}
+
}
/**
@@ -84,7 +85,7 @@ public function setUp() {
Configure::write('Cache.check', true);
Configure::write('Cache.disable', false);
App::build(array(
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
), App::RESET);
}
@@ -380,7 +381,6 @@ public function testCacheActionArray() {
$this->assertTrue(file_exists($filename));
@unlink($filename);
-
$this->Controller->cache_parsing();
$this->Controller->cacheAction = array(
'cache_parsing' => 21600
@@ -398,7 +398,6 @@ public function testCacheActionArray() {
$this->assertTrue(file_exists($filename));
@unlink($filename);
-
$this->Controller->cache_parsing();
$this->Controller->request->addParams(array(
'controller' => 'cache_test',
View
31 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -182,6 +182,7 @@ class ContactTagsContact extends CakeTestModel {
public function setSchema($schema) {
$this->_schema = $schema;
}
+
}
/**
@@ -217,6 +218,7 @@ public function schema($field = false) {
unset($this->_schema['id']);
return $this->_schema;
}
+
}
/**
@@ -369,6 +371,7 @@ public function beforeValidate($options = array()) {
$this->invalidate('openid_not_registered');
return true;
}
+
}
/**
@@ -432,6 +435,7 @@ public function beforeValidate($options = array()) {
$this->invalidate('email');
return false;
}
+
}
/**
@@ -505,6 +509,7 @@ public function beforeValidate($options = array()) {
$this->invalidate('city');
return false;
}
+
}
/**
@@ -568,6 +573,7 @@ public function beforeValidate($options = array()) {
$this->invalidate('description');
return false;
}
+
}
/**
@@ -675,8 +681,6 @@ public function tearDown() {
Configure::write('Security.salt', $this->oldSalt);
}
-
-
/**
* testFormCreateWithSecurity method
*
@@ -975,7 +979,6 @@ public function testSecurityButtonNestedNamed() {
$this->assertEquals(array('Address.button'), $result);
}
-
/**
* Test that submit inputs created with foo[bar] name attributes are unlocked correctly.
*
@@ -1469,7 +1472,7 @@ public function testUnlockFieldRemovingFromFields() {
*/
public function testTagIsInvalid() {
$Contact = ClassRegistry::getObject('Contact');
- $Contact->validationErrors[0]['email'] = array('Please provide an email');
+ $Contact->validationErrors[0]['email'] = array('Please provide an email');
$this->Form->setEntity('Contact.0.email');
$result = $this->Form->tagIsInvalid();
@@ -1496,7 +1499,7 @@ public function testTagIsInvalid() {
*/
public function testPasswordValidation() {
$Contact = ClassRegistry::getObject('Contact');
- $Contact->validationErrors['password'] = array('Please provide a password');
+ $Contact->validationErrors['password'] = array('Please provide a password');
$result = $this->Form->input('Contact.password');
$expected = array(
@@ -2389,7 +2392,6 @@ public function testInputSelectType() {
);
$this->assertTags($result, $expected);
-
$this->View->viewVars['users'] = array('value' => 'good', 'other' => 'bad');
$this->Form->request->data = array('Model' => array('user_id' => 'value'));
@@ -5271,7 +5273,6 @@ public function testDateTimeLabelIdMatchesFirstInput() {
$this->assertContains('label for="ModelDateYear"', $result);
}
-
/**
* testMonth method
*
@@ -5613,7 +5614,7 @@ public function testHour() {
$result = $this->Form->hour('Model.field', true, array('value' => 'now'));
$thisHour = date('H');
$optValue = date('G');
- $this->assertRegExp('/<option value="' . $thisHour . '" selected="selected">'. $optValue .'<\/option>/', $result);
+ $this->assertRegExp('/<option value="' . $thisHour . '" selected="selected">' . $optValue . '<\/option>/', $result);
}
/**
@@ -5943,7 +5944,7 @@ public function testButton() {
$result = $this->Form->button('No type', array('type' => false));
$this->assertTags($result, array('button' => array(), 'No type', '/button'));
-
+
$result = $this->Form->button('Upload Text', array('onClick' => "$('#postAddForm').ajaxSubmit({target: '#postTextUpload', url: '/posts/text'});return false;'", 'escape' => false));
$this->assertNotRegExp('/\&039/', $result);
}
@@ -6459,7 +6460,6 @@ public function testCreate() {
'/div'
);
$this->assertTags($result, $expected);
-
}
/**
@@ -6572,8 +6572,12 @@ public function testCreateCustomRoute() {
*/
public function testCreateWithInputDefaults() {
$this->Form->create('User', array(
- 'inputDefaults' => array('div' => false, 'label' => false, 'error' => array('attributes'=>array('wrap' => 'small', 'class' => 'error')))
- ));
+ 'inputDefaults' => array(
+ 'div' => false,
+ 'label' => false,
+ 'error' => array('attributes' => array('wrap' => 'small', 'class' => 'error'))
+ )
+ ));
$result = $this->Form->input('username');
$expected = array(
'input' => array('type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername')
@@ -6588,7 +6592,7 @@ public function testCreateWithInputDefaults() {
'/div'
);
$this->assertTags($result, $expected);
-
+
$User = ClassRegistry::getObject('User');
$User->validationErrors['username'] = array('empty');
$result = $this->Form->input('username', array('div' => true, 'label' => 'username', 'error' => array('empty' => __('Required'))));
@@ -7058,7 +7062,6 @@ public function testFormMagicInput() {
);
$this->assertTags($result, $expected);
-
extract($this->dateRegex);
$now = strtotime('now');
View
102 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
@@ -52,6 +52,7 @@ class TheHtmlTestController extends Controller {
}
class TestHtmlHelper extends HtmlHelper {
+
/**
* expose a method as public
*
@@ -150,7 +151,7 @@ public function setUp() {
$this->Html->request->webroot = '';
App::build(array(
- 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
Configure::write('Asset.timestamp', false);
@@ -404,7 +405,7 @@ public function testImageTagWithTheme() {
$File = new File($testfile, true);
App::build(array(
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
));
Configure::write('Asset.timestamp', true);
Configure::write('debug', 1);
@@ -442,7 +443,7 @@ public function testImageTagWithTheme() {
*/
public function testThemeAssetsInMainWebrootPath() {
App::build(array(
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
));
$webRoot = Configure::read('App.www_root');
Configure::write('App.www_root', CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS);
@@ -800,10 +801,9 @@ public function testScript() {
'script' => array('type' => 'text/javascript', 'src' => 'js/jquery-1.3.2.js', 'defer' => 'defer', 'encoding' => 'utf-8')
);
$this->assertTags($result, $expected);
-
}
- /**
+/**
* test that plugin scripts added with uses() are only ever included once.
* test script tag generation with plugin syntax
*
@@ -933,7 +933,7 @@ public function testScriptInTheme() {
$File = new File($testfile, true);
App::build(array(
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
));
$this->Html->webroot = '/';
@@ -987,7 +987,6 @@ public function testScriptBlock() {
);
$this->assertTags($result, $expected);
-
$this->View->expects($this->at(0))
->method('append')
->with('script', $this->matchesRegularExpression('/window\.foo\s\=\s2;/'));
@@ -1031,7 +1030,6 @@ public function testScriptStartAndScriptEnd() {
);
$this->assertTags($result, $expected);
-
$result = $this->Html->scriptStart(array('safe' => false));
$this->assertNull($result);
echo 'this is some javascript';
@@ -1116,7 +1114,6 @@ public function testBreadcrumb() {
);
$this->assertTags($result, $expected);
-
$this->Html->addCrumb('Fourth', null);
$result = $this->Html->getCrumbs();
@@ -1502,14 +1499,11 @@ public function testMeta() {
$this->assertTags($result, array('meta' => array('name' => 'keywords', 'content' => 'these, are, some, meta, keywords')));
$this->assertRegExp('/\s+\/>$/', $result);
-
$result = $this->Html->meta('description', 'this is the meta description');
$this->assertTags($result, array('meta' => array('name' => 'description', 'content' => 'this is the meta description')));
$result = $this->Html->meta(array('name' => 'ROBOTS', 'content' => 'ALL'));
$this->assertTags($result, array('meta' => array('name' => 'ROBOTS', 'content' => 'ALL')));
-
-
}
/**
@@ -1788,46 +1782,46 @@ public function testCrumbList() {
/**
* Test getCrumbList startText
*/
- public function testCrumbListFirstLink() {
- $this->Html->addCrumb('First', '#first');
- $this->Html->addCrumb('Second', '#second');
-
- $result = $this->Html->getCrumbList(null, 'Home');
- $this->assertTags(
- $result,
- array(
- '<ul',
- array('li' => array('class' => 'first')),
- array('a' => array('href' => '/')), 'Home', '/a',
- '/li',
- '<li',
- array('a' => array('href' => '#first')), 'First', '/a',
- '/li',
- array('li' => array('class' => 'last')),
- array('a' => array('href' => '#second')), 'Second', '/a',
- '/li',
- '/ul'
- )
- );
-
- $result = $this->Html->getCrumbList(null, array('url' => '/home', 'text' => '<img src="/home.png" />', 'escape' => false));
- $this->assertTags(
- $result,
- array(
- '<ul',
- array('li' => array('class' => 'first')),
- array('a' => array('href' => '/home')), 'img' => array('src' => '/home.png'), '/a',
- '/li',
- '<li',
- array('a' => array('href' => '#first')), 'First', '/a',
- '/li',
- array('li' => array('class' => 'last')),
- array('a' => array('href' => '#second')), 'Second', '/a',
- '/li',
- '/ul'
- )
- );
- }
+ public function testCrumbListFirstLink() {
+ $this->Html->addCrumb('First', '#first');
+ $this->Html->addCrumb('Second', '#second');
+
+ $result = $this->Html->getCrumbList(null, 'Home');
+ $this->assertTags(
+ $result,
+ array(
+ '<ul',
+ array('li' => array('class' => 'first')),
+ array('a' => array('href' => '/')), 'Home', '/a',
+ '/li',
+ '<li',
+ array('a' => array('href' => '#first')), 'First', '/a',
+ '/li',
+ array('li' => array('class' => 'last')),
+ array('a' => array('href' => '#second')), 'Second', '/a',
+ '/li',
+ '/ul'
+ )
+ );
+
+ $result = $this->Html->getCrumbList(null, array('url' => '/home', 'text' => '<img src="/home.png" />', 'escape' => false));
+ $this->assertTags(
+ $result,
+ array(
+ '<ul',
+ array('li' => array('class' => 'first')),
+ array('a' => array('href' => '/home')), 'img' => array('src' => '/home.png'), '/a',
+ '/li',
+ '<li',
+ array('a' => array('href' => '#first')), 'First', '/a',
+ '/li',
+ array('li' => array('class' => 'last')),
+ array('a' => array('href' => '#second')), 'Second', '/a',
+ '/li',
+ '/ul'
+ )
+ );
+ }
/**
* testLoadConfig method
@@ -1836,7 +1830,7 @@ public function testCrumbListFirstLink() {
*/
public function testLoadConfig() {
- $path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
+ $path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS;
$result = $this->Html->loadConfig('htmlhelper_tags', $path);
$expected = array(
@@ -1876,7 +1870,7 @@ public function testLoadConfigWrongFile() {
* @expectedException ConfigureException
*/
public function testLoadConfigWrongReader() {
- $path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
+ $path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS;
$result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
}
View
1  lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php
@@ -22,6 +22,7 @@
App::uses('View', 'View');
class JqueryEngineHelperTest extends CakeTestCase {
+
/**
* setUp
*
View
52 lib/Cake/Test/Case/View/Helper/JsHelperTest.php
@@ -26,12 +26,15 @@
App::uses('ClassRegistry', 'Utility');
class JsEncodingObject {
+
protected $_title = 'Old thing';
private $__noshow = 'Never ever';
+
}
class OptionEngineHelper extends JsBaseEngineHelper {
+
protected $_optionMap = array(
'request' => array(
'complete' => 'success',
@@ -58,17 +61,39 @@ public function testParseOptions($options, $safe = array()) {
return $this->_parseOptions($options, $safe);
}
- public function get($selector) {}
- public function event($type, $callback, $options = array()) {}
- public function domReady($functionBody) {}
- public function each($callback) {}
- public function effect($name, $options = array()) {}
- public function request($url, $options = array()) {}
- public function drag($options = array()) {}
- public function drop($options = array()) {}
- public function sortable($options = array()) {}
- public function slider($options = array()) {}
- public function serializeForm($options = array()) {}
+ public function get($selector) {
+ }
+
+ public function event($type, $callback, $options = array()) {
+ }
+
+ public function domReady($functionBody) {
+ }
+
+ public function each($callback) {
+ }
+
+ public function effect($name, $options = array()) {
+ }
+
+ public function request($url, $options = array()) {
+ }
+
+ public function drag($options = array()) {
+ }
+
+ public function drop($options = array()) {
+ }
+
+ public function sortable($options = array()) {
+ }
+
+ public function slider($options = array()) {
+ }
+
+ public function serializeForm($options = array()) {
+ }
+
}
/**
@@ -77,6 +102,7 @@ public function serializeForm($options = array()) {}
* @package Cake.Test.Case.View.Helper
*/
class JsHelperTest extends CakeTestCase {
+
/**
* Regexp for CDATA start block
*
@@ -91,7 +117,6 @@ class JsHelperTest extends CakeTestCase {
*/
public $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/';
-
/**
* setUp method
*
@@ -689,6 +714,7 @@ public function testSetVarsAtTopOfBufferedScripts() {
$this->assertEquals($result[1], 'alert("hey you!");');
$this->assertEquals($result[2], 'confirm("Are you sure?");');
}
+
}
/**
@@ -697,6 +723,7 @@ public function testSetVarsAtTopOfBufferedScripts() {
* @package Cake.Test.Case.View.Helper
*/
class JsBaseEngineTest extends CakeTestCase {
+
/**
* setUp method
*
@@ -812,7 +839,6 @@ public function testRedirect() {
* @return void
*/
public function testObject() {
-
$object = array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8));
$result = $this->JsEngine->object($object);
$expected = '{"title":"New thing","indexes":[5,6,7,8]}';
View
1  lib/Cake/Test/Case/View/Helper/MootoolsEngineHelperTest.php
@@ -22,6 +22,7 @@
App::uses('MootoolsEngineHelper', 'View/Helper');
class MootoolsEngineHelperTest extends CakeTestCase {
+
/**
* setUp
*
View
1  lib/Cake/Test/Case/View/Helper/NumberHelperTest.php
@@ -68,7 +68,6 @@ public function tearDown() {
unset($this->View);
}
-
/**
* test CakeNumber class methods are called correctly
*/
View
9 lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
@@ -212,13 +212,11 @@ public function testSortLinks() {
$result = $this->Paginator->sort('title', 'Title', array('direction' => 'asc'));
$this->assertRegExp('/\/accounts\/index\/param\/page:1\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result);
-
$this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
$this->Paginator->request->params['paging']['Article']['options']['sort'] = null;
$result = $this->Paginator->sort('title', 'Title', array('direction' => 'asc'));
$this->assertRegExp('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="asc">Title<\/a>$/', $result);
-
$this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
$this->Paginator->request->params['paging']['Article']['options']['sort'] = null;
$result = $this->Paginator->sort('title', 'Title', array('direction' => 'desc'));
@@ -330,7 +328,6 @@ public function testSortLinksUsingDotNotation() {
);
$this->assertTags($result, $expected);
-
$this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
$result = $this->Paginator->sort('Article.title', 'Title');
$expected = array(
@@ -1344,7 +1341,6 @@ public function testNumbers() {
);
$this->assertTags($result, $expected);
-
$this->Paginator->request->params['paging'] = array(
'Client' => array(
'page' => 14,
@@ -1417,7 +1413,7 @@ public function testNumbers() {
array('span' => array('class' => 'page-link')), array('a' => array('href' => '/index/page:9')), '9', '/a', '/span',
);
$this->assertTags($result, $expected);
-
+
$result = $this->Paginator->numbers(array('first' => 1, 'currentClass' => 'active'));
$expected = array(
array('span' => array()), array('a' => array('href' => '/index/page:1')), '1', '/a', '/span',
@@ -1439,7 +1435,7 @@ public function testNumbers() {
array('span' => array()), array('a' => array('href' => '/index/page:9')), '9', '/a', '/span',
);
$this->assertTags($result, $expected);
-
+
$result = $this->Paginator->numbers(array('first' => 1, 'class' => 'page-link', 'currentClass' => 'active'));
$expected = array(
array('span' => array('class' => 'page-link')), array('a' => array('href' => '/index/page:1')), '1', '/a', '/span',
@@ -1699,7 +1695,6 @@ public function testNumbers() {
);
$this->assertTags($result, $expected);
-
$this->Paginator->request->params['paging'] = array(
'Client' => array(
'page' => 4895,
View
1  lib/Cake/Test/Case/View/Helper/PrototypeEngineHelperTest.php
@@ -22,6 +22,7 @@
App::uses('PrototypeEngineHelper', 'View/Helper');
class PrototypeEngineHelperTest extends CakeTestCase {
+
/**
* setUp
*
View
2  lib/Cake/Test/Case/View/Helper/RssHelperTest.php
@@ -377,7 +377,7 @@ public function testItem() {
'url' => 'http://example.com/foo?a=1&b=2',
'convertEntities' => false
),
- 'description' => array(
+ 'description' => array(
'value' => 'descriptive words',
'cdata' => true,
),
View
6 lib/Cake/Test/Case/View/Helper/SessionHelperTest.php
@@ -128,7 +128,7 @@ public function testFlash() {
$this->assertEquals($expected, $result);
App::build(array(
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
));
$result = $this->Session->flash('notification');
$result = str_replace("\r\n", "\n", $result);
@@ -161,7 +161,7 @@ public function testFlashAttributes() {
*/
public function testFlashElementInAttrs() {
App::build(array(
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
));
$result = $this->Session->flash('flash', array(
'element' => 'session_helper',
@@ -178,7 +178,7 @@ public function testFlashElementInAttrs() {
*/
public function testFlashWithPluginElement() {
App::build(array(
- 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
View
1  lib/Cake/Test/Case/View/HelperCollectionTest.php
@@ -28,6 +28,7 @@ class HtmlAliasHelper extends HtmlHelper {
}
class HelperCollectionTest extends CakeTestCase {
+
/**
* setUp
*
View
24 lib/Cake/Test/Case/View/HelperTest.php
@@ -93,6 +93,7 @@ public function schema($field = false) {
);
return $this->_schema;
}
+
}
/**
@@ -123,6 +124,7 @@ public function schema($field = false) {
);
return $this->_schema;
}
+
}
/**
@@ -151,9 +153,11 @@ public function schema($field = false) {
);
return $this->_schema;
}
+
}
class TestHelper extends Helper {
+
/**
* Helpers for this helper.
*
@@ -173,6 +177,7 @@ class TestHelper extends Helper {
public function parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
return $this->_parseAttributes($options, $exclude, $insertBefore, $insertAfter);
}
+
}
/**
@@ -644,12 +649,12 @@ public function testAssetUrl() {
* @return void
*/
public function testAssetTimestampPluginsAndThemes() {
- $_timestamp = Configure::read('Asset.timestamp');
+ $timestamp = Configure::read('Asset.timestamp');
Configure::write('Asset.timestamp', 'force');
App::build(array(
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
));
- CakePlugin::load(array('TestPlugin'));;
+ CakePlugin::load(array('TestPlugin'));
$result = $this->Helper->assetTimestamp('/test_plugin/css/test_plugin_asset.css');
$this->assertRegExp('#/test_plugin/css/test_plugin_asset.css\?[0-9]+$#', $result, 'Missing timestamp plugin');
@@ -664,7 +669,7 @@ public function testAssetTimestampPluginsAndThemes() {
$this->assertRegExp('#/theme/test_theme/js/non_existant.js\?$#', $result, 'No error on missing file');
App::build();
- Configure::write('Asset.timestamp', $_timestamp);
+ Configure::write('Asset.timestamp', $timestamp);
}
/**
@@ -834,7 +839,7 @@ public function testMultiDimensionalField() {
$this->Helper->request->data['My']['title'] = 'My Title';
$result = $this->Helper->value('My.title');
- $this->assertEquals($result,'My Title');
+ $this->assertEquals($result, 'My Title');
}
public function testWebrootPaths() {
@@ -846,7 +851,7 @@ public function testWebrootPaths() {
$this->Helper->theme = 'test_theme';
App::build(array(
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
));
$result = $this->Helper->webroot('/img/cake.power.gif');
@@ -916,10 +921,11 @@ public function testThatHelperHelpersAreNotAttached() {
*/
public function testLazyLoadingUsesReferences() {
$Helper = new TestHelper($this->View);
- $result1 = $Helper->Html;
- $result2 = $Helper->Html;
+ $resultA = $Helper->Html;
+ $resultB = $Helper->Html;
- $result1->testprop = 1;
- $this->assertEquals($result1->testprop, $result2->testprop);
+ $resultA->testprop = 1;
+ $this->assertEquals($resultA->testprop, $resultB->testprop);
}
+
}
View
2  lib/Cake/Test/Case/View/JsonViewTest.php
@@ -62,7 +62,7 @@ public function testRenderWithoutViewMultiple() {
$View = new JsonView($Controller);
$output = $View->render(false);
- $this->assertIdentical(json_encode(array('no' =>$data['no'], 'user' => $data['user'])), $output);
+ $this->assertIdentical(json_encode(array('no' => $data['no'], 'user' => $data['user'])), $output);
$this->assertIdentical('application/json', $Response->type());
}
View
16 lib/Cake/Test/Case/View/MediaViewTest.php
@@ -70,7 +70,7 @@ public function testRenderNotFound() {
*/
public function testRender() {
$this->MediaView->viewVars = array(
- 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
+ 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS . 'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);
@@ -117,7 +117,7 @@ public function testRenderWithUnknownFileTypeGeneric() {
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
$_SERVER['HTTP_USER_AGENT'] = 'Some generic browser';
$this->MediaView->viewVars = array(
- 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
+ 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
'id' => 'no_section.ini',
'extension' => 'ini',
);
@@ -176,7 +176,7 @@ public function testRenderWithUnknownFileTypeOpera() {
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
$_SERVER['HTTP_USER_AGENT'] = 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10';
$this->MediaView->viewVars = array(
- 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
+ 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
'id' => 'no_section.ini',
'extension' => 'ini',
);
@@ -240,7 +240,7 @@ public function testRenderWithUnknownFileTypeIE() {
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)';
$this->MediaView->viewVars = array(
- 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
+ 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
'id' => 'no_section.ini',
'extension' => 'ini',
'name' => 'config'
@@ -303,7 +303,7 @@ public function testRenderWithUnknownFileTypeIE() {
*/
public function testConnectionAborted() {
$this->MediaView->viewVars = array(
- 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
+ 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS . 'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);
@@ -326,7 +326,7 @@ public function testConnectionAborted() {
*/
public function testConnectionAbortedOnBuffering() {
$this->MediaView->viewVars = array(
- 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
+ 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS . 'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);
@@ -359,7 +359,7 @@ public function testConnectionAbortedOnBuffering() {
*/
public function testRenderUpperExtension() {
$this->MediaView->viewVars = array(
- 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'img' . DS,
+ 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS . 'img' . DS,
'id' => 'test_2.JPG',
'extension' => 'JPG',
);
@@ -383,7 +383,7 @@ public function testRenderUpperExtension() {
*/
public function testRenderExtensionNotSet() {
$this->MediaView->viewVars = array(
- 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'img' . DS,
+ 'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS . 'img' . DS,
'id' => 'test_2.JPG',
);
View
19 lib/Cake/Test/Case/View/ScaffoldViewTest.php
@@ -39,6 +39,7 @@ class TestScaffoldView extends ScaffoldView {
public function testGetFilename($action) {
return $this->_getViewFileName($action);
}
+
}
/**
@@ -141,7 +142,7 @@ public function testGetViewFilename() {
$this->assertEquals($expected, $result);
$result = $ScaffoldView->testGetFilename('admin_edit');
- $expected =CAKE . 'View' . DS . 'Scaffolds' . DS . 'form.ctp';
+ $expected = CAKE . 'View' . DS . 'Scaffolds' . DS . 'form.ctp';
$this->assertEquals($expected, $result);
$result = $ScaffoldView->testGetFilename('admin_add');
@@ -159,11 +160,11 @@ public function testGetViewFilename() {
$ScaffoldView = new TestScaffoldView($Controller);
$result = $ScaffoldView->testGetFilename('admin_edit');
- $expected = CAKE . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
$this->assertEquals($expected, $result);
$result = $ScaffoldView->testGetFilename('edit');
- $expected = CAKE . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
$this->assertEquals($expected, $result);
$Controller = new ScaffoldViewMockController($this->request);
@@ -178,13 +179,13 @@ public function testGetViewFilename() {
$ScaffoldView = new TestScaffoldView($Controller);
$result = $ScaffoldView->testGetFilename('admin_add');
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'
- . DS .'TestPlugin' . DS . 'View' . DS . 'Tests' . DS . 'scaffold.form.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' .
+ DS . 'TestPlugin' . DS . 'View' . DS . 'Tests' . DS . 'scaffold.form.ctp';
$this->assertEquals($expected, $result);
$result = $ScaffoldView->testGetFilename('add');
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'
- . DS .'TestPlugin' . DS . 'View' . DS . 'Tests' . DS . 'scaffold.form.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' .
+ DS . 'TestPlugin' . DS . 'View' . DS . 'Tests' . DS . 'scaffold.form.ctp';
$this->assertEquals($expected, $result);
Configure::write('Routing.prefixes', $_admin);
@@ -202,8 +203,8 @@ public function testGetViewFileNameWithTheme() {
$ScaffoldView = new TestScaffoldView($this->Controller);
$result = $ScaffoldView->testGetFilename('index');
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS
- . 'Themed' . DS . 'TestTheme' . DS . 'Posts' . DS . 'scaffold.index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .
+ 'Themed' . DS . 'TestTheme' . DS . 'Posts' . DS . 'scaffold.index.ctp';
$this->assertEquals($expected, $result);
}
View
15 lib/Cake/Test/Case/View/ThemeViewTest.php
@@ -48,6 +48,7 @@ public function index() {
$test3 = 'even more data';
$this->set(compact('test2', 'test3'));
}
+
}
/**
@@ -112,7 +113,7 @@ public function setUp() {
$this->ThemeView = new ThemeView($this->PostsController);
App::build(array(
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
));
App::objects('plugins', null, false);
CakePlugin::load(array('TestPlugin'));
@@ -144,15 +145,15 @@ public function testPluginThemedGetTemplate() {
$this->Controller->theme = 'TestTheme';
$ThemeView = new TestTheme2View($this->Controller);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Tests' . DS . 'index.ctp';
$result = $ThemeView->getViewFileName('index');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Layouts' . DS .'plugin_default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Layouts' . DS . 'plugin_default.ctp';
$result = $ThemeView->getLayoutFileName('plugin_default');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName('default');
$this->assertEquals($expected, $result);
}
@@ -171,15 +172,15 @@ public function testGetTemplate() {
$ThemeView = new TestTheme2View($this->Controller);
$ThemeView->theme = 'TestTheme';
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages' . DS . 'home.ctp';
$result = $ThemeView->getViewFileName('home');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Posts' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Posts' . DS . 'index.ctp';
$result = $ThemeView->getViewFileName('/Posts/index');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEquals($expected, $result);
View
89 lib/Cake/Test/Case/View/ViewTest.php
@@ -66,6 +66,7 @@ public function nocache_multiple_element() {
$this->set('foo', 'this is foo var');
$this->set('bar', 'this is bar var');
}
+
}
/**
@@ -95,6 +96,7 @@ public function index() {
$test3 = 'even more data';
$this->set(compact('test2', 'test3'));
}
+
}
/**
@@ -196,6 +198,7 @@ public function render_($___viewFn, $___dataForView, $loadHelpers = true, $cache
public function scripts() {
return $this->_scripts;
}
+
}
/**
@@ -229,6 +232,7 @@ public function beforeLayout($viewFile) {
public function afterLayout($layoutFile) {
$this->_View->output .= 'modified in the afterlife';
}
+
}
@@ -270,7 +274,7 @@ public function setUp() {
App::build(array(
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
), App::RESET);
App::objects('plugins', null, false);
@@ -292,8 +296,8 @@ public function tearDown() {
unset($this->ThemeView);
unset($this->ThemePostsController);
unset($this->ThemeController);
-
}
+
/**
* testGetTemplate method
*
@@ -308,15 +312,15 @@ public function testGetTemplate() {
$ThemeView = new TestThemeView($this->Controller);
$ThemeView->theme = 'TestTheme';
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages' . DS . 'home.ctp';
$result = $ThemeView->getViewFileName('home');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Posts' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Posts' . DS . 'index.ctp';
$result = $ThemeView->getViewFileName('/Posts/index');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEquals($expected, $result);
@@ -344,11 +348,11 @@ public function testPluginGetTemplate() {
$View = new TestView($this->Controller);
- $expected = CakePlugin::path('TestPlugin') . 'View' . DS .'Tests' . DS .'index.ctp';
+ $expected = CakePlugin::path('TestPlugin') . 'View' . DS . 'Tests' . DS . 'index.ctp';
$result = $View->getViewFileName('index');
$this->assertEquals($expected, $result);
- $expected = CakePlugin::path('TestPlugin') . 'View' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = CakePlugin::path('TestPlugin') . 'View' . DS . 'Layouts' . DS . 'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEquals($expected, $result);
}
@@ -366,15 +370,15 @@ public function testPluginThemedGetTemplate() {
$this->Controller->theme = 'TestTheme';
$ThemeView = new TestThemeView($this->Controller);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Tests' . DS . 'index.ctp';
$result = $ThemeView->getViewFileName('index');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Layouts' . DS .'plugin_default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Layouts' . DS . 'plugin_default.ctp';
$result = $ThemeView->getLayoutFileName('plugin_default');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName('default');
$this->assertEquals($expected, $result);
}
@@ -421,15 +425,15 @@ public function testCamelCasePluginGetTemplate() {
$View = new TestView($this->Controller);
App::build(array(
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
- 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
));
$pluginPath = CakePlugin::path('TestPlugin');
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS .'TestPlugin' . DS . 'View' . DS .'Tests' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'View' . DS . 'Tests' . DS . 'index.ctp';
$result = $View->getViewFileName('index');
$this->assertEquals($expected, $result);
- $expected = $pluginPath. 'View' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = $pluginPath . 'View' . DS . 'Layouts' . DS . 'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEquals($expected, $result);
}
@@ -448,29 +452,29 @@ public function testGetViewFileNames() {
$View = new TestView($this->Controller);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages' . DS . 'home.ctp';
$result = $View->getViewFileName('home');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Posts' . DS . 'index.ctp';
$result = $View->getViewFileName('/Posts/index');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Posts' . DS . 'index.ctp';
$result = $View->getViewFileName('../Posts/index');
$this->assertEquals($expected, $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'page.home.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages' . DS . 'page.home.ctp';
$result = $View->getViewFileName('page.home');
$this->assertEquals($expected, $result, 'Should not ruin files with dots.');
CakePlugin::load('TestPlugin');
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages' . DS . 'home.ctp';
$result = $View->getViewFileName('TestPlugin.home');
$this->assertEquals($expected, $result, 'Plugin is missing the view, cascade to app.');
$View->viewPath = 'Tests';
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'View' . DS .'Tests' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'View' . DS . 'Tests' . DS . 'index.ctp';
$result = $View->getViewFileName('TestPlugin.index');
$this->assertEquals($expected, $result);
}
@@ -488,7 +492,7 @@ public function testGetLayoutFileName() {
$View = new TestView($this->Controller);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEquals($expected, $result);
@@ -517,12 +521,12 @@ public function testGetLayoutFileNamePlugin() {
$View = new TestView($this->Controller);
CakePlugin::load('TestPlugin');
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'View' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'View' . DS . 'Layouts' . DS . 'default.ctp';
$result = $View->getLayoutFileName('TestPlugin.default');
$this->assertEquals($expected, $result);
$View->plugin = 'TestPlugin';
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'View' . DS . 'Layouts' . DS .'default.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'View' . DS . 'Layouts' . DS . 'default.ctp';
$result = $View->getLayoutFileName('default');
$this->assertEquals($expected, $result);
}
@@ -1042,10 +1046,9 @@ public function testViewFileName() {
$result = $View->getViewFileName('../Themed/TestTheme/Posts/index');
$this->assertRegExp('/Themed(\/|\\\)TestTheme(\/|\\\)Posts(\/|\\\)index.ctp/', $result);
- $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Posts' . DS . 'index.ctp';
$result = $View->getViewFileName('../Posts/index');
$this->assertEquals($expected, $result);
-
}
/**
@@ -1115,44 +1118,6 @@ public function testRenderStrippingNoCacheTagsOnlyCacheCheck() {
}
/**
- * testRenderNocache method
- *
- * @return void
- */
-
-/* This is a new test case for a pending enhancement
- public function testRenderNocache() {
- $this->PostsController->helpers = array('Cache', 'Html');
- $this->PostsController->constructClasses();
- $this->PostsController->cacheAction = 21600;
- $this->PostsController->here = '/posts/nocache_multiple_element';
- $this->PostsController->action = 'nocache_multiple_element';
- $this->PostsController->nocache_multiple_element();
- Configure::write('Cache.check', true);
- Configure::write('Cache.disable', false);
-
- $filename = CACHE . 'views' . DS . 'posts_nocache_multiple_element.php';
-
- $View = new TestView($this->PostsController);
- $View->render();
-
- ob_start();
- $View->renderCache($filename, getMicroTime());
- $result = ob_get_clean();
- @unlink($filename);
-
- $this->assertRegExp('/php echo \$foo;/', $result);
- $this->assertRegExp('/php echo \$bar;/', $result);
- $this->assertRegExp('/php \$barfoo = \'in sub2\';/', $result);
- $this->assertRegExp('/php echo \$barfoo;/', $result);
- $this->assertRegExp('/printing: "in sub2"/', $result);
- $this->assertRegExp('/php \$foobar = \'in sub1\';/', $result);
- $this->assertRegExp('/php echo \$foobar;/', $result);
- $this->assertRegExp('/printing: "in sub1"/', $result);
- }
-*/
-
-/**
* testSet method
*
* @return void
View
2  lib/Cake/Test/Case/View/XmlViewTest.php
@@ -64,7 +64,7 @@ public function testRenderWithoutViewMultiple() {
$output = $View->render(false);
$expected = array(
- 'response' => array('no' =>$data['no'], 'user' => $data['user'])
+ 'response' => array('no' => $data['no'], 'user' => $data['user'])
);
$this->assertIdentical(Xml::build($expected)->asXML(), $output);
$this->assertIdentical('application/xml', $Response->type());
Please sign in to comment.
Something went wrong with that request. Please try again.