webman/tests/TestPhone.php

33 lines
780 B
PHP

<?php
namespace Tests;
use App\Utils\API\Rocketgo;
use PHPUnit\Framework\TestCase;
/**
* 用户手机号测试类
*/
class TestPhone extends TestCase
{
/**
* @dataProvider additionPhone
*/
public function testPhone($phone, $expected)
{
Rocketgo::test_login();
$res = Rocketgo::get_ws_status($phone);
$this->assertEquals($expected, $res);
}
public function additionPhone()
{
$phone_array = [];
$phone = 8801837967987;
$phone_array["在列表ws号"] = [$phone, 0];
$phone_array["不在列表ws号"] = [8801837967986, 1];
for ($i = 1; $i <= 20; $i++) {
$phone_array["查询第 $i 次在列表ws号 $phone"] = [$phone, 0];
}
return $phone_array;
}
}