mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding tests to test arbitrary class injection.
This commit is contained in:
parent
b1a27b1760
commit
29881561d3
1 changed files with 26 additions and 1 deletions
|
@ -25,7 +25,9 @@
|
||||||
* @lastmodified $Date$
|
* @lastmodified $Date$
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
*/
|
*/
|
||||||
App::import('Helper', array('Html', 'Paginator', 'Form', 'Ajax', 'Javascript'));
|
App::import('Helper', array('Html', 'Paginator', 'Form', 'Ajax', 'Javascript', 'Js'));
|
||||||
|
|
||||||
|
Mock::generate('JsHelper', 'PaginatorMockJsHelper');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PaginatorHelperTest class
|
* PaginatorHelperTest class
|
||||||
|
@ -1613,5 +1615,28 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test that mock classes injected into paginatorHelper are called when using link()
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
**/
|
||||||
|
function testMockAjaxProviderClassInjection() {
|
||||||
|
$Paginator =& new PaginatorHelper(array('ajax' => 'PaginatorMockJs'));
|
||||||
|
$Paginator->params['paging'] = array(
|
||||||
|
'Article' => array(
|
||||||
|
'current' => 9,
|
||||||
|
'count' => 62,
|
||||||
|
'prevPage' => false,
|
||||||
|
'nextPage' => true,
|
||||||
|
'pageCount' => 7,
|
||||||
|
'defaults' => array(),
|
||||||
|
'options' => array()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$Paginator->PaginatorMockJs =& new PaginatorMockJsHelper();
|
||||||
|
$Paginator->PaginatorMockJs->expectOnce('link');
|
||||||
|
$result = $Paginator->link('Page 2', array('page' => 2), array('update' => '#content'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Reference in a new issue