Browse Source

Merge branch '2.5' into 3.0-merge

Conflicts:
	build.xml
	lib/Cake/Console/Command/SchemaShell.php
	lib/Cake/Console/Command/UpgradeShell.php
	lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/default.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/error.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/rss/default.ctp
	lib/Cake/Model/Behavior/TranslateBehavior.php
	lib/Cake/Model/Model.php
	lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php
	lib/Cake/Test/Case/Core/CakePluginTest.php
	lib/Cake/Test/Case/Core/ObjectTest.php
	lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php
	lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php
	lib/Cake/Test/Case/Model/Behavior/TreeBehaviorNumberTest.php
	lib/Cake/Test/Case/Model/Behavior/TreeBehaviorUuidTest.php
	lib/Cake/Test/Case/Model/ModelIntegrationTest.php
	lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
	lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php
	lib/Cake/Test/Case/Utility/StringTest.php
	lib/Cake/TestSuite/Fixture/CakeTestFixture.php
	lib/Cake/View/Helper/PaginatorHelper.php
	src/Controller/Component/AuthComponent.php
	src/Network/Request.php
	src/Routing/Route/Route.php
	src/Utility/Time.php
	tests/TestCase/Network/RequestTest.php
	tests/TestCase/Routing/RouterTest.php
	tests/test_app/TestApp/Template/Layout/Email/html/default.ctp
	tests/test_app/TestApp/Template/Layout/Email/html/japanese.ctp
	tests/test_app/TestApp/Template/Layout/Email/html/thin.ctp
	tests/test_app/TestApp/Template/Layout/cache_empty_sections.ctp
	tests/test_app/TestApp/Template/Layout/default.ctp
ADmad 12 years ago
parent
commit
46d153ca26

+ 10 - 11
build.xml

@@ -24,7 +24,7 @@
 		The set of files we're going to package
 		Exclude the cli scripts, as they get installed separately.
 	 -->
-	<fileset id="libs" dir="./Cake">
+	<fileset id="libs" dir="./src">
 		<include name="**" />
 		<exclude name="Console/cake.bat" />
 		<exclude name="Console/cake.php" />
@@ -34,14 +34,14 @@
 	<!--
 		CLI scripts to package and install
 	-->
-	<fileset id="cli" dir="./Cake/Console">
+	<fileset id="cli" dir="./src/Console">
 		<include name="cake.bat" />
 		<include name="cake.php" />
 		<include name="cake" />
 	</fileset>
 
-	<fileset id="non-tests" dir="./Cake">
-		<exclude name="./Cake/Test" />
+	<fileset id="non-tests" dir="./Test">
+		<exclude name="*" />
 	</fileset>
 
 	<!-- start fresh each time.  Remove the dist and build dirs -->
@@ -101,7 +101,7 @@
 		<mkdir dir="${dist.dir}" />
 
 		<echo msg="Copying files to build directory" />
-		<copy todir="${build.dir}/${pear.package}/Cake">
+		<copy todir="${build.dir}/${pear.package}/src">
 			<fileset refid="libs" />
 		</copy>
 		<copy todir="${build.dir}/${pear.package}/bin">
@@ -140,9 +140,8 @@
 				<package name="PHPUnit" channel="pear.phpunit.de" minimum_version="3.7.0" type="optional" />
 			</dependencies>
 			<dirroles key="bin">script</dirroles>
-			<dirroles key="Cake/Test">php</dirroles>
-			<dirroles key="Cake/Console/Templates/default">php</dirroles>
-			<dirroles key="Cake/View">php</dirroles>
+			<dirroles key="src/Console/Templates/default">php</dirroles>
+			<dirroles key="src/View">php</dirroles>
 			<release>
 				<install as="cake.bat" name="bin/cake.bat" />
 				<install as="cake.php" name="bin/cake.php" />
@@ -150,7 +149,7 @@
 			</release>
 			<exceptions key="VERSION.txt">php</exceptions>
 			<exceptions key="LICENSE.txt">php</exceptions>
-			<exceptions key="Cake/Config/cacert.pem">php</exceptions>
+			<exceptions key="src/Config/cacert.pem">php</exceptions>
 		</d51pearpkg2>
 	</target>
 
@@ -241,11 +240,11 @@
 			<formatter type="pmd" outfile="pmd-cpd.xml"/>
 		</phpcpd>
 		<phpdepend>
-			<fileset refid="non-tests" />
+			<fileset refid="libs" />
 			<logger type="jdepend-xml" outfile="jdepend.xml"/>
 		</phpdepend>
 		<phpmd rulesets="codesize,unusedcode,design">
-			<fileset refid="non-tests" />
+			<fileset refid="libs" />
 			<formatter type="xml" outfile="reports/pmd.html"/>
 		</phpmd>
 	</target>

+ 26 - 0
lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php

@@ -0,0 +1,26 @@
+<?php
+/**
+ * AllTests file
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * For full copyright and license information, please see the LICENSE.txt
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link          http://cakephp.org CakePHP(tm) Project
+ * @package       app.Test.Case
+ * @since         CakePHP(tm) v 2.5
+ * @license       http://www.opensource.org/licenses/mit-license.php MIT License
+ */
+
+class AllTestsTest extends CakeTestSuite {
+
+	public static function suite() {
+		$suite = new CakeTestSuite('All application tests');
+		$suite->addTestDirectoryRecursive(TESTS . 'Case');
+		return $suite;
+	}
+}

+ 6 - 0
src/Console/Command/Task/ControllerTask.php

@@ -111,6 +111,7 @@ class ControllerTask extends BakeTask {
 			$admin = $this->Project->getPrefix();
 		}
 
+		$controllersCreated = 0;
 		foreach ($this->__tables as $table) {
 			$model = $this->_modelName($table);
 			$controller = $this->_controllerName($model);
@@ -124,8 +125,13 @@ class ControllerTask extends BakeTask {
 				if ($this->bake($controller, $actions) && $unitTestExists) {
 					$this->bakeTest($controller);
 				}
+				$controllersCreated++;
 			}
 		}
+
+		if (!$controllersCreated) {
+			$this->out(__d('cake_console', 'No Controllers were baked, Models need to exist before Controllers can be baked.'));
+		}
 	}
 
 /**

+ 1 - 1
src/Network/Request.php

@@ -266,7 +266,7 @@ class Request implements \ArrayAccess {
  * @return void
  */
 	protected function _processGet($query) {
-		unset($query['/' . str_replace('.', '_', urldecode($this->url))]);
+		unset($query[$this->base . '/' . str_replace('.', '_', urldecode($this->url))]);
 		if (strpos($this->url, '?') !== false) {
 			list(, $querystr) = explode('?', $this->url);
 			parse_str($querystr, $queryArgs);

+ 4 - 0
src/Network/Response.php

@@ -380,6 +380,7 @@ class Response {
  *
  * @param array $options list of parameters to setup the response. Possible values are:
  *	- body: the response text that should be sent to the client
+ *	- statusCodes: additional allowable response codes
  *	- status: the HTTP status code to respond with
  *	- type: a complete mime-type string or an extension mapped in this class
  *	- charset: the charset for the response body
@@ -388,6 +389,9 @@ class Response {
 		if (isset($options['body'])) {
 			$this->body($options['body']);
 		}
+		if (isset($options['statusCodes'])) {
+			$this->httpCodes($options['statusCodes']);
+		}
 		if (isset($options['status'])) {
 			$this->statusCode($options['status']);
 		}

+ 1 - 7
src/Routing/Route/Route.php

@@ -307,12 +307,6 @@ class Route {
 			$route[$key] = $value;
 		}
 
-		foreach ($this->keys as $key) {
-			if (isset($route[$key])) {
-				$route[$key] = rawurldecode($route[$key]);
-			}
-		}
-
 		if (isset($route['_args_'])) {
 			$pass = $this->_parseArgs($route['_args_'], $route);
 			$route['pass'] = array_merge($route['pass'], $pass);
@@ -320,7 +314,7 @@ class Route {
 		}
 
 		if (isset($route['_trailing_'])) {
-			$route['pass'][] = rawurldecode($route['_trailing_']);
+			$route['pass'][] = $route['_trailing_'];
 			unset($route['_trailing_']);
 		}
 

+ 1 - 2
src/Utility/Debugger.php

@@ -79,8 +79,7 @@ class Debugger {
 			'traceLine' => '{:reference} - {:path}, line {:line}',
 			'trace' => "Trace:\n{:trace}\n",
 			'context' => "Context:\n{:context}\n",
-		),
-		'log' => array(),
+		)
 	);
 
 /**

+ 1 - 1
src/Utility/Time.php

@@ -73,7 +73,7 @@ class Time {
 	public static $wordEnd = '+1 month';
 
 /**
- * Temporary variable containing timestamp value, used internally convertSpecifiers()
+ * Temporary variable containing the timestamp value, used internally in convertSpecifiers()
  *
  * @var integer
  */

+ 5 - 1
src/View/Helper/FormHelper.php

@@ -2832,7 +2832,11 @@ class FormHelper extends Helper {
 				if ($min > $max) {
 					list($min, $max) = array($max, $min);
 				}
-				if (!empty($options['value']) && (int)$options['value'] < $min) {
+				if (
+					!empty($options['value']) &&
+					(int)$options['value'] < $min &&
+					(int)$options['value'] > 0
+				) {
 					$min = (int)$options['value'];
 				} elseif (!empty($options['value']) && (int)$options['value'] > $max) {
 					$max = (int)$options['value'];

+ 11 - 4
src/View/View.php

@@ -454,7 +454,6 @@ class View extends Object {
 		if ($this->hasRendered) {
 			return true;
 		}
-		$this->Blocks->set('content', '');
 
 		if ($view !== false && $viewFileName = $this->_getViewFileName($view)) {
 			$this->_currentType = static::TYPE_VIEW;
@@ -487,7 +486,8 @@ class View extends Object {
  * - `$scripts_for_layout` is deprecated and will be removed in CakePHP 3.0.
  *   Use the block features instead. `meta`, `css` and `script` will be populated
  *   by the matching methods on HtmlHelper.
- * - `$title_for_layout` is deprecated and will be removed in CakePHP 3.0
+ * - `$title_for_layout` is deprecated and will be removed in CakePHP 3.0.
+ *   Use the `title` block instead.
  * - `$content_for_layout` is deprecated and will be removed in CakePHP 3.0.
  *   Use the `content` block instead.
  *
@@ -517,9 +517,16 @@ class View extends Object {
 			'scripts_for_layout' => $scripts,
 		));
 
-		if (!isset($this->viewVars['title_for_layout'])) {
-			$this->viewVars['title_for_layout'] = Inflector::humanize($this->viewPath);
+		$title = $this->Blocks->get('title');
+		if ($title === '') {
+			if (isset($this->viewVars['title_for_layout'])) {
+				$title = $this->viewVars['title_for_layout'];
+			} else {
+				$title = Inflector::humanize($this->viewPath);
+			}
 		}
+		$this->viewVars['title_for_layout'] = $title;
+		$this->Blocks->set('title', $title);
 
 		$this->_currentType = static::TYPE_LAYOUT;
 		$this->Blocks->set('content', $this->_render($layoutFileName));

+ 46 - 2
tests/TestCase/Network/RequestTest.php

@@ -1451,10 +1451,18 @@ class RequestTest extends TestCase {
 	public function testGetParamsWithDot() {
 		$_GET = array();
 		$_GET['/posts/index/add_add'] = '';
+		$_SERVER['PHP_SELF'] = '/webroot/index.php';
+		$_SERVER['REQUEST_URI'] = '/posts/index/add.add';
+		$request = Request::createFromGlobals();
+		$this->assertEquals('', $request->base);
+		$this->assertEquals(array(), $request->query);
+
+		$_GET = array();
+		$_GET['/cake_dev/posts/index/add_add'] = '';
 		$_SERVER['PHP_SELF'] = '/cake_dev/webroot/index.php';
 		$_SERVER['REQUEST_URI'] = '/cake_dev/posts/index/add.add';
-
 		$request = Request::createFromGlobals();
+		$this->assertEquals('/cake_dev', $request->base);
 		$this->assertEquals(array(), $request->query);
 	}
 
@@ -1466,10 +1474,18 @@ class RequestTest extends TestCase {
 	public function testGetParamWithUrlencodedElement() {
 		$_GET = array();
 		$_GET['/posts/add/∂∂'] = '';
+		$_SERVER['PHP_SELF'] = '/webroot/index.php';
+		$_SERVER['REQUEST_URI'] = '/posts/add/%E2%88%82%E2%88%82';
+		$request = Request::createFromGlobals();
+		$this->assertEquals('', $request->base);
+		$this->assertEquals(array(), $request->query);
+
+		$_GET = array();
+		$_GET['/cake_dev/posts/add/∂∂'] = '';
 		$_SERVER['PHP_SELF'] = '/cake_dev/webroot/index.php';
 		$_SERVER['REQUEST_URI'] = '/cake_dev/posts/add/%E2%88%82%E2%88%82';
-
 		$request = Request::createFromGlobals();
+		$this->assertEquals('/cake_dev', $request->base);
 		$this->assertEquals(array(), $request->query);
 	}
 
@@ -1844,6 +1860,34 @@ class RequestTest extends TestCase {
 					'urlParams' => array()
 				),
 			),
+			array(
+				'Nginx - w/rewrite, document root set above top level cake dir, request root, no PATH_INFO, base parameter set',
+				array(
+					'App' => array(
+						'base' => false,
+						'baseUrl' => false,
+						'dir' => 'app',
+						'webroot' => 'webroot'
+					),
+					'GET' => array('/site/posts/add' => ''),
+					'SERVER' => array(
+						'SERVER_NAME' => 'localhost',
+						'DOCUMENT_ROOT' => '/Library/WebServer/Documents',
+						'SCRIPT_FILENAME' => '/Library/WebServer/Documents/site/App/webroot/index.php',
+						'SCRIPT_NAME' => '/site/app/webroot/index.php',
+						'QUERY_STRING' => '/site/posts/add&',
+						'PHP_SELF' => '/site/webroot/index.php',
+						'PATH_INFO' => null,
+						'REQUEST_URI' => '/site/posts/add',
+					),
+				),
+				array(
+					'url' => 'posts/add',
+					'base' => '/site',
+					'webroot' => '/site/',
+					'urlParams' => array()
+				),
+			),
 		);
 	}
 

+ 15 - 0
tests/TestCase/Network/ResponseTest.php

@@ -66,6 +66,21 @@ class ResponseTest extends TestCase {
 		$this->assertEquals('my-custom-charset', $response->charset());
 		$this->assertEquals('audio/mpeg', $response->type());
 		$this->assertEquals(203, $response->statusCode());
+
+		$options = array(
+			'body' => 'This is the body',
+			'charset' => 'my-custom-charset',
+			'type' => 'mp3',
+			'status' => '422',
+			'statusCodes' => array(
+				422 => 'Unprocessable Entity'
+			)
+		);
+		$response = new Response($options);
+		$this->assertEquals($options['body'], $response->body());
+		$this->assertEquals($options['charset'], $response->charset());
+		$this->assertEquals($response->getMimeType($options['type']), $response->type());
+		$this->assertEquals($options['status'], $response->statusCode());
 	}
 
 /**

+ 2 - 2
tests/TestCase/Utility/HashTest.php

@@ -531,7 +531,7 @@ class HashTest extends TestCase {
 			'Validator',
 			'Transactional'
 		);
-		$this->assertEquals(Hash::merge($a, $b), $expected);
+		$this->assertEquals($expected, Hash::merge($a, $b));
 	}
 
 /**
@@ -1454,7 +1454,7 @@ class HashTest extends TestCase {
 			2 => array('Item' => array('id' => 3, 'title' => 'third')),
 			4 => array('Item' => array('id' => 5, 'title' => 'fifth')),
 		);
-		$this->assertEquals($result, $expected);
+		$this->assertEquals($expected, $result);
 	}
 
 /**

+ 2 - 2
tests/TestCase/Utility/SetTest.php

@@ -183,7 +183,7 @@ class SetTest extends TestCase {
 		$expected = array('users' => array('lisa' => array('id' => 5, 'pw' => 'you-will-never-guess', 'age' => 25, 'pet' => 'dog')), 'cakephp', 'ice-cream', 'chocolate');
 		$this->assertEquals($expected, Set::merge($a, $b, $c));
 
-		$this->assertEquals(Set::merge($a, $b, array(), $c), $expected);
+		$this->assertEquals($expected, Set::merge($a, $b, array(), $c));
 
 		$r = Set::merge($a, $b, $c);
 		$this->assertEquals($expected, $r);
@@ -1734,7 +1734,7 @@ class SetTest extends TestCase {
 		$this->assertFalse(Set::check($set, 'Session Test'));
 
 		$expected = array('Session Test' => array('Test Case' => 'test'));
-		$this->assertEquals(Set::insert(array(), 'Session Test.Test Case', "test"), $expected);
+		$this->assertEquals($expected, Set::insert(array(), 'Session Test.Test Case', "test"));
 		$this->assertTrue(Set::check($expected, 'Session Test.Test Case'));
 	}
 

+ 3 - 3
tests/TestCase/Utility/StringTest.php

@@ -624,12 +624,12 @@ podeís adquirirla.</span></p>
 		$expected = '<p><b>strong</b>bow <strong>isn&rsquo;t</strong> real cider</p>';
 		$this->assertEquals($expected, $this->Text->highlight($text2, 'strong', $options));
 
-		$this->assertEquals($this->Text->highlight($text3, 'strong', $options), $text3);
+		$this->assertEquals($text3, $this->Text->highlight($text3, 'strong', $options));
 
-		$this->assertEquals($this->Text->highlight($text3, array('strong', 'what'), $options), $text3);
+		$this->assertEquals($text3, $this->Text->highlight($text3, array('strong', 'what'), $options));
 
 		$expected = '<b>What</b> a <b>strong</b> mouse: <img src="what-a-strong-mouse.png" alt="What a strong mouse!" />';
-		$this->assertEquals($this->Text->highlight($text4, array('strong', 'what'), $options), $expected);
+		$this->assertEquals($expected, $this->Text->highlight($text4, array('strong', 'what'), $options));
 	}
 
 /**

+ 5 - 5
tests/TestCase/Utility/XmlTest.php

@@ -729,7 +729,7 @@ XML;
 			'pubDate' => 'Tue, 31 Aug 2010 01:42:00 -0500',
 			'guid' => 'http://bakery.cakephp.org/articles/view/alertpay-automated-sales-via-ipn'
 		);
-		$this->assertSame($rssAsArray['rss']['channel']['item'][1], $expected);
+		$this->assertSame($expected, $rssAsArray['rss']['channel']['item'][1]);
 
 		$rss = array(
 			'rss' => array(
@@ -795,7 +795,7 @@ XML;
 				'params' => ''
 			)
 		);
-		$this->assertSame(Xml::toArray($xml), $expected);
+		$this->assertSame($expected, Xml::toArray($xml));
 
 		$xml = Xml::build('<methodCall><methodName>test</methodName><params><param><value><array><data><value><int>12</int></value><value><string>Egypt</string></value><value><boolean>0</boolean></value><value><int>-31</int></value></data></array></value></param></params></methodCall>');
 		$expected = array(
@@ -819,7 +819,7 @@ XML;
 				)
 			)
 		);
-		$this->assertSame(Xml::toArray($xml), $expected);
+		$this->assertSame($expected, Xml::toArray($xml));
 
 		$xmlText = <<<XML
 <?xml version="1.0" encoding="UTF-8"?>
@@ -861,7 +861,7 @@ XML;
 				)
 			)
 		);
-		$this->assertSame(Xml::toArray($xml), $expected);
+		$this->assertSame($expected, Xml::toArray($xml));
 
 		$xml = Xml::fromArray($expected, 'tags');
 		$this->assertXmlStringEqualsXmlString($xmlText, $xml->asXML());
@@ -985,7 +985,7 @@ XML;
 		);
 		$expected = '<' . '?xml version="1.0" encoding="UTF-8"?><root><ns:attr xmlns:ns="http://cakephp.org">1</ns:attr></root>';
 		$xmlResponse = Xml::fromArray($xml);
-		$this->assertEquals(str_replace(array("\r", "\n"), '', $xmlResponse->asXML()), $expected);
+		$this->assertEquals($expected, str_replace(array("\r", "\n"), '', $xmlResponse->asXML()));
 
 		$xml = array(
 			'root' => array(

+ 19 - 0
tests/TestCase/View/Helper/FormHelperTest.php

@@ -6270,6 +6270,25 @@ class FormHelperTest extends TestCase {
 	}
 
 /**
+ * testDateTime all zeros
+ *
+ * @return void
+ */
+	public function testDateTimeAllZeros() {
+		$result = $this->Form->dateTime('Contact.date',
+			'DMY',
+			false,
+			array(
+				'empty' => array('day' => '-', 'month' => '-', 'year' => '-'),
+				'value' => '0000-00-00'
+			)
+		);
+
+		$this->assertRegExp('/<option value="">-<\/option>/', $result);
+		$this->assertNotRegExp('/<option value="0" selected="selected">0<\/option>/', $result);
+	}
+
+/**
  * testDateTimeEmptyAsArray
  *
  * @return void

+ 2 - 2
tests/test_app/TestApp/Template/Layout/Email/html/default.ctp

@@ -2,7 +2,7 @@
 
 <html>
 <head>
-	<title><?= $title_for_layout; ?></title>
+	<title><?= $this->fetch('title'); ?></title>
 </head>
 
 <body>
@@ -10,4 +10,4 @@
 
 	<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p>
 </body>
-</html>
+</html>

+ 2 - 2
tests/test_app/TestApp/Template/Layout/Email/html/japanese.ctp

@@ -2,7 +2,7 @@
 
 <html>
 <head>
-	<title><?= $title_for_layout; ?></title>
+	<title><?= $this->fetch('title'); ?></title>
 </head>
 
 <body>
@@ -10,4 +10,4 @@
 
 	<p>このメールは <a href="http://cakephp.org">CakePHP Framework</a> を利用して送信しました。</p>
 </body>
-</html>
+</html>

+ 2 - 2
tests/test_app/TestApp/Template/Layout/Email/html/thin.ctp

@@ -2,7 +2,7 @@
 
 <html>
 <head>
-	<title><?= $title_for_layout; ?></title>
+	<title><?= $this->fetch('title'); ?></title>
 </head>
 
 <body>
@@ -10,4 +10,4 @@
 
 	<p>This email was sent using the CakePHP Framework</p>
 </body>
-</html>
+</html>

+ 2 - 2
tests/test_app/TestApp/Template/Layout/cache_empty_sections.ctp

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title><?= $title_for_layout; ?></title>
+	<title><?= $this->fetch('title'); ?></title>
 	<!--nocache--><?php $x = 1; ?><!--/nocache-->
 </head>
 <body>
@@ -10,4 +10,4 @@
 	<?= $this->fetch('content'); ?>
 	<!--nocache--><?= 'cached count is: ' . $x; ?><!--/nocache-->
 </body>
-</html>
+</html>

+ 2 - 2
tests/test_app/TestApp/Template/Layout/default.ctp

@@ -9,14 +9,14 @@ $cakeDescription = 'CakePHP: the rapid development php framework';
 	<?= $this->Html->charset(); ?>
 	<title>
 		<?= $cakeDescription ?>:
-		<?= $title_for_layout; ?>
+		<?= $this->fetch('title'); ?>
 	</title>
 	<?php
 		echo $this->Html->meta('icon');
 
 		echo $this->Html->css('cake.generic');
 
-		echo $scripts_for_layout;
+		echo $this->fetch('script');
 	?>
 </head>
 <body>

+ 1 - 1
tests/test_app/TestApp/Template/Layout/rss/default.ctp

@@ -5,7 +5,7 @@ if (!isset($channel)) {
 	$channel = array();
 }
 if (!isset($channel['title'])) {
-	$channel['title'] = $title_for_layout;
+	$channel['title'] = $this->fetch('title');
 }
 
 echo $this->Rss->document(