Exemple #1
0
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Magento
 * @package     performance_tests
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
$testsBaseDir = realpath(__DIR__ . '/..');
$magentoBaseDir = realpath($testsBaseDir . '/../../../');
require_once "{$magentoBaseDir}/app/bootstrap.php";
Magento_Autoload::getInstance()->addIncludePath("{$testsBaseDir}/framework");
$configFile = "{$testsBaseDir}/config.php";
$configFile = file_exists($configFile) ? $configFile : "{$configFile}.dist";
$configData = (require $configFile);
$config = new Magento_Config($configData, $testsBaseDir);
$installOptions = $config->getInstallOptions();
if ($installOptions) {
    // Populate install options with global options
    $baseUrl = 'http://' . $config->getApplicationUrlHost() . $config->getApplicationUrlPath();
    $installOptions = array_merge($installOptions, array('url' => $baseUrl, 'secure_base_url' => $baseUrl));
    $adminOptions = $config->getAdminOptions();
    foreach ($adminOptions as $key => $val) {
        $installOptions['admin_' . $key] = $val;
    }
    // Install application
    $installer = new Magento_Installer($magentoBaseDir . '/dev/shell/install.php', new Magento_Shell(true));
    echo 'Uninstalling application' . PHP_EOL;
    $installer->uninstall();
    echo "Installing application at '{$baseUrl}'" . PHP_EOL;
    $installer->install($installOptions, $config->getFixtureFiles());
Exemple #2
0
 public function testGetJMeterPath()
 {
     $oldEnv = getenv("jmeter_jar_file");
     try {
         $baseDir = __DIR__ . '/_files';
         $expectedPath = '/path/to/custom/JMeterFile.jar';
         $configData = $this->_sampleConfigData;
         $configData['scenario']['jmeter_jar_file'] = $expectedPath;
         $object = new Magento_Config($configData, $baseDir);
         $this->assertEquals($expectedPath, $object->getJMeterPath());
         $configData['scenario']['jmeter_jar_file'] = '';
         putenv("jmeter_jar_file={$expectedPath}");
         $object = new Magento_Config($configData, $baseDir);
         $this->assertEquals($expectedPath, $object->getJMeterPath());
         putenv('jmeter_jar_file=');
         $object = new Magento_Config($configData, $baseDir);
         $this->assertNotEmpty($object->getJMeterPath());
     } catch (Exception $e) {
         putenv("jmeter_jar_file={$oldEnv}");
         throw $e;
     }
     putenv("jmeter_jar_file={$oldEnv}");
 }