2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
38 require_once 'include/ListView/ListViewDisplay.php';
40 class ListViewDisplayTest extends Sugar_PHPUnit_Framework_TestCase
44 public function setUp()
46 $this->_lvd = new ListViewDisplayMock();
47 $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
48 $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
50 if(isset($sugar_config['save_query']))
52 $this->save_query = $sugar_config['save_query'];
56 public function tearDown()
59 if(!empty($this->save_query))
61 $sugar_config['save_query'] = $this->save_query;
63 SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
64 unset($GLOBALS['current_user']);
65 unset($GLOBALS['app_strings']);
68 public function testConstructor()
70 $this->assertInstanceOf('ListViewData',$this->_lvd->lvd);
71 $this->assertInternalType('array',$this->_lvd->searchColumns);
74 public function testShouldProcessWhenConfigSaveQueryIsNotSet()
76 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
77 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
79 $GLOBALS['sugar_config']['save_query'] = null;
81 $this->assertTrue($this->_lvd->shouldProcess('foo'));
82 $this->assertTrue($this->_lvd->should_process);
84 if ( isset($oldsavequery) ) {
85 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
89 public function testShouldProcessWhenConfigSaveQueryIsNotPopulateOnly()
91 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
92 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
94 $GLOBALS['sugar_config']['save_query'] = 'populate_always';
96 $this->assertTrue($this->_lvd->shouldProcess('foo'));
97 $this->assertTrue($this->_lvd->should_process);
99 if ( isset($oldsavequery) ) {
100 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
104 public function testShouldProcessWhenGlobalDisplayListViewIsTrue()
106 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
107 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
109 $GLOBALS['sugar_config']['save_query'] = 'populate_only';
110 $GLOBALS['displayListView'] = true;
112 $this->assertTrue($this->_lvd->shouldProcess('foo'));
113 $this->assertTrue($this->_lvd->should_process);
115 if ( isset($oldsavequery) ) {
116 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
120 public function testShouldProcessWhenGlobalDisplayListViewIsFalseAndRequestClearQueryIsTrue()
122 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
123 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
125 $GLOBALS['sugar_config']['save_query'] = 'populate_only';
126 $GLOBALS['displayListView'] = false;
127 $_REQUEST['clear_query'] = true;
128 $_REQUEST['module'] = 'foo';
130 $this->assertFalse($this->_lvd->shouldProcess('foo'));
131 $this->assertFalse($this->_lvd->should_process);
133 if ( isset($oldsavequery) ) {
134 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
138 public function testShouldProcessWhenGlobalDisplayListViewIsFalseAndRequestClearQueryIsFalseAndModulesDoNotEqual()
140 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
141 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
143 $GLOBALS['sugar_config']['save_query'] = 'populate_only';
144 $GLOBALS['displayListView'] = false;
145 $_REQUEST['clear_query'] = false;
146 $_REQUEST['module'] = 'bar';
148 $this->assertTrue($this->_lvd->shouldProcess('foo'));
149 $this->assertTrue($this->_lvd->should_process);
151 if ( isset($oldsavequery) ) {
152 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
156 public function testShouldProcessWhenGlobalDisplayListViewIsFalseAndRequestClearQueryIsFalseAndModulesDoEqualAndQueryIsEmpty()
158 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
159 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
161 $GLOBALS['sugar_config']['save_query'] = 'populate_only';
162 $GLOBALS['displayListView'] = false;
163 $_REQUEST['clear_query'] = false;
164 $_REQUEST['module'] = 'foo';
165 $_REQUEST['query'] = '';
166 $_SESSION['last_search_mod'] = '';
168 $this->assertFalse($this->_lvd->shouldProcess('foo'));
169 $this->assertFalse($this->_lvd->should_process);
171 if ( isset($oldsavequery) ) {
172 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
176 public function testShouldProcessWhenGlobalDisplayListViewIsFalseAndRequestClearQueryIsFalseAndModulesDoEqualAndQueryEqualsMsi()
178 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
179 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
181 $GLOBALS['sugar_config']['save_query'] = 'populate_only';
182 $GLOBALS['displayListView'] = false;
183 $_REQUEST['clear_query'] = false;
184 $_REQUEST['module'] = 'foo';
185 $_REQUEST['query'] = 'MSI';
186 $_SESSION['last_search_mod'] = '';
188 $this->assertFalse($this->_lvd->shouldProcess('foo'));
189 $this->assertFalse($this->_lvd->should_process);
191 if ( isset($oldsavequery) ) {
192 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
196 public function testShouldProcessWhenGlobalDisplayListViewIsFalseAndRequestClearQueryIsFalseAndModulesDoNotEqualAndQueryDoesNotEqualsMsi()
198 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
199 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
201 $GLOBALS['sugar_config']['save_query'] = 'populate_only';
202 $GLOBALS['displayListView'] = false;
203 $_REQUEST['clear_query'] = false;
204 $_REQUEST['module'] = 'foo';
205 $_REQUEST['query'] = 'xMSI';
206 $_SESSION['last_search_mod'] = '';
208 $this->assertTrue($this->_lvd->shouldProcess('foo'));
209 $this->assertTrue($this->_lvd->should_process);
211 if ( isset($oldsavequery) ) {
212 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
216 public function testShouldProcessWhenGlobalDisplayListViewIsFalseAndRequestClearQueryIsFalseAndModulesDoEqualAndLastSearchModEqualsModule()
218 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
219 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
221 $GLOBALS['sugar_config']['save_query'] = 'populate_only';
222 $GLOBALS['displayListView'] = false;
223 $_REQUEST['clear_query'] = false;
224 $_REQUEST['module'] = 'foo';
225 $_REQUEST['query'] = '';
226 $_SESSION['last_search_mod'] = 'foo';
228 //C.L. Because of fix to 40186, the following two tests are now set to assertFalse
229 $this->assertFalse($this->_lvd->shouldProcess('foo'), 'Assert that ListViewDisplay->shouldProcess is false even if module is the same because no query was specified');
230 $this->assertFalse($this->_lvd->should_process, 'Assert that ListViewDisplay->shouldProcess class variable is false');
232 if ( isset($oldsavequery) ) {
233 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
237 public function testShouldProcessWhenGlobalDisplayListViewIsFalseAndRequestClearQueryIsFalseAndModulesDoEqualAndLastSearchModDoesNotEqualsModule()
239 if ( isset($GLOBALS['sugar_config']['save_query']) ) {
240 $oldsavequery = $GLOBALS['sugar_config']['save_query'];
242 $GLOBALS['sugar_config']['save_query'] = 'populate_only';
243 $GLOBALS['displayListView'] = false;
244 $_REQUEST['clear_query'] = false;
245 $_REQUEST['module'] = 'foo';
246 $_REQUEST['query'] = '';
247 $_SESSION['last_search_mod'] = 'bar';
249 $this->assertFalse($this->_lvd->shouldProcess('foo'));
250 $this->assertFalse($this->_lvd->should_process);
252 if ( isset($oldsavequery) ) {
253 $GLOBALS['sugar_config']['save_query'] = $oldsavequery;
257 public function testProcess()
260 'data' => array(1,2,3),
261 'pageData' => array('bean' => array('moduleDir'=>'testmoduledir'))
263 $this->_lvd->process('foo',$data,'testmetestme');
265 $this->assertEquals(3,$this->_lvd->rowCount);
266 $this->assertEquals('testmoduledir2_TESTMETESTME_offset',$this->_lvd->moduleString);
269 public function testDisplayIfShouldNotProcess()
271 $this->_lvd->should_process = false;
273 $this->assertEmpty($this->_lvd->display());
276 public function testDisplayIfMultiSelectFalse()
278 $this->_lvd->should_process = true;
279 $this->_lvd->multiSelect = false;
281 $this->assertEmpty($this->_lvd->display());
284 public function testDisplayIfShowMassUpdateFormFalse()
286 $this->_lvd->should_process = true;
287 $this->_lvd->show_mass_update_form = false;
289 $this->assertEmpty($this->_lvd->display());
292 public function testDisplayIfShowMassUpdateFormTrueAndMultiSelectTrue()
294 $this->_lvd->should_process = true;
295 $this->_lvd->show_mass_update_form = true;
296 $this->_lvd->multiSelect = true;
297 $this->_lvd->multi_select_popup = true;
298 $this->_lvd->mass = $this->getMock('MassUpdate');
299 $this->_lvd->mass->expects($this->any())
300 ->method('getDisplayMassUpdateForm')
301 ->will($this->returnValue('foo'));
302 $this->_lvd->mass->expects($this->any())
303 ->method('getMassUpdateFormHeader')
304 ->will($this->returnValue('bar'));
306 $this->assertEquals('foobar',$this->_lvd->display());
309 public function testBuildSelectLink()
311 $output = $this->_lvd->buildSelectLink();
312 $output = implode($output['buttons'],"");
313 $this->assertContains("<a id='select_link'",$output);
314 $this->assertContains("sListView.check_all(document.MassUpdate, \"mass[]\", true, 0)",$output);
315 $this->assertContains("sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,0);",$output);
318 public function testBuildSelectLinkWithParameters()
320 $output = $this->_lvd->buildSelectLink('testtest',1,2);
321 $output = implode($output['buttons'],"");
322 $this->assertContains("<a id='testtest'",$output);
323 $this->assertContains("sListView.check_all(document.MassUpdate, \"mass[]\", true, 2)",$output);
324 $this->assertContains("sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,1);",$output);
327 public function testBuildSelectLinkWithPageTotalLessThanZero()
329 $output = $this->_lvd->buildSelectLink('testtest',1,-1);
330 $output = implode($output['buttons'],"");
331 $this->assertContains("<a id='testtest'",$output);
332 $this->assertContains("sListView.check_all(document.MassUpdate, \"mass[]\", true, 1)",$output);
333 $this->assertContains("sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,1);",$output);
336 public function testBuildExportLink()
338 $this->_lvd->seed = new stdClass;
339 $this->_lvd->seed->module_dir = 'testtest';
340 $output = $this->_lvd->buildExportLink();
342 $this->assertContains("return sListView.send_form(true, 'testtest', 'index.php?entryPoint=export',",$output);
345 public function testBuildMassUpdateLink()
347 $output = $this->_lvd->buildMassUpdateLink();
349 $this->assertRegExp("/.*document\.getElementById\(['\"]massupdate_form['\"]\)\.style\.display\s*=\s*['\"]['\"].*/", $output);
352 public function testComposeEmailIfFieldDefsNotAnArray()
354 $this->_lvd->seed = new stdClass;
355 $this->_lvd->seed->field_defs = false;
357 $this->assertEmpty($this->_lvd->buildComposeEmailLink(0));
360 public function testComposeEmailIfFieldDefsAreAnEmptyArray()
362 $this->_lvd->seed = new stdClass;
363 $this->_lvd->seed->field_defs = array();
365 $this->assertEmpty($this->_lvd->buildComposeEmailLink(0));
368 public function testComposeEmailIfFieldDefsDoNotHaveAnEmailAddressesRelationship()
370 $this->_lvd->seed = new stdClass;
371 $this->_lvd->seed->object_name = 'foobar';
372 $this->_lvd->seed->field_defs = array(
378 $this->assertEmpty($this->_lvd->buildComposeEmailLink(0));
381 public function testComposeEmailIfFieldDefsIfUsingSugarEmailClient()
383 $this->_lvd->seed = new stdClass;
384 $this->_lvd->seed->object_name = 'foobar';
385 $this->_lvd->seed->module_dir = 'foobarfoobar';
386 $this->_lvd->seed->field_defs = array(
389 'relationship' => 'foobar_emailaddresses',
392 $GLOBALS['dictionary']['foobar']['relationships']['foobar_emailaddresses']['rhs_module'] = 'EmailAddresses';
393 $GLOBALS['current_user']->setPreference('email_link_type','sugar');
395 $output = $this->_lvd->buildComposeEmailLink(5);
397 $this->assertContains(', \'foobarfoobar\', \'5\', ',$output);
399 unset($GLOBALS['dictionary']['foobar']);
402 public function testComposeEmailIfFieldDefsIfUsingExternalEmailClient()
404 $this->_lvd->seed = new stdClass;
405 $this->_lvd->seed->object_name = 'foobar';
406 $this->_lvd->seed->module_dir = 'foobarfoobar';
407 $_REQUEST['module'] = 'foobarfoobar';
408 $this->_lvd->seed->field_defs = array(
411 'relationship' => 'foobar_emailaddresses',
414 $_REQUEST['module'] = 'foo';
416 $GLOBALS['dictionary']['foobar']['relationships']['foobar_emailaddresses']['rhs_module'] = 'EmailAddresses';
417 $GLOBALS['current_user']->setPreference('email_link_type','mailto');
419 $output = $this->_lvd->buildComposeEmailLink(5);
421 $this->assertContains('sListView.use_external_mail_client',$output);
423 unset($GLOBALS['dictionary']['foobar']);
424 unset($_REQUEST['module']);
427 public function testBuildDeleteLink()
429 $output = $this->_lvd->buildDeleteLink();
431 $this->assertContains("return sListView.send_mass_update",$output);
434 public function testBuildSelectedObjectsSpan()
436 $output = $this->_lvd->buildSelectedObjectsSpan(1,1);
438 $this->assertContains("<input style='border: 0px; background: transparent; font-size: inherit; color: inherit' type='text' id='selectCountTop' readonly name='selectCount[]' value='1' />",$output);
441 public function testBuildMergeDuplicatesLinkWithNoAccess()
443 $this->markTestIncomplete('This test has not been implemented yet.');
446 public function testBuildMergeDuplicatesLinkWhenModuleDoesNotHaveItEnabled()
448 $this->_lvd->seed = new stdClass;
449 $this->_lvd->seed->object_name = 'foobar';
450 $this->_lvd->seed->module_dir = 'foobarfoobar';
451 $GLOBALS['dictionary']['foobar']['duplicate_merge'] = false;
452 $GLOBALS['current_user']->is_admin = 1;
454 $this->assertEmpty($this->_lvd->buildMergeDuplicatesLink());
457 public function testBuildMergeDuplicatesLink()
459 $this->_lvd->seed = new stdClass;
460 $this->_lvd->seed->object_name = 'foobar';
461 $this->_lvd->seed->module_dir = 'foobarfoobar';
462 $GLOBALS['dictionary']['foobar']['duplicate_merge'] = true;
463 $GLOBALS['current_user']->is_admin = 1;
465 $output = $this->_lvd->buildMergeDuplicatesLink();
467 $this->assertContains("\"foobarfoobar\",\"\");}",$output);
470 public function testBuildMergeDuplicatesLinkBuildsReturnString()
472 $this->_lvd->seed = new stdClass;
473 $this->_lvd->seed->object_name = 'foobar';
474 $this->_lvd->seed->module_dir = 'foobarfoobar';
475 $GLOBALS['dictionary']['foobar']['duplicate_merge'] = true;
476 $GLOBALS['current_user']->is_admin = 1;
477 $_REQUEST['module'] = 'foo';
478 $_REQUEST['action'] = 'bar';
479 $_REQUEST['record'] = '1';
481 $output = $this->_lvd->buildMergeDuplicatesLink();
483 $this->assertContains("\"foobarfoobar\",\"&return_module=foo&return_action=bar&return_id=1\");}",$output);
485 public function testBuildMergeLinkWhenUserDisabledMailMerge()
487 $this->_lvd->seed = new stdClass;
488 $this->_lvd->seed->module_dir = 'foobarfoobar';
489 $GLOBALS['current_user']->setPreference('mailmerge_on','off');
491 $this->assertEmpty($this->_lvd->buildMergeLink());
494 public function testBuildMergeLinkWhenSystemDisabledMailMerge()
496 $this->_lvd->seed = new stdClass;
497 $this->_lvd->seed->module_dir = 'foobarfoobar';
499 $GLOBALS['current_user']->setPreference('mailmerge_on','on');
501 $settings_cache = sugar_cache_retrieve('admin_settings_cache');
502 if ( empty($settings_cache) ) {
503 $settings_cache = array();
505 $settings_cache['system_mailmerge_on'] = false;
506 sugar_cache_put('admin_settings_cache',$settings_cache);
508 $this->assertEmpty($this->_lvd->buildMergeLink());
510 sugar_cache_clear('admin_settings_cache');
513 public function testBuildMergeLinkWhenModuleNotInModulesArray()
515 $this->_lvd->seed = new stdClass;
516 $this->_lvd->seed->module_dir = 'foobarfoobar';
518 $GLOBALS['current_user']->setPreference('mailmerge_on','on');
520 $settings_cache = sugar_cache_retrieve('admin_settings_cache');
521 if ( empty($settings_cache) ) {
522 $settings_cache = array();
524 $settings_cache['system_mailmerge_on'] = true;
525 sugar_cache_put('admin_settings_cache',$settings_cache);
527 $this->assertEmpty($this->_lvd->buildMergeLink(array('foobar' => 'foobar')));
529 sugar_cache_clear('admin_settings_cache');
532 public function testBuildMergeLink()
534 $this->_lvd->seed = new stdClass;
535 $this->_lvd->seed->module_dir = 'foobarfoobar';
537 $GLOBALS['current_user']->setPreference('mailmerge_on','on');
539 $settings_cache = sugar_cache_retrieve('admin_settings_cache');
540 if ( empty($settings_cache) ) {
541 $settings_cache = array();
543 $settings_cache['system_mailmerge_on'] = true;
544 sugar_cache_put('admin_settings_cache',$settings_cache);
546 $output = $this->_lvd->buildMergeLink(array('foobarfoobar' => 'foobarfoobar'));
547 $this->assertContains("index.php?action=index&module=MailMerge&entire=true",$output);
549 sugar_cache_clear('admin_settings_cache');
552 public function testBuildTargetLink()
554 $_POST['module'] = 'foobar';
555 $this->_lvd->seed = new stdClass;
556 $this->_lvd->seed->module_dir = 'foobarfoobar';
558 $output = $this->_lvd->buildTargetList();
560 $this->assertContains("input.setAttribute ( 'name' , 'module' ); input.setAttribute ( 'value' , 'foobarfoobar' );",$output);
561 $this->assertContains("input.setAttribute ( 'name' , 'current_query_by_page' ); input.setAttribute ( 'value', '".base64_encode(serialize($_REQUEST))."' );",$output);
564 public function testDisplayEndWhenNotShowingMassUpdateForm()
566 $this->_lvd->show_mass_update_form = false;
568 $this->assertEmpty($this->_lvd->displayEnd());
571 public function testDisplayEndWhenShowingMassUpdateForm()
573 $this->_lvd->show_mass_update_form = true;
574 $this->_lvd->mass = $this->getMock('MassUpdate');
575 $this->_lvd->mass->expects($this->any())
576 ->method('getMassUpdateForm')
577 ->will($this->returnValue('foo'));
578 $this->_lvd->mass->expects($this->any())
579 ->method('endMassUpdateForm')
580 ->will($this->returnValue('bar'));
582 $this->assertEquals('foobar',$this->_lvd->displayEnd());
585 public function testGetMultiSelectData()
587 $this->_lvd->moduleString = 'foobar';
589 $output = $this->_lvd->getMultiSelectData();
591 $this->assertEquals($output, "<script>YAHOO.util.Event.addListener(window, \"load\", sListView.check_boxes);</script>\n".
592 "<textarea style='display: none' name='uid'></textarea>\n" .
593 "<input type='hidden' name='select_entire_list' value='0'>\n".
594 "<input type='hidden' name='foobar' value='0'>\n".
595 "<input type='hidden' name='show_plus' value=''>\n",$output);
598 public function testGetMultiSelectDataWithRequestParameterUidSet()
600 $this->_lvd->moduleString = 'foobar';
601 $_REQUEST['uid'] = '1234';
603 $output = $this->_lvd->getMultiSelectData();
605 $this->assertEquals("<script>YAHOO.util.Event.addListener(window, \"load\", sListView.check_boxes);</script>\n".
606 "<textarea style='display: none' name='uid'>1234</textarea>\n" .
607 "<input type='hidden' name='select_entire_list' value='0'>\n".
608 "<input type='hidden' name='foobar' value='0'>\n" .
609 "<input type='hidden' name='show_plus' value=''>\n",$output);
612 public function testGetMultiSelectDataWithRequestParameterSelectEntireListSet()
614 $this->_lvd->moduleString = 'foobar';
615 $_REQUEST['select_entire_list'] = '1234';
617 $output = $this->_lvd->getMultiSelectData();
619 $this->assertEquals("<script>YAHOO.util.Event.addListener(window, \"load\", sListView.check_boxes);</script>\n".
620 "<textarea style='display: none' name='uid'></textarea>\n" .
621 "<input type='hidden' name='select_entire_list' value='1234'>\n".
622 "<input type='hidden' name='foobar' value='0'>\n" .
623 "<input type='hidden' name='show_plus' value=''>\n",$output);
626 public function testGetMultiSelectDataWithRequestParameterMassupdateSet()
628 $this->_lvd->moduleString = 'foobar';
629 $_REQUEST['uid'] = '1234';
630 $_REQUEST['select_entire_list'] = '5678';
631 $_REQUEST['massupdate'] = 'true';
633 $output = $this->_lvd->getMultiSelectData();
635 $this->assertEquals("<script>YAHOO.util.Event.addListener(window, \"load\", sListView.check_boxes);</script>\n".
636 "<textarea style='display: none' name='uid'></textarea>\n" .
637 "<input type='hidden' name='select_entire_list' value='0'>\n".
638 "<input type='hidden' name='foobar' value='0'>\n".
639 "<input type='hidden' name='show_plus' value=''>\n",$output);
643 class ListViewDisplayMock extends ListViewDisplay
645 public function buildExportLink()
647 return parent::buildExportLink();
650 public function buildMassUpdateLink()
652 return parent::buildMassUpdateLink();
655 public function buildComposeEmailLink($totalCount)
657 return parent::buildComposeEmailLink($totalCount);
660 public function buildDeleteLink()
662 return parent::buildDeleteLink();
665 public function buildMergeDuplicatesLink()
667 return parent::buildMergeDuplicatesLink();
670 public function buildMergeLink(array $modules_array = null)
672 return parent::buildMergeLink($modules_array);
675 public function buildTargetList()
677 return parent::buildTargetList();