VersionPress\Tests\Automation\WpAutomation::setUpSite PHP Method

setUpSite() public method

Database as specified in the config file must exist and be accessible. It takes optional parameter entityCounts, that is an array containing an amount of generated entities - {@see \populateSite}.
public setUpSite ( array $entityCounts = [] )
$entityCounts array
    public function setUpSite($entityCounts = [])
    {
        FileSystem::removeContent($this->siteConfig->path);
        if ($this->siteConfig->installationType === 'standard') {
            $this->prepareStandardWpInstallation();
        } elseif ($this->siteConfig->installationType === 'composer') {
            $this->createPedestalBasedSite();
        }
        $this->clearDatabase();
        $this->installWordPress();
        if (!$this->siteConfig->wpAutoupdate) {
            $this->disableAutoUpdate();
        }
        $this->populateSite($entityCounts);
    }

Usage Example

 /**
  * Check if site is set up and VersionPress fully activated, and if not, do so. The $force
  * parametr may force this.
  *
  * @param bool $force Force all the automation actions to be taken regardless of the site state
  */
 private static function setUpSite($force)
 {
     if ($force || !self::$wpAutomation->isSiteSetUp()) {
         self::$wpAutomation->setUpSite();
     }
     if ($force || !self::$wpAutomation->isVersionPressInitialized()) {
         self::$wpAutomation->copyVersionPressFiles();
         self::$wpAutomation->initializeVersionPress();
     }
 }
All Usage Examples Of VersionPress\Tests\Automation\WpAutomation::setUpSite