the browser-facing portion of osu!
1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6declare(strict_types=1);
7
8namespace Tests\Transformers;
9
10use App\Models\Forum\Topic;
11use Tests\TestCase;
12
13class TopicTransformerTest extends TestCase
14{
15 public function testPollDoesNotExist(): void
16 {
17 $topic = Topic::factory()->create();
18 $topicJson = json_item($topic, 'Forum\Topic');
19
20 $this->assertNull($topicJson['poll']);
21 }
22
23 public function testPollExists(): void
24 {
25 $topic = Topic::factory()->poll()->withPost()->create();
26 $topicJson = json_item($topic, 'Forum\Topic');
27
28 $this->assertIsArray($topicJson['poll']);
29 }
30}