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

Method assertArraySubset in src/Codeception/Util/Shared/Asserts.php is public but should be protected #4395

Closed
damian-sikora-droptica opened this issue Jul 12, 2017 · 0 comments

Comments

@damian-sikora-droptica
Copy link

damian-sikora-droptica commented Jul 12, 2017

After this change:
31e1f10

some additional test (Assert array subset) is added automatically to Cest class when Assert trait is used and it is throwing following error:

1) BlogCest: Assert array subset
 Test  tests/acceptance/BlogCest.php:assertArraySubset
                                                                                                                                        
  [PHPUnit_Framework_Exception] Argument #1 (No Value) of PHPUnit_Framework_Assert::assertArraySubset() must be a array or ArrayAccess  
                                                                                                                                        
/root/composer_codecept/vendor/phpunit/phpunit/src/Framework/Assert.php:63
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Util/Shared/Asserts.php:388
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Lib/Di.php:127
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Test/Cest.php:136
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Test/Cest.php:148
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Test/Cest.php:82
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Test/Test.php:87
/root/composer_codecept/vendor/phpunit/phpunit/src/Framework/TestSuite.php:722
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/PHPUnit/Runner.php:106
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/SuiteManager.php:157
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Codecept.php:188
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Codecept.php:157
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Command/Run.php:341
/root/composer_codecept/vendor/symfony/console/Command/Command.php:264
/root/composer_codecept/vendor/symfony/console/Application.php:869
/root/composer_codecept/vendor/symfony/console/Application.php:223
/root/composer_codecept/vendor/symfony/console/Application.php:130
/root/composer_codecept/vendor/codeception/codeception/src/Codeception/Application.php:103
/root/composer_codecept/vendor/codeception/codeception/codecept:36

Codeception v2.3.4
PHPUnit 5.7.21
PHP 5.6.30

it is the same with php 7.0 and PHPUnit 6

I think this method is treated as test because it is public
public function assertArraySubset

and should be protected like rest of methods in this trait

@damian-sikora-droptica damian-sikora-droptica changed the title [PHPUnit_Framework_Exception] Argument #1 (No Value) of PHPUnit_Framework_Assert::assertArraySubset() must be a array or ArrayAccess method assertArraySubset in src/Codeception/Util/Shared/Asserts.php is public but should be protected Jul 12, 2017
@damian-sikora-droptica damian-sikora-droptica changed the title method assertArraySubset in src/Codeception/Util/Shared/Asserts.php is public but should be protected Method assertArraySubset in src/Codeception/Util/Shared/Asserts.php is public but should be protected Jul 12, 2017
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

No branches or pull requests

1 participant