Пример #1
0
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('exampleDir'));
     $this->Translation_File_Output = new Translation_File_Output_JavaScript(vfsStream::url('exampleDir/subdir1/subdir2/test.js'));
 }
Пример #2
0
 public function setUp()
 {
     $this->proxyClass = $this->buildAccessibleProxy('Tx_PtExtbase_SqlGenerator_SqlGenerator');
     $this->proxy = new $this->proxyClass();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('Foo'));
 }
Пример #3
0
 public function set_up()
 {
     $this->helper('directory');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir'));
     $this->_test_dir = vfsStreamWrapper::getRoot();
 }
Пример #4
0
 public function setUp()
 {
     TestRequire::vfs($this);
     $this->sa = new SourceAnalyzer();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('r'));
 }
Пример #5
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->object = new F4h_TicketConverter_Data_Writer_Xml();
     $this->queue = $this->getMock('F4h_TicketConverter_Model_Queue');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
Пример #6
0
 public function __construct()
 {
     $config = new stdClass();
     $config->paths = new stdClass();
     $config->paths->docroot = null;
     $config->site = new stdClass();
     $config->site->mode = 'prod';
     $config->site->cdnPrefix = 'a';
     $config->defaults = new stdClass();
     $config->defaults->cdnPrefix = '';
     $config->defaults->mediaVersion = 'a';
     parent::__construct(array('config' => $config));
     if (class_exists('vfsStream')) {
         vfsStreamWrapper::register();
         vfsStreamWrapper::setRoot(new vfsStreamDirectory('assetDir'));
         $config->paths->docroot = vfsStream::url('assetDir');
     }
     $this->docroot = $config->paths->docroot;
     $this->cacheDir = sprintf('%s/assets/cache', $this->docroot);
     $this->assets = $this->assetsRel = array('js' => array(), 'css' => array());
     $siteMode = $config->site->mode;
     if ($siteMode === 'prod') {
         $this->mode = self::minified;
     } else {
         $this->mode = self::combined;
     }
     $this->returnAsHeader = false;
 }
Пример #7
0
 /**
  * Setup
  *
  * @return void
  */
 public function setUp()
 {
     $this->unixStylePath = \TYPO3\FLOW3\Utility\Files::getUnixStylePath(__DIR__);
     $this->unixStylePathAndFilename = \TYPO3\FLOW3\Utility\Files::getUnixStylePath(__FILE__);
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('testDirectory'));
 }
 /**
  * @covers WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient::__construct
  * @covers WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient::getRoleEnvironmentData
  * @covers WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient::setEndpoint
  * @covers WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient::_ensureGoalStateRetrieved
  */
 public function testGetRoleEnvironmentData()
 {
     // Setup
     $rootDirectory = 'root';
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory($rootDirectory));
     $roleEnvironmentFileName = 'roleEnvironment';
     $roleEnvironmentFileContent = '<?xml version="1.0" encoding="utf-8"?>' . '<RoleEnvironment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema">' . '<Deployment id="id1" emulated="false" />' . '<CurrentInstance id="geophotoapp_IN_0" roleName="geophotoapp" faultDomain="0" updateDomain="0">' . '<ConfigurationSettings />' . '<LocalResources>' . '<LocalResource name="DiagnosticStore" path="somepath.DiagnosticStore" sizeInMB="4096" />' . '</LocalResources>' . '<Endpoints>' . '<Endpoint name="HttpIn" address="10.114.250.21" port="80" protocol="tcp" />' . '</Endpoints>' . '</CurrentInstance>' . '<Roles />' . '</RoleEnvironment>';
     $file = \vfsStream::newFile($roleEnvironmentFileName);
     $file->setContent($roleEnvironmentFileContent);
     \vfsStreamWrapper::getRoot()->addChild($file);
     $goalStateFileName = 'goalstate';
     $goalStateFileContent = '<?xml version="1.0" encoding="utf-8"?>' . '<GoalState xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema">' . '<Incarnation>1</Incarnation>' . '<ExpectedState>Started</ExpectedState>' . '<RoleEnvironmentPath>' . \vfsStream::url($rootDirectory . '/' . $roleEnvironmentFileName) . '</RoleEnvironmentPath>' . '<CurrentStateEndpoint>\\.\\pipe\\WindowsAzureRuntime.CurrentState</CurrentStateEndpoint>' . '<Deadline>9999-12-31T23:59:59.9999999</Deadline>' . '</GoalState>';
     $goalStateFileContent = dechex(strlen($goalStateFileContent)) . "\n" . $goalStateFileContent;
     $file = \vfsStream::newFile($goalStateFileName);
     $file->setContent($goalStateFileContent);
     \vfsStreamWrapper::getRoot()->addChild($file);
     // Test
     $fileInputChannel = new FileInputChannel();
     $goalStateDeserializer = new ChunkedGoalStateDeserializer();
     $roleEnvironmentDeserializer = new XmlRoleEnvironmentDataDeserializer();
     $currentStateClient = new Protocol1RuntimeCurrentStateClient(null, null);
     $runtimeGoalStateClient = new Protocol1RuntimeGoalStateClient($currentStateClient, $goalStateDeserializer, $roleEnvironmentDeserializer, $fileInputChannel);
     $runtimeGoalStateClient->setEndpoint(\vfsStream::url($rootDirectory . '/' . $goalStateFileName));
     // Test
     $this->assertNotEquals(null, $runtimeGoalStateClient->getRoleEnvironmentData());
 }
Пример #9
0
 public function setUp()
 {
     if (class_exists('vfsStream')) {
         vfsStreamWrapper::register();
         vfsStreamWrapper::setRoot(new vfsStreamDirectory('scriptsDir'));
         $this->scriptsDir = vfsStream::url('scriptsDir');
         mkdir($upgradeDir = "{$this->scriptsDir}/upgrade");
         mkdir("{$this->scriptsDir}/upgrade/readme");
         mkdir("{$this->scriptsDir}/upgrade/base");
         mkdir("{$this->scriptsDir}/upgrade/db");
         mkdir("{$this->scriptsDir}/upgrade/db/mysql");
         mkdir("{$this->scriptsDir}/upgrade/fs");
         $this->assertTrue(is_dir($upgradeDir));
     }
     $this->config = new stdClass();
     $this->config->paths = new stdClass();
     $this->config->paths->configs = $this->scriptsDir;
     $this->config->defaults = new stdClass();
     $this->config->defaults->currentCodeVersion = '1.1.1';
     $this->config->defaults->lastCodeVersion = '2.2.2';
     $this->config->site = new stdClass();
     $this->config->site->lastCodeVersion = '3.3.3';
     $params = array('config' => $this->config);
     $this->upgrade = new Upgrade($params);
 }
 function setUp()
 {
     _reset_wp();
     $this->fa = new ComicPressBackendFilesystemFactory();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
Пример #11
0
 function setUp()
 {
     _reset_wp();
     $this->cp = new ComicPress();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
Пример #12
0
 function setUp()
 {
     _reset_wp();
     $this->pf = new PostFixtures();
     $_POST = array();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
Пример #13
0
 /**
  * Sets up this testcase
  *
  * @return void
  */
 public function setUp()
 {
     if (!class_exists('\\vfsStreamWrapper')) {
         $this->markTestSkipped('File backend tests are not available with this phpunit version.');
     }
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('Foo'));
 }
Пример #14
0
 /**
  * @return void
  */
 public function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('Foo'));
     $this->repository = $this->getAccessibleMock('TYPO3\\FLOW3\\I18n\\Cldr\\CldrRepository', array('dummy'));
     $this->repository->_set('cldrBasePath', 'vfs://Foo/');
     $this->dummyLocale = new \TYPO3\FLOW3\I18n\Locale('en');
 }
Пример #15
0
 /**
  * Initialize virtual filesystem
  *
  * @param string $directoryName The root of the vfs
  * @return string The created vfs' root
  */
 protected function _getVirtualFsRoot($directoryName)
 {
     //prepare vfs
     //setup vfsSW, root directory
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory($directoryName));
     return vfsStream::url($directoryName);
 }
 /**
  * @author Robert Lemke <*****@*****.**>
  */
 public function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('testDirectory'));
     $this->cache = $this->getMock('F3\\FLOW3\\Cache\\Frontend\\VariableFrontend', array(), array(), '', FALSE);
     $this->strategy = new \F3\FLOW3\Monitor\ChangeDetectionStrategy\ModificationTimeStrategy();
     $this->strategy->injectCache($this->cache);
 }
Пример #17
0
 public function testCacheWSDLIsWorldWritable()
 {
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('tmp'));
     $SOAP = $this->getMock('SSRS_Soap_NTLM', array('setCacheWSDLPermission'), array('http://'));
     $SOAP->expects($this->once())->method('setCacheWSDLPermission')->with($this->equalTo(0666));
     $SOAP->setCachePath(vfsStream::url('tmp/file.wsdl'))->cacheWSDL('$fileContents');
 }
Пример #18
0
 function setUp()
 {
     TestRequire::vfs($this);
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('r'));
     $this->fsroot = vfsStreamWrapper::getRoot();
     $this->ua = new UnitAnalyzer();
 }
Пример #19
0
 protected function setUp()
 {
     TestRequire::vfs($this);
     $this->fa = new FrequencyAnalyzer();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('r'));
     $this->fs = vfsStreamWrapper::getRoot();
 }
