public function testsaveAndMarkDeletedAndValidated() { $eapm = new EAPM(); $eapm->name = 'test'; $eapm->url = 'test_url'; $eapm->application = 'webex'; //test validated method initially $this->assertEquals(false, $eapm->validated()); $eapm->save(); //test for record ID to verify that record is saved $this->assertTrue(isset($eapm->id)); $this->assertEquals(36, strlen($eapm->id)); //test validated method finally after save $this->assertEquals(null, $eapm->validated()); //retrieve back to test if validated attribute is updated in db $eapmValidated = $eapm->retrieve($eapm->id); //$this->assertEquals(1, $eapmValidated->validated); $this->markTestSkipped('Validated column never gets updated in Db '); //mark the record as deleted and verify that this record cannot be retrieved anymore. $eapm->mark_deleted($eapm->id); $result = $eapm->retrieve($eapm->id); $this->assertEquals(null, $result); }
$result = $focus->db->query($query); while (($row = $focus->db->fetchByAssoc($result)) != null) { $del_query = " update email_marketing_prospect_lists set email_marketing_prospect_lists.deleted=1, email_marketing_prospect_lists.date_modified=" . $focus->db->convert("'" . TimeDate::getInstance()->nowDb() . "'", 'datetime'); $del_query .= " WHERE email_marketing_prospect_lists.id='{$row['id']}'"; $focus->db->query($del_query); } $focus->db->query($query); } if ($bean_name == "Meeting") { $focus->retrieve($record); $user = new User(); $user->retrieve($linked_id); if (!empty($user->id)) { //make sure that record exists. we may have a contact on our hands. if ($focus->update_vcal) { vCal::cache_sugar_vcal($user); } } } if ($bean_name == "User" && $linked_field == 'eapm') { $eapm = new EAPM(); $eapm->mark_deleted($linked_id); } if (!empty($_REQUEST['return_url'])) { $_REQUEST['return_url'] = urldecode($_REQUEST['return_url']); } Log::debug("deleted relationship: bean: {$bean_name}, linked_field: {$linked_field}, linked_id:{$linked_id}"); if (empty($_REQUEST['refresh_page'])) { handleRedirect(); } exit;