* @category Class * @license https://www.gnu.org/licenses/lgpl-3.0.en.html GNU Lesser General Public License * @link www.splendidbear.org * @since 2026. 04. 21. */ #[TestDox('Game Controller')] class GameControllerTest extends WebTestCase { private KernelBrowser $client; protected function setUp(): void { parent::setUp(); $this->client = static::createClient(); } #[Test] #[TestDox('Homepage loads successfully with navigation links')] public function homepageLoadsSuccessfully(): void { $crawler = $this->client->request('GET', '/'); self::assertResponseStatusCodeSame(Response::HTTP_OK); self::assertSelectorExists('h1'); self::assertSelectorExists('a[href="/play"]'); } #[Test] #[TestDox('Play page loads successfully')] public function playPageLoadsSuccessfully(): void { $crawler = $this->client->request('GET', '/play'); self::assertResponseStatusCodeSame(Response::HTTP_OK); self::assertResponseHasHeader('Content-Type'); } #[Test] #[TestDox('Play page with game association loads successfully')] public function playPageWithGameAssocLoadsSuccessfully(): void { $crawler = $this->client->request('GET', '/play/testgame123'); self::assertResponseStatusCodeSame(Response::HTTP_OK); self::assertResponseHasHeader('Content-Type'); } #[Test] #[TestDox('Privacy policy page loads successfully')] public function privacyPolicyPageLoadsSuccessfully(): void { $crawler = $this->client->request('GET', '/privacy-policy'); self::assertResponseStatusCodeSame(Response::HTTP_OK); self::assertSelectorExists('h1'); } #[Test] #[TestDox('Terms of service page loads successfully')] public function termsOfServicePageLoadsSuccessfully(): void { $crawler = $this->client->request('GET', '/terms-of-service'); self::assertResponseStatusCodeSame(Response::HTTP_OK); self::assertSelectorExists('h1'); } #[Test] #[TestDox('Contact page loads successfully with form')] public function contactPageLoadsSuccessfully(): void { $crawler = $this->client->request('GET', '/contact'); self::assertResponseStatusCodeSame(Response::HTTP_OK); self::assertSelectorExists('form'); self::assertSelectorExists('button[type="submit"]'); } #[Test] #[TestDox('Landing page loads successfully with play link')] public function landingPageLoadsSuccessfully(): void { $crawler = $this->client->request('GET', '/landing-page'); self::assertResponseStatusCodeSame(Response::HTTP_OK); self::assertSelectorExists('h1'); self::assertSelectorExists('a[href="/play"]'); } #[Test] #[TestDox('Rules page loads successfully')] public function rulesPageLoadsSuccessfully(): void { $crawler = $this->client->request('GET', '/rules'); self::assertResponseStatusCodeSame(Response::HTTP_OK); self::assertSelectorExists('h1'); } #[Test] #[TestDox('Homepage contains navigation links to play, login, and register')] public function homepageContainsNavigationLinks(): void { $crawler = $this->client->request('GET', '/'); self::assertResponseIsSuccessful(); self::assertSelectorExists('a[href="/play"]'); self::assertSelectorExists('a[href="/login"]'); self::assertSelectorExists('a[href="/register"]'); } #[Test] #[TestDox('Play page has correct meta tags for SEO and social sharing')] public function playPageHasCorrectMetaTags(): void { $this->client->request('GET', '/play'); self::assertResponseIsSuccessful(); self::assertSelectorExists('meta[name="description"]'); self::assertSelectorExists('meta[property="og:title"]'); } }