'on']; $GLOBALS['graph_markup_user'] = ['realtime_mode' => '1']; $GLOBALS['graph_markup_theme'] = 'modern'; ob_start(); graph_drilldown_icons(7); $html = ob_get_clean(); $document = new \DOMDocument(); $document->loadHTML($html); $xpath = new \DOMXPath($document); $menu = $xpath->query('//span[contains(@class, "graphDrillDownMenu")]')->item(0); if ($menu === null || $menu->getAttribute('role') !== 'button' || $menu->getAttribute('tabindex') !== '0' || $menu->getAttribute('aria-label') !== 'Graph Actions' || $menu->getAttribute('aria-expanded') !== 'false' || $menu->hasAttribute('title')) { throw new \RuntimeException('Graph menu accessibility or tooltip contract failed'); } if ($GLOBALS['graph_markup_hook']['local_graph_id'] !== 7) { throw new \RuntimeException('Graph plugin hook identity was lost'); } // Second render exercising the non-default realtime mode (window.open branch). $GLOBALS['graph_markup_user'] = ['realtime_mode' => '2']; ob_start(); graph_drilldown_icons(7); ob_get_clean(); print json_encode(['passed' => 2], JSON_THROW_ON_ERROR) . "\n";