Esempio n. 1
0
 public function testSet_status()
 {
     $update1 = $this->object->get_updated_on();
     $new_status = '&é"\'(-è_çà)';
     $this->object->set_status($new_status);
     $this->assertEquals($new_status, $this->object->get_status());
     sleep(1);
     $new_status = '&é"0687345àç_)à)';
     $this->object->set_status($new_status);
     $this->assertEquals($new_status, $this->object->get_status());
     $update2 = $this->object->get_updated_on();
     $this->assertTrue($update2 > $update1);
 }
Esempio n. 2
0
 /**
  * @param Bridge_Element $element
  *
  * @return BridgeJob
  */
 private function upload_element(\Bridge_Element $element)
 {
     $account = $element->get_account();
     $element->set_status(\Bridge_Element::STATUS_PROCESSING);
     $dist_id = null;
     try {
         $dist_id = $account->get_api()->upload($element->get_record(), $element->get_datas());
         $element->set_uploaded_on(new \DateTime());
     } catch (\Exception $e) {
         $this->log('debug', 'Error while uploading : ' . $e->getMessage());
         $element->set_status(\Bridge_Element::STATUS_ERROR);
     }
     $element->set_dist_id($dist_id);
     return $this;
 }