public function loadWpComponent($component)
{
if (!is_string($component)) {
throw new \InvalidArgumentException('Component name must be a string');
}
$supportedComponents = $this->supportedWpComponents();
if (!isset($supportedComponents[$component])) {
throw new \InvalidArgumentException("Component '{$component}' is not supported.");
}
$componentPath = $this->config['wpRootFolder'] . DIRECTORY_SEPARATOR . $supportedComponents[$component];
if (!file_exists($componentPath)) {
throw new \InvalidArgumentException("Component path [{$componentPath}] does not exist.");
}
include_once $componentPath;
codecept_debug("Included the [{$component}] component including file [{$componentPath}]");
}