Пример #1
0
 /** Tests init */
 public function setUp()
 {
     // Get instance using services factory as error will signal other way
     $this->fileService = \samson\core\Service::getInstance('samson\\fs\\LocalFileService');
     // Disable default error output
     \samson\core\Error::$OUTPUT = false;
 }
Пример #2
0
 public function setUp()
 {
     \samson\core\Error::$OUTPUT = false;
     $this->instance = \samson\core\Service::getInstance('\\samsonphp\\upload\\UploadController');
     $this->instance->fs = \samson\core\Service::getInstance('\\samsonphp\\fs\\FileService');
     $this->instance->fs->loadExternalService('\\samsonphp\\fs\\LocalFileService');
 }
Пример #3
0
 /** Tests init */
 public function setUp()
 {
     // Get instance using services factory as error will signal other way
     $this->router = \samson\core\Service::getInstance('samson\\router\\Router');
     // Initialize service
     $this->router->init(array());
 }
Пример #4
0
 /**
  *
  */
 public function setUp()
 {
     \samson\core\Error::$OUTPUT = false;
     // Create S3 mock
     $this->request = $this->getMockBuilder('\\samsonphp\\google\\translate\\Request')->disableOriginalConstructor()->getMock();
     $this->instance = \samson\core\Service::getInstance('\\samsonphp\\google\\translate\\Translate');
 }
Пример #5
0
 /**
  * Test initialization
  */
 public function setUp()
 {
     \samson\core\Error::$OUTPUT = false;
     // Create Request mock
     $this->request = $this->getMockBuilder('\\samson\\instagram\\Request')->disableOriginalConstructor()->getMock();
     $this->instance = \samson\core\Service::getInstance('\\samson\\instagram\\Instagram');
     $this->instance->init();
     $this->instance->request =& $this->request;
 }
Пример #6
0
 public function setUp()
 {
     \samson\core\Error::$OUTPUT = false;
     // Create Server Handler mock
     $this->serverHandler = $this->getMockBuilder('\\samson\\upload\\ServerHandler')->disableOriginalConstructor()->getMock();
     $this->instance = \samson\core\Service::getInstance('\\samson\\upload\\UploadController');
     $this->instance->fs = \samson\core\Service::getInstance('\\samsonphp\\fs\\FileService');
     $this->instance->fs->loadExternalService('\\samsonphp\\fs\\LocalFileService');
     $this->instance->serverHandler =& $this->serverHandler;
 }
Пример #7
0
 /** Tests init */
 public function setUp()
 {
     Error::$OUTPUT = false;
     $this->deploy = Service::getInstance('\\samsonphp\\deploy\\Deploy');
     $this->deploy->remote = $this->getMockBuilder('\\samsonphp\\deploy\\Remote')->disableOriginalConstructor()->getMock();
     $this->deploy->wwwroot = 'test';
     $this->deploy->host = 'test';
     $this->deploy->username = '******';
     $this->deploy->password = '******';
     $this->deploy->sourceroot = sys_get_temp_dir() . '/';
 }
Пример #8
0
 /**
  * Initialize module
  * @param array $params
  * @return bool
  */
 public function init(array $params = array())
 {
     // Check configuration
     if (!isset($this->sourceroot[0])) {
         return $this->error('Local project folder[' . $this->sourceroot . '] is not specified');
     }
     // Check configuration
     if (!isset($this->wwwroot[0])) {
         return $this->error('Remote project folder[' . $this->wwwroot . '] is not specified');
     }
     return parent::init($params);
 }
Пример #9
0
 /** Tests init */
 public function setUp()
 {
     // Disable default error output
     \samson\core\Error::$OUTPUT = false;
     // Get instance using services factory as error will signal other way
     $this->fileService = \samson\core\Service::getInstance('samson\\fs\\FileService');
     // Init with unreal file service
     $this->fileService->fileServiceClassName = 'samson\\fs\\test';
     $this->fileService->prepare();
     $this->fileService->init();
     // Normal init
     $this->fileService->fileServiceClassName = 'samson\\fs\\LocalFileService';
     $this->fileService->prepare();
     $this->fileService->init();
 }
Пример #10
0
 /**
  * Initialize module
  * @param array $params
  * @return bool
  */
 public function init(array $params = array())
 {
     // Check configuration
     if (!isset($this->sourceroot[0])) {
         $this->log('Local folder[##] is not specified', $this->sourceroot);
         return false;
     }
     // Check configuration
     if (!isset($this->sourceroot[0])) {
         $this->log('Remote folder[##] is not specified', $this->wwwroot);
         return false;
     }
     return parent::init($params);
 }