| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Tests\Unit;
- use App\Modes\Upgrade;
- use Tests\TestCase;
- use Illuminate\Foundation\Testing\WithFaker;
- use Illuminate\Foundation\Testing\RefreshDatabase;
- class UpgradeTest extends TestCase
- {
- /**
- * 判断用户是否达到升级要求
- * @author lyh
- * @date 2019/4/18
- * @description
- */
- public function testRequiredLevel()
- {
- $response = Upgrade::requierdLevel($level = 7, $uid = 1);
- $this->assertTrue($response, sprintf('用户[%s]具备等级[%s]的升级要求', $uid, $level));
- }
- /**
- * 测试“判断是否达到升级条件”
- * @author lyh
- * @date 2019/4/18
- * @description
- */
- public function testCondition()
- {
- $response = Upgrade::condition(13);
- $this->assertArrayHasKey(0, $response);
- }
- }
|