VersionPress\Tests\End2End\Utils\End2EndTestCase::setUpBeforeClass PHP Method

setUpBeforeClass() public static method

public static setUpBeforeClass ( )
    public static function setUpBeforeClass()
    {
        parent::setUpBeforeClass();
        self::setUpSite(TestRunnerOptions::getInstance()->forceSetup == "before-class");
    }

Usage Example

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     if (self::$testConfig->testSite->installationType !== 'standard') {
         throw new \PHPUnit_Framework_SkippedTestSuiteError();
     }
     $testDataPath = __DIR__ . '/../test-data';
     self::$pluginInfo = ['zipfile' => realpath($testDataPath . '/hello-dolly.1.6.zip'), 'url-fragment' => 'hello-dolly', 'name' => 'Hello Dolly', 'affected-path' => 'hello-dolly/*'];
     self::$secondPluginInfo = ['zipfile' => realpath($testDataPath . '/hello-dolly.1.6-2.zip'), 'url-fragment' => 'hello-dolly-2', 'name' => 'Hello Dolly 2', 'affected-path' => 'hello-dolly-2/*'];
     self::$worker->setPluginInfo(self::$pluginInfo);
     self::$worker->setSecondPluginInfo(self::$secondPluginInfo);
     // possibly delete single-file Hello dolly
     try {
         self::$wpAutomation->runWpCliCommand('plugin', 'uninstall', ['hello']);
     } catch (\Exception $e) {
     }
     // possibly delete our testing plugins
     try {
         self::$wpAutomation->runWpCliCommand('plugin', 'uninstall', ['hello-dolly']);
         self::$wpAutomation->runWpCliCommand('plugin', 'uninstall', ['hello-dolly-2']);
     } catch (\Exception $e) {
     }
     $process = new Process("git add -A && git commit -m " . ProcessUtils::escapeshellarg("Plugin setup"), self::$testConfig->testSite->path);
     $process->run();
 }
All Usage Examples Of VersionPress\Tests\End2End\Utils\End2EndTestCase::setUpBeforeClass