mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
parent
17eb0e4f68
commit
3a8c49e319
2 changed files with 32 additions and 1 deletions
|
@ -436,6 +436,37 @@ class RssHelperTest extends CakeTestCase {
|
||||||
'/item'
|
'/item'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
$item = array(
|
||||||
|
'title' => 'My title',
|
||||||
|
'description' => 'My description',
|
||||||
|
'link' => 'http://www.google.com/',
|
||||||
|
'category' => array('Category One', 'Category Two')
|
||||||
|
);
|
||||||
|
$result = $this->Rss->item(null, $item);
|
||||||
|
$expected = array(
|
||||||
|
'<item',
|
||||||
|
'<title',
|
||||||
|
'My title',
|
||||||
|
'/title',
|
||||||
|
'<description',
|
||||||
|
'My description',
|
||||||
|
'/description',
|
||||||
|
'<link',
|
||||||
|
'http://www.google.com/',
|
||||||
|
'/link',
|
||||||
|
'<category',
|
||||||
|
'Category One',
|
||||||
|
'/category',
|
||||||
|
'<category',
|
||||||
|
'Category Two',
|
||||||
|
'/category',
|
||||||
|
'<guid',
|
||||||
|
'http://www.google.com/',
|
||||||
|
'/guid',
|
||||||
|
'/item'
|
||||||
|
);
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -212,7 +212,7 @@ class RssHelper extends AppHelper {
|
||||||
if (is_array($val) && !empty($val[0])) {
|
if (is_array($val) && !empty($val[0])) {
|
||||||
foreach ($val as $category) {
|
foreach ($val as $category) {
|
||||||
$attrib = array();
|
$attrib = array();
|
||||||
if (isset($category['domain'])) {
|
if (is_array($category) && isset($category['domain'])) {
|
||||||
$attrib['domain'] = $category['domain'];
|
$attrib['domain'] = $category['domain'];
|
||||||
unset($category['domain']);
|
unset($category['domain']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue