Skip to content

Instantly share code, notes, and snippets.

@hugopeixoto
Created July 11, 2024 11:38
Show Gist options
  • Save hugopeixoto/2712be8b48dc36ade2123700c5c7a58a to your computer and use it in GitHub Desktop.
Save hugopeixoto/2712be8b48dc36ade2123700c5c7a58a to your computer and use it in GitHub Desktop.
<?php
require_once("tests/TestHelper.php");
use Symfony\Component\DomCrawler\Crawler;
test('pages/home/index', function () {
global $_SESSION;
$_SESSION = [];
ob_start();
require("src/pages/home/index.php");
$contents = ob_get_contents();
ob_end_clean();
$crawler = new Crawler($contents);
expect($crawler->filter('main > .index-dashboard .scoreboard-widget')->count())->toBe(15);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment