Webmozart\Assert\Assert::eq PHP Method

eq() public static method

public static eq ( $value, $value2, $message = '' )
    public static function eq($value, $value2, $message = '')
    {
        if ($value2 != $value) {
            static::reportInvalidArgument(sprintf($message ?: 'Expected a value equal to %2$s. Got: %s', static::valueToString($value), static::valueToString($value2)));
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * 测试用户不存在
  */
 function testUserNotExists()
 {
     $api = $this->createApi($this->url)->setQuery(['email' => '*****@*****.**', 'password' => '123456'])->setVerify($this->getMechanic()->getAssetPath() . DIRECTORY_SEPARATOR . 'cacert.pem');
     $response = $this->request($api);
     $responseData = json_decode($response->getBody());
     Assert::eq($response->getStatusCode(), 200, '服务器连接错误');
     Assert::eq($responseData->code, 104, '状态码返回错误');
 }
All Usage Examples Of Webmozart\Assert\Assert::eq