public function testGetting() { $this->assertTrue(Locations::get(false)); $this->assertTrue(is_array(Locations::get())); $this->assertNull(Locations::get('test2')); $this->assertTrue(is_array(Locations::get('test', array('config' => true)))); $this->assertNull(Locations::get('test', array('autoCreate' => false))); $this->assertTrue(Locations::get('test')); }
protected function _init() { parent::_init(); $this->_timestamp = time(); $this->_tmp_dir = Libraries::path('li3_filemanager\\', array('dirs' => true)); $this->_tmp_dir .= "/resources/tmp/{$this->_timestamp}_test"; Locations::add('test', array('adapter' => 'FileSystem', 'url' => 'http://example.com/tmp', 'location' => $this->_tmp_dir)); $this->_location = Locations::get('test'); }
public function skip() { $this->skipIf(!in_array('test-ftp', Locations::get()), 'You don\'t have <code>test-ftp</code> location setup!'); $this->skipIf(!is_object($this->_location = Locations::get('test-ftp')), 'Adapter not initialized!'); }