diff --git a/tests/application/modules/admin/controllers/UsersControllerTest.php b/tests/application/modules/admin/controllers/UsersControllerTest.php index 1a2aba5c7933b069931627a445b44301e39b510b..10386e3667471163e7c7db8eaf7e7daf2d2597a0 100644 --- a/tests/application/modules/admin/controllers/UsersControllerTest.php +++ b/tests/application/modules/admin/controllers/UsersControllerTest.php @@ -1458,6 +1458,32 @@ class UsersControllerManageDoubleTest extends UsersControllerDoubleTestCase { +class UsersControllerDeleteDoubleEndCursorTest extends Admin_AbstractControllerTestCase { + + public function setUp() { + parent::setUp(); + Zend_Registry::set('sql', $this->mock() + ->whenCalled('fetchAll') + ->with('select id_user, password, login, idabon, ordreabon, count(*) as doublon from bib_admin_users where role_level = 2 and id_user > 1000 group by idabon, ordreabon, login, password having doublon > 1 order by id_user') + ->answers([]) + ->whenCalled('fetchAll') + ->answers([])); + + $this->dispatch('/admin/users/delete-double/total/6/cursor/1000', true); + } + + + /** @test */ + public function jsonShouldBeRendered() { + $this->assertEquals(['total' => 6, + 'done' => 6, + 'cursor' => null, + 'run' => false], json_decode($this->_response->getBody(),true)); + } + +} + + class UsersControllerDeleteDoubleTest extends UsersControllerDoubleTestCase {