mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge branch '1.3' of github.com:cakephp/cakephp1x into 1.3
This commit is contained in:
commit
843d3c7095
2 changed files with 64 additions and 22 deletions
|
@ -427,7 +427,7 @@ class PaginatorHelper extends AppHelper {
|
||||||
$url = array_merge(array('page' => $paging['page'] + ($which == 'Prev' ? $step * -1 : $step)), $url);
|
$url = array_merge(array('page' => $paging['page'] + ($which == 'Prev' ? $step * -1 : $step)), $url);
|
||||||
|
|
||||||
if ($this->{$check}($model)) {
|
if ($this->{$check}($model)) {
|
||||||
return $this->link($title, $url, array_merge($options, compact('escape', 'class')));
|
return $this->Html->tag($tag, $this->link($title, $url, array_merge($options, compact('escape', 'class'))));
|
||||||
} else {
|
} else {
|
||||||
return $this->Html->tag($tag, $title, array_merge($options, compact('escape', 'class')));
|
return $this->Html->tag($tag, $title, array_merge($options, compact('escape', 'class')));
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,9 +396,11 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
$this->Paginator->params['paging']['Article']['page'] = 1;
|
$this->Paginator->params['paging']['Article']['page'] = 1;
|
||||||
$result = $this->Paginator->next('Next');
|
$result = $this->Paginator->next('Next');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/admin/users/index/page:2', 'class' => 'next'),
|
'a' => array('href' => '/admin/users/index/page:2', 'class' => 'next'),
|
||||||
'Next',
|
'Next',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
@ -497,17 +499,21 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->Paginator->next('next', array('url' => $options));
|
$result = $this->Paginator->next('next', array('url' => $options));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/members/posts/index/page:3', 'class' => 'next'),
|
'a' => array('href' => '/members/posts/index/page:3', 'class' => 'next'),
|
||||||
'next',
|
'next',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Paginator->prev('prev', array('url' => $options));
|
$result = $this->Paginator->prev('prev', array('url' => $options));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/members/posts/index/page:1', 'class' => 'prev'),
|
'a' => array('href' => '/members/posts/index/page:1', 'class' => 'prev'),
|
||||||
'prev',
|
'prev',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
@ -630,9 +636,11 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->Paginator->next('Next');
|
$result = $this->Paginator->next('Next');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/articles/index/2/page:2/foo:bar', 'class' => 'next'),
|
'a' => array('href' => '/articles/index/2/page:2/foo:bar', 'class' => 'next'),
|
||||||
'Next',
|
'Next',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
}
|
}
|
||||||
|
@ -669,33 +677,51 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
$this->Paginator->params['paging']['Client']['prevPage'] = true;
|
$this->Paginator->params['paging']['Client']['prevPage'] = true;
|
||||||
$result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled'));
|
$result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/page:1', 'class' => 'prev'),
|
'a' => array('href' => '/index/page:1', 'class' => 'prev'),
|
||||||
'<< Previous',
|
'<< Previous',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Paginator->next('Next');
|
$result = $this->Paginator->next('Next');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/page:3', 'class' => 'next'),
|
'a' => array('href' => '/index/page:3', 'class' => 'next'),
|
||||||
'Next',
|
'Next',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
|
);
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
$result = $this->Paginator->next('Next', array('tag' => 'li'));
|
||||||
|
$expected = array(
|
||||||
|
'<li',
|
||||||
|
'a' => array('href' => '/index/page:3', 'class' => 'next'),
|
||||||
|
'Next',
|
||||||
|
'/a',
|
||||||
|
'/li'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Paginator->prev('<< Previous', array('escape' => true));
|
$result = $this->Paginator->prev('<< Previous', array('escape' => true));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/page:1', 'class' => 'prev'),
|
'a' => array('href' => '/index/page:1', 'class' => 'prev'),
|
||||||
'<< Previous',
|
'<< Previous',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Paginator->prev('<< Previous', array('escape' => false));
|
$result = $this->Paginator->prev('<< Previous', array('escape' => false));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/page:1', 'class' => 'prev'),
|
'a' => array('href' => '/index/page:1', 'class' => 'prev'),
|
||||||
'preg:/<< Previous/',
|
'preg:/<< Previous/',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
@ -739,17 +765,21 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
$this->Paginator->params['paging']['Client']['prevPage'] = true;
|
$this->Paginator->params['paging']['Client']['prevPage'] = true;
|
||||||
$result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled'));
|
$result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/page:1/limit:3/sort:Client.name/direction:DESC', 'class' => 'prev'),
|
'a' => array('href' => '/index/page:1/limit:3/sort:Client.name/direction:DESC', 'class' => 'prev'),
|
||||||
'<< Previous',
|
'<< Previous',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected, true);
|
$this->assertTags($result, $expected, true);
|
||||||
|
|
||||||
$result = $this->Paginator->next('Next');
|
$result = $this->Paginator->next('Next');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/page:3/limit:3/sort:Client.name/direction:DESC', 'class' => 'next'),
|
'a' => array('href' => '/index/page:3/limit:3/sort:Client.name/direction:DESC', 'class' => 'next'),
|
||||||
'Next',
|
'Next',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
@ -760,9 +790,11 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
));
|
));
|
||||||
$result = $this->Paginator->prev('Prev');
|
$result = $this->Paginator->prev('Prev');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/page:1/limit:10', 'class' => 'prev'),
|
'a' => array('href' => '/index/page:1/limit:10', 'class' => 'prev'),
|
||||||
'Prev',
|
'Prev',
|
||||||
'/a',
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
@ -779,9 +811,11 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
$this->Paginator->options(array('url' => array(12, 'page' => 3)));
|
$this->Paginator->options(array('url' => array(12, 'page' => 3)));
|
||||||
$result = $this->Paginator->prev('Prev', array('url' => array('foo' => 'bar')));
|
$result = $this->Paginator->prev('Prev', array('url' => array('foo' => 'bar')));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/12/page:1/limit:10/foo:bar', 'class' => 'prev'),
|
'a' => array('href' => '/index/12/page:1/limit:10/foo:bar', 'class' => 'prev'),
|
||||||
'Prev',
|
'Prev',
|
||||||
'/a',
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
}
|
}
|
||||||
|
@ -815,9 +849,11 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->Paginator->next('Next >>', array('escape' => false));
|
$result = $this->Paginator->next('Next >>', array('escape' => false));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/index/page:2', 'class' => 'next'),
|
'a' => array('href' => '/index/page:2', 'class' => 'next'),
|
||||||
'preg:/Next >>/',
|
'preg:/Next >>/',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
}
|
}
|
||||||
|
@ -846,7 +882,11 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$result = $this->Paginator->next('Next', array('model' => 'Client'));
|
$result = $this->Paginator->next('Next', array('model' => 'Client'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'a' => array('href' => '/index/page:2', 'class' => 'next'), 'Next', '/a'
|
'<span',
|
||||||
|
'a' => array('href' => '/index/page:2', 'class' => 'next'),
|
||||||
|
'Next',
|
||||||
|
'/a',
|
||||||
|
'/span'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
@ -1784,9 +1824,11 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->Paginator->next('Next');
|
$result = $this->Paginator->next('Next');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
'<span',
|
||||||
'a' => array('href' => '/officespace/accounts/index/page:2/sort:Article.title/direction:asc', 'class' => 'next'),
|
'a' => array('href' => '/officespace/accounts/index/page:2/sort:Article.title/direction:asc', 'class' => 'next'),
|
||||||
'Next',
|
'Next',
|
||||||
'/a'
|
'/a',
|
||||||
|
'/span',
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue