Remove leftover of pageTitle.

This commit is contained in:
euromark 2013-10-04 00:35:56 +02:00
parent 5e9b22271a
commit eb98770304
4 changed files with 5 additions and 42 deletions

View file

@ -605,7 +605,6 @@ class ControllerTest extends CakeTestCase {
$Controller->set('title', 'someTitle');
$this->assertSame($Controller->viewVars['title'], 'someTitle');
$this->assertTrue(empty($Controller->pageTitle));
$Controller->viewVars = array();
$expected = array('ModelName' => 'name', 'ModelName2' => 'name2');

View file

@ -93,7 +93,7 @@ class RssHelperTest extends CakeTestCase {
*/
public function testChannel() {
$attrib = array('a' => '1', 'b' => '2');
$elements = array('title' => 'title');
$elements = array('title' => 'Title');
$content = 'content';
$result = $this->Rss->channel($attrib, $elements, $content);
@ -103,30 +103,7 @@ class RssHelperTest extends CakeTestCase {
'b' => '2'
),
'<title',
'title',
'/title',
'<link',
$this->Rss->url('/', true),
'/link',
'<description',
'content',
'/channel'
);
$this->assertTags($result, $expected);
$this->View->pageTitle = 'title';
$attrib = array('a' => '1', 'b' => '2');
$elements = array();
$content = 'content';
$result = $this->Rss->channel($attrib, $elements, $content);
$expected = array(
'channel' => array(
'a' => '1',
'b' => '2'
),
'<title',
'title',
'Title',
'/title',
'<link',
$this->Rss->url('/', true),

View file

@ -1610,19 +1610,6 @@ TEXT;
$this->assertEquals($expected, $result);
}
/**
* Test that setting arbitrary properties still works.
*
* @return void
*/
public function testPropertySetting() {
$this->assertFalse(isset($this->View->pageTitle));
$this->View->pageTitle = 'test';
$this->assertTrue(isset($this->View->pageTitle));
$this->assertTrue(!empty($this->View->pageTitle));
$this->assertEquals('test', $this->View->pageTitle);
}
/**
* Test that setting arbitrary properties still works.
*

View file

@ -123,12 +123,12 @@ class RssHelper extends AppHelper {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::channel
*/
public function channel($attrib = array(), $elements = array(), $content = null) {
if (!isset($elements['title']) && !empty($this->_View->pageTitle)) {
$elements['title'] = $this->_View->pageTitle;
}
if (!isset($elements['link'])) {
$elements['link'] = '/';
}
if (!isset($elements['title'])) {
$elements['title'] = '';
}
if (!isset($elements['description'])) {
$elements['description'] = '';
}