<?php

declare(strict_types=1);

$ctx = require __DIR__ . '/bootstrap.php';
$wp = $ctx['wp'];
assert($wp instanceof FecaMailshots\WordPress\FixtureWordPressFacade);

$wp->dispatch('admin_menu');

ob_start();
$wp->dispatch('fixture_submenu:feca-mailshot-data-sources');
$out = trim((string) ob_get_clean());

if (strpos($out, 'Mailshot Data Sources') === false) {
    fwrite(STDERR, "Fixture smoke failed: expected admin page output\n" . $out . "\n");
    exit(1);
}

echo "Fixture smoke passed\n";
