コード例 #1
0
 public function testget_list_view_data()
 {
     $meeting = new Meeting();
     $current_theme = SugarThemeRegistry::current();
     //preset required attribute values
     $meeting->status == 'Planned';
     $meeting->parent_type = 'Accounts';
     $meeting->contact_id = 1;
     $meeting->contact_name = 'test';
     $meeting->parent_name = 'Account';
     $expected = array('DELETED' => 0, 'PARENT_TYPE' => 'Accounts', 'STATUS' => 'Planned', 'TYPE' => 'Sugar', 'REMINDER_TIME' => '-1', 'EMAIL_REMINDER_TIME' => '-1', 'EMAIL_REMINDER_SENT' => '0', 'SEQUENCE' => '0', 'CONTACT_NAME' => 'test', 'PARENT_NAME' => '', 'CONTACT_ID' => 1, 'REPEAT_INTERVAL' => '1', 'PARENT_MODULE' => 'Accounts', 'SET_COMPLETE' => '<a id=\'\' onclick=\'SUGAR.util.closeActivityPanel.show("Meetings","","Held","listview","1");\'><img src="themes/' . $current_theme . '/images/close_inline.png?v=fqXdFZ_r6FC1K7P_Fy3mVw"     border=\'0\' alt="Close" /></a>', 'DATE_START' => '<font class=\'overdueTask\'></font>', 'REMINDER_CHECKED' => false, 'EMAIL_REMINDER_CHECKED' => false);
     $actual = $meeting->get_list_view_data();
     //$this->assertSame($expected, $actual);
     $this->assertEquals($expected['PARENT_TYPE'], $actual['PARENT_TYPE']);
     $this->assertEquals($expected['STATUS'], $actual['STATUS']);
     $this->assertEquals($expected['TYPE'], $actual['TYPE']);
     $this->assertEquals($expected['REMINDER_TIME'], $actual['REMINDER_TIME']);
     $this->assertEquals($expected['EMAIL_REMINDER_TIME'], $actual['EMAIL_REMINDER_TIME']);
     $this->assertEquals($expected['EMAIL_REMINDER_SENT'], $actual['EMAIL_REMINDER_SENT']);
     $this->assertEquals($expected['CONTACT_NAME'], $actual['CONTACT_NAME']);
     $this->assertEquals($expected['CONTACT_ID'], $actual['CONTACT_ID']);
     $this->assertEquals($expected['REPEAT_INTERVAL'], $actual['REPEAT_INTERVAL']);
     $this->assertEquals($expected['PARENT_MODULE'], $actual['PARENT_MODULE']);
 }