<?php

namespace Kylin\Wechat\Tests\Feature;

use Kylin\Wechat\Tests\TestCase;
use Kylin\Wechat\Facades\Wechat;
use EasyWeChat\OfficialAccount\Application as OfficialAccountApplication;
use EasyWeChat\MiniProgram\Application as MiniProgramApplication;

class WechatFacadeTest extends TestCase
{
    /**
     * Test that we can use the Wechat facade to get an official account instance.
     */
    public function testCanUseFacadeToGetOfficialAccount()
    {
        $officialAccount = Wechat::officialAccount();
        $this->assertInstanceOf(OfficialAccountApplication::class, $officialAccount);
    }

    /**
     * Test that we can use the Wechat facade to get a mini program instance.
     */
    public function testCanUseFacadeToGetMiniProgram()
    {
        $miniProgram = Wechat::miniProgram();
        $this->assertInstanceOf(MiniProgramApplication::class, $miniProgram);
    }

    /**
     * Test that the facade driver method works correctly.
     */
    public function testFacadeDriverMethodWorksCorrectly()
    {
        $result = Wechat::driver('official_account');
        $this->assertInstanceOf(get_class(Wechat::getFacadeRoot()), $result);
    }
}