コード例 #1
0
ファイル: MainTest.php プロジェクト: samsonos/php_fs_local
 /** 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
ファイル: MainTest.php プロジェクト: samsonphp/upload
 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
ファイル: RouterTest.php プロジェクト: samsonos/php_router
 /** 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
ファイル: MainTest.php プロジェクト: samsonos/php_upload
 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
ファイル: DeployTest.php プロジェクト: samsonphp/deploy
 /** 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
ファイル: Deploy.php プロジェクト: samsonphp/deploy
 /**
  * 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
ファイル: MainTest.php プロジェクト: samsonos/php_fs
 /** 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
ファイル: Deploy.php プロジェクト: samsonos/php_deploy
 /**
  * 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);
 }