mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
added a unit test
This commit is contained in:
parent
31fd4217b1
commit
50334679d6
1 changed files with 20 additions and 0 deletions
|
@ -496,6 +496,26 @@ class PaginatorComponentTest extends CakeTestCase {
|
||||||
$this->assertCount(3, $result);
|
$this->assertCount(3, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testPaginateI18nConditionNotTitleWithLimit() {
|
||||||
|
$Request = new CakeRequest('articles/index');
|
||||||
|
$Controller = new PaginatorTestController($Request);
|
||||||
|
$Controller->uses = array('TranslatedArticle');
|
||||||
|
$Controller->constructClasses();
|
||||||
|
$Controller->TranslatedArticle->locale = 'eng';
|
||||||
|
$Controller->Paginator->settings = array(
|
||||||
|
'recursive' => 0,
|
||||||
|
'conditions' => array(
|
||||||
|
'NOT' => array('I18n__title.content' => ''),
|
||||||
|
),
|
||||||
|
'limit' => 2,
|
||||||
|
);
|
||||||
|
$result = $Controller->Paginator->paginate('TranslatedArticle');
|
||||||
|
$this->assertEquals('Title (eng) #1', $result[0]['TranslatedArticle']['title']);
|
||||||
|
$this->assertEquals('Title (eng) #2', $result[1]['TranslatedArticle']['title']);
|
||||||
|
$this->assertEquals('Title (eng) #3', $result[2]['TranslatedArticle']['title']);
|
||||||
|
$this->assertCount(3, $result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that non-numeric values are rejected for page, and limit
|
* Test that non-numeric values are rejected for page, and limit
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue