| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace Tests\Unit;
- use App\Models\EgameItem;
- use PHPUnit\Framework\TestCase;
- class EgameItemTest extends TestCase
- {
- public function test_ingress_labels_match_admin_ui(): void
- {
- $this->assertSame('电脑网页', EgameItem::ingressName('1'));
- $this->assertSame('手机网页', EgameItem::ingressName('2'));
- $this->assertSame('电脑/手机网页', EgameItem::ingressName('3'));
- $this->assertSame('', EgameItem::ingressName('9'));
- }
- public function test_network_labels_match_admin_ui(): void
- {
- $this->assertSame('大陆', EgameItem::networkName('mainland'));
- $this->assertSame('香港', EgameItem::networkName('hk'));
- $this->assertSame('韩国', EgameItem::networkName('kr'));
- $this->assertSame('日本', EgameItem::networkName('jp'));
- $this->assertSame('', EgameItem::networkName(''));
- }
- public function test_option_list_preserves_codes(): void
- {
- $options = EgameItem::optionList(EgameItem::NETWORK_LABELS);
- $this->assertSame('mainland', $options[0]['value']);
- $this->assertSame('大陆', $options[0]['label']);
- $this->assertCount(4, $options);
- }
- }
|