if ($vendor->check_email($_POST['email'])) { $isAvailable = true; } break; case 'delete_item': if ($item->delete($_POST['object_id'])) { $isAvailable = true; } break; case 'delete_user': if ($user->delete($_POST['object_id'])) { $isAvailable = true; } break; case 'delete_vendor': if ($vendor->delete($_POST['object_id'])) { $isAvailable = true; } break; case 'toog_item': if ($_POST['status'] == 1) { $status = 0; } else { $status = 1; } if ($item->toogle($_POST['object_id'], $status)) { $isAvailable = true; } break; } echo json_encode(array('valid' => $isAvailable));
/** * test deleting a Vendor that does not exist * * @expectedException PDOException **/ public function testDeleteInvalidVendor() { // create a Vendor and try to delete it without actually inserting it $vendor = new Vendor(null, $this->VALID_contactName, $this->VALID_vendorEmail, $this->VALID_vendorName, $this->VALID_vendorPhoneNumber); $vendor->delete($this->getPDO()); }