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

Phpunit8 20191130 #36499

Closed
wants to merge 15 commits into from
Closed

Phpunit8 20191130 #36499

wants to merge 15 commits into from

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Nov 30, 2019

Revive PR #34961 Declare testCase methods void to match modern phpunit declaration
And do stuff that we can do now in phpunit7 and PHP 7.1 to be up-to-date for phpunit8 and PHP 7.2`
https://phpunit.de/announcements/phpunit-8.html
https://thephp.cc/news/2019/02/help-my-tests-stopped-working

See if we can run phpunit tests with phpunit V8.

  1. the setup* and teardown* methods in phpunit8 have return type void, so they have to be declared like that where we inherit-override them.

  2. expectException annotations are being deprecated in favour of $this->expectException() so change them.
    https://thephp.cc/news/2016/02/questioning-phpunit-best-practices
    php-cs-fixer fixes this automagically by adding this to the config:

			'php_unit_no_expectation_annotation' => true,
			'php_unit_expectation' => true,

That could be added to owncloud-codestyle so that we find and "fix" any of these in people's PRs.

  1. assertInternalType is being deprecated in favour of assertIsArray() assertIsInt() etc.
    Implement specialized alternatives to assertInternalType() and assertNotInternalType() sebastianbergmann/phpunit#3368
    php-cs-fixer fixes this automagically by adding this to the config:
			'php_unit_dedicate_assert_internal_type' => true,

That could be added to owncloud-codestyle so that we find and "fix" any of these in people's PRs.

@phil-davis phil-davis self-assigned this Nov 30, 2019
@codecov
Copy link

codecov bot commented Nov 30, 2019

Codecov Report

Merging #36499 into master will decrease coverage by 10.67%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #36499       +/-   ##
=============================================
- Coverage     64.68%      54%   -10.68%     
=============================================
  Files          1268       63     -1205     
  Lines         74362     7408    -66954     
  Branches       1309     1309               
=============================================
- Hits          48100     4001    -44099     
+ Misses        25876     3021    -22855     
  Partials        386      386
Flag Coverage Δ Complexity Δ
#javascript 54% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit ? ?
Impacted Files Coverage Δ Complexity Δ
apps/updatenotification/templates/admin.php
lib/private/Encryption/Keys/Storage.php
lib/private/App/CodeChecker/NodeVisitor.php
lib/private/RedisFactory.php
apps/dav/lib/Avatars/AvatarNode.php
...s/dav/appinfo/Migrations/Version20170202213905.php
apps/dav/lib/Upload/ChunkLocationProvider.php
apps/files/lib/AppInfo/Application.php
apps/systemtags/list.php
apps/files_external/lib/Lib/Backend/DAV.php
... and 1185 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 69008d2...77920b2. Read the comment docs.

@phil-davis
Copy link
Contributor Author

Fixes for deprecations were applied in PR #36501

@phil-davis phil-davis closed this Dec 7, 2019
@phil-davis phil-davis deleted the phpunit8-20191130 branch December 7, 2019 11:36
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.

None yet

1 participant