Пример #20
0
 /**
  * Creates the mocked filesystem used in the tests
  */
 public function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('Foo'));
     $this->mockEnvironment = $this->getMock('TYPO3\\FLOW3\\Utility\\Environment', array(), array(), '', FALSE);
     $this->mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://Foo/'));
     $this->mockEnvironment->expects($this->any())->method('getMaximumPathLength')->will($this->returnValue(1024));
 }
 function setUp()
 {
     _reset_wp();
     $this->cpmh = new ComicPressMediaHandling();
     $this->default_filter = $this->cpmh->default_filter;
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
 protected function _initializeVfsStream()
 {
     @(include_once 'vfsStream/vfsStream.php');
     if (!class_exists('vfsStream', false)) {
         return false;
     }
     vfsStreamWrapper::register();
     return true;
 }
 /**
  * @author Karsten Dambekalns <*****@*****.**>
  * @author Robert Lemke <*****@*****.**>
  */
 public function setUp()
 {
     \vfsStreamWrapper::register();
     $mockPackage = $this->getMock('F3\\FLOW3\\Package\\Package', array(), array(), '', FALSE);
     $mockPackage->expects($this->any())->method('getClassesPath')->will($this->returnValue(\vfsStream::url('Virtual/Classes/')));
     $mockPackages = array('Virtual' => $mockPackage);
     $this->classLoader = new \F3\FLOW3\Resource\ClassLoader();
     $this->classLoader->setPackages($mockPackages);
 }
Пример #24
0
 /**
  * set up test environment
  */
 public function setUp()
 {
     if (extension_loaded('zip') === false) {
         $this->markTestSkipped('No ext/zip installed, skipping test.');
     }
     $this->markTestSkipped('Zip extension can not work with vfsStream urls.');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(vfsStream::newDirectory('root'));
 }
Пример #25
0
 public function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('Foo'));
     $intendedTemporaryDirectory = sys_get_temp_dir() . '/' . str_replace('\\', '_', __CLASS__);
     if (!file_exists($intendedTemporaryDirectory)) {
         mkdir($intendedTemporaryDirectory);
     }
     $this->temporaryDirectory = realpath($intendedTemporaryDirectory);
 }
 /**
  * Sets up this test case
  *
  * @author Robert Lemke <*****@*****.**>
  */
 protected function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('testDirectory'));
     $mockConfigurationManager = $this->getMock('F3\\FLOW3\\Configuration\\ConfigurationManager', array('getConfiguration', 'saveConfiguration'), array(), '', FALSE);
     $this->packageManager = new \F3\FLOW3\Package\PackageManager();
     $this->packageManager->injectObjectFactory($this->objectFactory);
     $this->packageManager->injectConfigurationManager($mockConfigurationManager);
     $this->packageManager->initialize();
 }
 /**
  */
 public function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('Foo'));
     $temporaryDirectoryBase = realpath(sys_get_temp_dir()) . '/' . str_replace('\\', '_', __CLASS__);
     $this->temporaryDirectoryPath = \TYPO3\FLOW3\Utility\Files::concatenatePaths(array($temporaryDirectoryBase, 'FLOW3PrivateResourcesPublishingAspectTestTemporaryDirectory'));
     \TYPO3\FLOW3\Utility\Files::createDirectoryRecursively($this->temporaryDirectoryPath);
     $this->publishPath = \TYPO3\FLOW3\Utility\Files::concatenatePaths(array($temporaryDirectoryBase, 'FLOW3PrivateResourcesPublishingAspectTestPublishDirectory'));
     \TYPO3\FLOW3\Utility\Files::createDirectoryRecursively($this->publishPath);
 }
 public static function newFile($contents, $fileName = null, $root = null)
 {
     $root = is_null($root) ? 'root' : $root;
     $fileName = is_null($fileName) ? 'test.txt' : $fileName;
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory($root));
     $file = \vfsStream::newFile($fileName);
     $file->setContent($contents);
     \vfsStreamWrapper::getRoot()->addChild($file);
     $virtualPath = \vfsStream::url($root . '/' . $fileName);
     return $virtualPath;
 }
Пример #29
0
 public function setUp()
 {
     if (class_exists('vfsStream', false) === false) {
         $this->markTestSkipped('vfsStream not installed.');
     }
     vfsStreamWrapper::register();
     $root = vfsStream::newDirectory('home/test');
     $root->getChild('test')->addChild(vfsStream::newFile('succeed.php'));
     $root->getChild('test')->addChild(vfsStream::newFile('succeed2.php'));
     $root->getChild('test')->addChild(vfsStream::newFile('succeed3.php'));
     vfsStreamWrapper::setRoot($root);
 }
 public function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('testDirectory'));
     $this->objectFactory = $this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface', array(), array(), '', FALSE);
     $this->packageManager = $this->getMock('F3\\FLOW3\\Package\\PackageManagerInterface', array(), array(), '', FALSE);
     $this->resourceManager = $this->getMock('F3\\FLOW3\\Resource\\ResourceManager', array(), array(), '', FALSE);
     $this->objectManager = $this->getMock('F3\\FLOW3\\Object\\ObjectManagerInterface', array(), array(), '', FALSE);
     $this->view = $this->getMock('F3\\FLOW3\\MVC\\View\\NotFoundView', array('getTemplatePathAndFilename'), array($this->objectFactory, $this->packageManager, $this->resourceManager, $this->objectManager));
     $this->controllerContext = $this->getMock('F3\\FLOW3\\MVC\\Controller\\Context', array('getRequest'), array(), '', FALSE);
     $this->view->setControllerContext($this->controllerContext);
 }