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

Use adventage of newer PHPUnit sytax #11422

Merged
merged 1 commit into from Nov 13, 2017

Conversation

Projects
None yet
5 participants
@keradus
Contributor

keradus commented Nov 11, 2017

Brought to you by PHP CS Fixer

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Nov 11, 2017

Codecov Report

Merging #11422 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #11422      +/-   ##
============================================
+ Coverage     93.11%   93.12%   +0.01%     
  Complexity    13008    13008              
============================================
  Files           436      436              
  Lines         33697    33697              
============================================
+ Hits          31377    31382       +5     
+ Misses         2320     2315       -5
Impacted Files Coverage Δ Complexity Δ
src/Cache/Engine/FileEngine.php 90.16% <0%> (+1.09%) 73% <0%> (ø) ⬇️
src/Cache/CacheRegistry.php 100% <0%> (+4%) 11% <0%> (ø) ⬇️
src/Cache/CacheEngine.php 93.61% <0%> (+4.25%) 19% <0%> (ø) ⬇️

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 9303632...c936250. Read the comment docs.

codecov-io commented Nov 11, 2017

Codecov Report

Merging #11422 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #11422      +/-   ##
============================================
+ Coverage     93.11%   93.12%   +0.01%     
  Complexity    13008    13008              
============================================
  Files           436      436              
  Lines         33697    33697              
============================================
+ Hits          31377    31382       +5     
+ Misses         2320     2315       -5
Impacted Files Coverage Δ Complexity Δ
src/Cache/Engine/FileEngine.php 90.16% <0%> (+1.09%) 73% <0%> (ø) ⬇️
src/Cache/CacheRegistry.php 100% <0%> (+4%) 11% <0%> (ø) ⬇️
src/Cache/CacheEngine.php 93.61% <0%> (+4.25%) 19% <0%> (ø) ⬇️

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 9303632...c936250. Read the comment docs.

@markstory markstory added this to the 3.5.6 milestone Nov 12, 2017

* @return void
*/
public function testAuthenticateFailReChallenge()
{
$this->expectException(\Cake\Network\Exception\UnauthorizedException::class);
$this->expectExceptionCode(401);

This comment has been minimized.

@markstory

markstory Nov 12, 2017

Member

Why is this notation an improvement? The annotation style is not deprecated and this type of change has the opportunity to create merge conflicts with the 3.next branch.

@markstory

markstory Nov 12, 2017

Member

Why is this notation an improvement? The annotation style is not deprecated and this type of change has the opportunity to create merge conflicts with the 3.next branch.

This comment has been minimized.

@keradus

keradus Nov 12, 2017

Contributor

it is best practice and suggested way of expecting expectations since almost 2 years:
https://thephp.cc/news/2016/02/questioning-phpunit-best-practices
(TLDR: code over annotation for better detection&refactoring, method call could be put directly before code that is expected to raise exception, not to whole codeblock, so better control of what is raising the exception)

@keradus

keradus Nov 12, 2017

Contributor

it is best practice and suggested way of expecting expectations since almost 2 years:
https://thephp.cc/news/2016/02/questioning-phpunit-best-practices
(TLDR: code over annotation for better detection&refactoring, method call could be put directly before code that is expected to raise exception, not to whole codeblock, so better control of what is raising the exception)

This comment has been minimized.

@keradus

keradus Nov 12, 2017

Contributor

while merging into 3.next, you could keep 3.next version of code on each conflict and we could re-apply auto-changes in separated PR for 3.next. that's easy ;)

@keradus

keradus Nov 12, 2017

Contributor

while merging into 3.next, you could keep 3.next version of code on each conflict and we could re-apply auto-changes in separated PR for 3.next. that's easy ;)

This comment has been minimized.

@dereuromark

dereuromark Nov 12, 2017

Member

method call could be put directly before code that is expected to raise exception

Thats when I would start putting it in code, and that needs to be done manually.

@dereuromark

dereuromark Nov 12, 2017

Member

method call could be put directly before code that is expected to raise exception

Thats when I would start putting it in code, and that needs to be done manually.

This comment has been minimized.

@keradus

keradus Nov 12, 2017

Contributor

that part of the benefit need to be achieved manually, yes. yet, keep in mind that a lot of test methods are already single-liners, so it's already achieved for them.
also, having real class usage in code instead of text (annotation) is still benefit.

@keradus

keradus Nov 12, 2017

Contributor

that part of the benefit need to be achieved manually, yes. yet, keep in mind that a lot of test methods are already single-liners, so it's already achieved for them.
also, having real class usage in code instead of text (annotation) is still benefit.

This comment has been minimized.

@inoas

inoas Nov 12, 2017

Contributor

Maybe this could be done in/for the 3.next branch instead.

@inoas

inoas Nov 12, 2017

Contributor

Maybe this could be done in/for the 3.next branch instead.

This comment has been minimized.

@keradus

keradus Nov 12, 2017

Contributor

I sent this PR to default branch, if I shall change target branch, let me know ;)

@keradus

keradus Nov 12, 2017

Contributor

I sent this PR to default branch, if I shall change target branch, let me know ;)

This comment has been minimized.

@markstory

markstory Nov 12, 2017

Member

I will get this merged into master/3.next over the next few days. Any conflicts will be a one time cost.

@markstory

markstory Nov 12, 2017

Member

I will get this merged into master/3.next over the next few days. Any conflicts will be a one time cost.

This comment has been minimized.

@keradus

keradus Nov 12, 2017

Contributor

i'm not fully get it. it's already targeting master. shall I change PR target branch to sth ? (then I could solve the conflicts saving your time!)

@keradus

keradus Nov 12, 2017

Contributor

i'm not fully get it. it's already targeting master. shall I change PR target branch to sth ? (then I could solve the conflicts saving your time!)

This comment has been minimized.

@markstory

markstory Nov 13, 2017

Member

What you have now is fine. I can take care of any conflicts that come up when I merge master -> 3.next.

@markstory

markstory Nov 13, 2017

Member

What you have now is fine. I can take care of any conflicts that come up when I merge master -> 3.next.

@markstory markstory self-assigned this Nov 12, 2017

@markstory markstory added the testing label Nov 12, 2017

@markstory markstory merged commit 600e90d into cakephp:master Nov 13, 2017

5 checks passed

codecov/patch Coverage not affected when comparing 9303632...c936250
Details
codecov/project 93.12% (+0.01%) compared to 9303632
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
stickler-ci No lint errors found.

@keradus keradus deleted the keradus:fix_phpunit branch Nov 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment