Пример #1
0
 public function testDisplay()
 {
     $view = new ViewVcard();
     $view->bean = SugarTestContactUtilities::createContact();
     $view->module = 'Contacts';
     $view->display();
     SugarTestContactUtilities::removeAllCreatedContacts();
     $this->expectOutputRegex('/BEGIN\\:VCARD/');
 }
Пример #2
0
 public function testDisplay()
 {
     $view = new ViewVcard();
     $view->bean = SugarTestContactUtilities::createContact();
     $view->module = 'Contacts';
     ob_start();
     $view->display();
     $output = ob_get_contents();
     ob_end_clean();
     SugarTestContactUtilities::removeAllCreatedContacts();
     $this->assertContains('BEGIN:VCARD', $output);
 }
Пример #3
0
 public function testdisplay()
 {
     //execute the method with required child objects preset and check for the Object type and type attribute
     $view = new ViewVcard();
     $view->module = 'Contacts';
     $view->bean = new Contact();
     //execute the method and test if it works and does not throws an exception other than headers output exception.
     try {
         $view->display();
     } catch (Exception $e) {
         $this->assertStringStartsWith('Cannot modify header information', $e->getMessage());
     }
     $this->assertInstanceOf('ViewVcard', $view);
     $this->assertInstanceOf('SugarView', $view);
     $this->assertAttributeEquals('detail', 'type', $view);
 }