public function haveMenuInDatabase($slug, $location, array $overrides = [])
{
if (!is_string($slug)) {
throw new \InvalidArgumentException('Menu slug must be a string.');
}
if (!is_string($location)) {
throw new \InvalidArgumentException('Menu location must be a string.');
}
if (empty($this->stylesheet)) {
throw new \RuntimeException('Stylesheet must be set to add menus, use `useTheme` first.');
}
$title = empty($overrides['title']) ? ucwords($slug, ' -_') : $overrides['title'];
$menuIds = $this->haveTermInDatabase($title, 'nav_menu', ['slug' => $slug]);
$menuTermTaxonomyIds = reset($menuIds);
// set theme options to use the `primary` location
$this->haveOptionInDatabase('theme_mods_' . $this->stylesheet, ['nav_menu_locations' => [$location => $menuTermTaxonomyIds]]);
$this->menus[$this->stylesheet][$slug] = $menuIds;
$this->menuItems[$this->stylesheet][$slug] = [];
return $menuIds;
}