mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Remove leftover of pageTitle.
This commit is contained in:
parent
5e9b22271a
commit
eb98770304
4 changed files with 5 additions and 42 deletions
|
@ -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');
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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'] = '';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue