Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(User): requestChangePhoneNumber & changePhoneNumber #214

Merged
merged 5 commits into from
Jul 15, 2020

Conversation

weakish
Copy link
Contributor

@weakish weakish commented Jul 15, 2020

No description provided.

@weakish weakish marked this pull request as draft July 15, 2020 08:01
@weakish weakish force-pushed the changePhoneNumber branch from 896ad4b to 43b0837 Compare July 15, 2020 08:03
@weakish weakish force-pushed the changePhoneNumber branch from 43b0837 to 3876853 Compare July 15, 2020 08:04
/**
* Request mobile phone verify before updating it.
*
* @param string $phoneNumber
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里还应该有个 ttl 参数,但是其他类似方法也没带这个参数,所以这里先不加,后续统一再完善(#213

@@ -181,6 +181,24 @@ public function testSignUpOrLoginByMobilePhone() {
User::signUpOrLoginByMobilePhone("18612340000", "000000");
}

public function testRequestChangePhoneNumber() {
$this->setExpectedException("LeanCloud\CloudException", null, 600);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为应用设置的关系,自动跑测试的时候并不会实际发短信。不过我在本地是手动跑过这两个测试,可以成功发送短信以及修改手机号(如果需要在本地跑的话,需要使用一个开启短信服务及相关配置的应用,同时修改下面的 sms code 为实际收到的验证码)。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

或许可以设计环境变量,来决定是「假测」还是「真测」。比如 TEST_PHONE=+8616533875941 ,一旦设置了这个环境变量,就跑真测。

@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #214 into master will decrease coverage by 0.49%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #214      +/-   ##
============================================
- Coverage     67.01%   66.51%   -0.50%     
- Complexity      804      806       +2     
============================================
  Files            36       36              
  Lines          2295     2270      -25     
============================================
- Hits           1538     1510      -28     
- Misses          757      760       +3     
Impacted Files Coverage Δ Complexity Δ
src/LeanCloud/Client.php 84.51% <ø> (+0.22%) 96.00 <0.00> (ø)
src/LeanCloud/User.php 79.12% <100.00%> (-0.10%) 57.00 <2.00> (+2.00) ⬇️
src/LeanCloud/File.php 81.57% <0.00%> (-2.09%) 57.00% <0.00%> (ø%)
src/LeanCloud/SaveOption.php 90.00% <0.00%> (-0.91%) 5.00% <0.00%> (ø%)
src/LeanCloud/LeanObject.php 88.77% <0.00%> (-0.90%) 120.00% <0.00%> (ø%)
src/LeanCloud/Relation.php 69.23% <0.00%> (-0.77%) 17.00% <0.00%> (ø%)
src/LeanCloud/Operation/RelationOperation.php 84.28% <0.00%> (-0.44%) 30.00% <0.00%> (ø%)
src/LeanCloud/ACL.php 78.78% <0.00%> (-0.43%) 43.00% <0.00%> (ø%)
src/LeanCloud/GeoPoint.php 87.87% <0.00%> (-0.36%) 11.00% <0.00%> (ø%)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 750ccf7...8440ad3. Read the comment docs.

@weakish weakish marked this pull request as ready for review July 15, 2020 10:32
@weakish weakish requested a review from juvenn July 15, 2020 10:33
@weakish weakish changed the title changePhoneNumber feat(User): requestChangePhoneNumber & changePhoneNumber Jul 15, 2020
@@ -9,7 +9,7 @@ version="$1"

#### Build new changelog
echo "" >> Changelog.md.0
echo "$version 发布日期:`date +%Y-%m-%d`" >> Changelog.md.0
echo "$version Released on `date +%Y-%m-%d`" >> Changelog.md.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDK 新政,release log 和 api doc 改用英文

* `make doc` to build documentation (should running on PHP < 7.2)
* `make doc` to build documentation.
The make task uses PHP 5.6, to install it on recent versions of macOS,
see https://github.com/eXolnet/homebrew-deprecated/pull/25
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在现在的 macOS 上安装 PHP 5.6 很艰难,因为 openssl 依赖的关系,大量方法都失效了。好不容易找到这个可用的 homebrew 公式。

@@ -181,6 +181,24 @@ public function testSignUpOrLoginByMobilePhone() {
User::signUpOrLoginByMobilePhone("18612340000", "000000");
}

public function testRequestChangePhoneNumber() {
$this->setExpectedException("LeanCloud\CloudException", null, 600);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

或许可以设计环境变量,来决定是「假测」还是「真测」。比如 TEST_PHONE=+8616533875941 ,一旦设置了这个环境变量,就跑真测。

@weakish weakish merged commit 1b665d1 into leancloud:master Jul 15, 2020
@weakish weakish deleted the changePhoneNumber branch July 15, 2020 12:02
@weakish weakish mentioned this pull request Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants