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

getCurrentTheme() public method

Returns stylesheet of current theme.
public getCurrentTheme ( ) : string
return string
    public function getCurrentTheme()
    {
        $status = $this->runWpCliCommand('theme', 'status');
        $status = preg_replace("/\\[[^m]*m/", '', $status);
        // remove formatting
        preg_match_all("/^[^A-Z]*([A-Z]+)[^a-z]+([a-z\\-]+).*\$/m", $status, $matches);
        foreach ($matches[1] as $lineNumber => $status) {
            if (Strings::contains($status, 'A')) {
                return $matches[2][$lineNumber];
            }
        }
        return null;
        // this should never happen, there is always some activate theme
    }