Beispiel #1
0
 public function setUp()
 {
     parent::setUp();
     $sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
     $stmt = self::$DI['app']['phraseanet.appbox']->get_connection()->prepare($sql);
     $stmt->execute();
     $stmt->closeCursor();
     $this->type = 'Apitest';
     $api = Bridge_Api::create(self::$DI['app'], $this->type);
     $this->id = $api->get_id();
     $this->object = new Bridge_Api(self::$DI['app'], $api->get_id());
 }
 public function setUp()
 {
     parent::setUp();
     try {
         self::$api = \Bridge_Api::get_by_api_name(self::$DI['app'], 'apitest');
     } catch (\Bridge_Exception_ApiNotFound $e) {
         self::$api = \Bridge_Api::create(self::$DI['app'], 'apitest');
     }
     try {
         self::$account = \Bridge_Account::load_account_from_distant_id(self::$DI['app'], self::$api, self::$DI['user'], 'kirikoo');
     } catch (\Bridge_Exception_AccountNotFound $e) {
         self::$account = \Bridge_Account::create(self::$DI['app'], self::$api, self::$DI['user'], 'kirikoo', 'coucou');
     }
 }
Beispiel #3
0
 public function bootTestCase()
 {
     $application = self::$DI['app'];
     try {
         self::$api = Bridge_Api::get_by_api_name($application, 'apitest');
     } catch (Bridge_Exception_ApiNotFound $e) {
         self::$api = Bridge_Api::create($application, 'apitest');
     }
     try {
         self::$account = Bridge_Account::load_account_from_distant_id($application, self::$api, self::$DI['user'], 'kirikoo');
     } catch (Bridge_Exception_AccountNotFound $e) {
         self::$account = Bridge_Account::create($application, self::$api, self::$DI['user'], 'kirikoo', 'coucou');
     }
 }
Beispiel #4
0
 public function bootTestCase()
 {
     self::$DI['user'];
     if (!self::$object) {
         $sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
         $stmt = self::$DI['app']['phraseanet.appbox']->get_connection()->prepare($sql);
         $stmt->execute();
         $stmt->closeCursor();
         self::$api = Bridge_Api::create(self::$DI['app'], 'Apitest');
         self::$dist_id = 'EZ1565loPP';
         self::$named = 'Fête à pinpins';
         $account = Bridge_Account::create(self::$DI['app'], self::$api, self::$DI['user'], self::$dist_id, self::$named);
         self::$id = $account->get_id();
         self::$object = new Bridge_Account(self::$DI['app'], self::$api, self::$id);
     }
 }
 public function setUp()
 {
     parent::setUp();
     try {
         $sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
         $stmt = self::$DI['app']['phraseanet.appbox']->get_connection()->prepare($sql);
         $stmt->execute();
         $stmt->closeCursor();
         $this->api = Bridge_Api::create(self::$DI['app'], 'Apitest');
         $this->dist_id = 'EZ1565loPP';
         $this->named = 'Fête à pinpins';
         $this->account = Bridge_Account::create(self::$DI['app'], $this->api, self::$DI['user'], $this->dist_id, $this->named);
         $this->object = new Bridge_AccountSettings(self::$DI['app']['phraseanet.appbox'], $this->account);
     } catch (Exception $e) {
         $this->fail($e->getMessage());
     }
 }
Beispiel #6
0
 public function setUp()
 {
     parent::setUp();
     $sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
     $stmt = self::$DI['app']->getApplicationBox()->get_connection()->prepare($sql);
     $stmt->execute();
     $stmt->closeCursor();
     $this->api = Bridge_Api::create(self::$DI['app'], 'Apitest');
     $this->dist_id = 'EZ1565loPP';
     $this->named = 'Fête à pinpins';
     $this->account = Bridge_Account::create(self::$DI['app'], $this->api, self::$DI['user'], $this->dist_id, $this->named);
     $this->title = 'GOGACKO';
     $this->status = 'Processing';
     $element = Bridge_Element::create(self::$DI['app'], $this->account, self::$DI['record_1'], $this->title, $this->status, $this->account->get_api()->get_connector()->get_default_element_type());
     $this->id = $element->get_id();
     $this->object = new Bridge_Element(self::$DI['app'], $this->account, $this->id);
 }
Beispiel #7
0
 public function setUp()
 {
     parent::setUp();
     $this->auth = $this->getMock("Bridge_Api_Auth_Interface");
     $this->bridgeApi = $this->getMock('Bridge_Api_Abstract', ["is_configured", "initialize_transport", "set_auth_params", "set_transport_authentication_params"], [self::$DI['app']['url_generator'], self::$DI['app']['conf'], $this->auth, self::$DI['app']['translator']]);
     if (!self::$api) {
         $application = $this->getApplication();
         try {
             self::$api = Bridge_Api::get_by_api_name($application, 'apitest');
         } catch (Bridge_Exception_ApiNotFound $e) {
             self::$api = Bridge_Api::create($application, 'apitest');
         }
         try {
             self::$account = Bridge_Account::load_account_from_distant_id($application, self::$api, self::$DI['user'], 'kirikoo');
         } catch (Bridge_Exception_AccountNotFound $e) {
             self::$account = Bridge_Account::create($application, self::$api, self::$DI['user'], 'kirikoo', 'coucou');
         }
     }
 }