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

PHPUnit v8 assertInternalType is deprecated #1292

Closed
donnysim opened this issue Apr 13, 2019 · 2 comments
Closed

PHPUnit v8 assertInternalType is deprecated #1292

donnysim opened this issue Apr 13, 2019 · 2 comments
Assignees
Milestone

Comments

@donnysim
Copy link

Subject Details
Plugin Php Inspections (EA Extended) 3.0.13
Language level PHP 7.2

Current behaviour

It suggests converting something like

PHPUnit::assertTrue(\is_array($this->data), 'Json data is empty.');

into

PHPUnit::assertInternalType('array', $this->data, 'Json data is empty.');

But then you end up with Method assertInternalType is deprecated warning.

Expected behaviour

Suggest methods as stated in the warning:

assertInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(), assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(), assertIsResource(), assertIsString(), assertIsScalar(), assertIsCallable(), or assertIsIterable() instead.

Environment details

PhpStorm 2019.1.1 Preview
Build #PS-191.6707.42, built on April 10, 2019
JRE: 1.8.0_202-release-1483-b44 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

@kalessil kalessil self-assigned this Apr 26, 2019
@kalessil kalessil added this to the C-3.0.14 milestone Apr 26, 2019
@kalessil kalessil modified the milestones: C-3.0.14, C-3.0.15 Aug 5, 2019
@kalessil kalessil modified the milestones: C-3.0.15, C-3.0.16 Sep 4, 2019
@kalessil kalessil modified the milestones: C-3.0.16, C-3.0.17 Sep 24, 2019
@someniatko
Copy link

I'd disagree with "false-positive" flag. Rather, the quick-fix is incorrect.

@kalessil
Copy link
Owner

Duplicates #1152. @donnysim, we are introducing PhpUnit version setting there, which will take care of proper replacement generation.

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

No branches or pull requests

3 participants