| Total Complexity | 6 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class SalesforceTest extends BuildTask |
||
| 11 | { |
||
| 12 | protected $title = 'Test Sales Force API'; |
||
| 13 | |||
| 14 | protected $description = 'Test Sales Cloud'; |
||
| 15 | |||
| 16 | protected $emailStub = '@test.best.co.com.org.net'; |
||
| 17 | |||
| 18 | protected $email = ''; |
||
| 19 | |||
| 20 | public function run($request) |
||
| 21 | { |
||
| 22 | MySalesforceContactApi::set_debug(true); |
||
| 23 | $this->setEmail(); |
||
| 24 | $this->findContact(); |
||
| 25 | $this->createContact(); |
||
| 26 | $this->updateContact(); |
||
| 27 | $this->setEmail(); |
||
| 28 | $this->createBadContact(); |
||
|
|
|||
| 29 | } |
||
| 30 | |||
| 31 | protected function createContact() |
||
| 39 | ] |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | |||
| 43 | protected function updateContact() |
||
| 44 | { |
||
| 45 | MySalesforceContactApi::update_contact( |
||
| 46 | [ |
||
| 47 | 'FirstName' => 'Joan', |
||
| 48 | 'LastName' => 'Smith', |
||
| 49 | 'Phone' => '(510) 555-5555', |
||
| 50 | 'Email' => $this->email, |
||
| 51 | ] |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 55 | protected function findContact() |
||
| 56 | { |
||
| 57 | $contact = MySalesforceContactApi::retrieve_contact($this->email); |
||
| 58 | } |
||
| 59 | |||
| 60 | |||
| 61 | protected function createBadontact() |
||
| 69 | ] |
||
| 70 | ); |
||
| 71 | } |
||
| 72 | |||
| 73 | |||
| 74 | protected function setEmail() |
||
| 77 | |||
| 78 | } |
||
| 81 |