Skip to content

Don't create user profile fields during test runs (PHPUNIT) #306

Open
@aspark21

Description

@aspark21

#283/#286 changes introduced additional profile fields on the merged user which causes core test to fail when doing a full build test run.

Simple fix is to wrap the field creation with:
if (!PHPUNIT_TEST && !defined('BEHAT_SITE_RUNNING')) {

core.testing_generator_test/test_create_custom_profile_field_categorycore\testing_generator_test::test_create_custom_profile_field_category Failed asserting that '2' matches expected 1.  
/var/www/html/lib/testing/tests/testing_generator_test.php:512 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:76

core.testing_generator_test/test_create_custom_profile_fieldcore\testing_generator_test::test_create_custom_profile_field 
Failed asserting that '2' matches expected 1.  
/var/www/html/lib/testing/tests/testing_generator_test.php:574 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:76

core.oauth2_test/test_get_empty_internalfield_listcore\oauth2_test::test_get_empty_internalfield_list 
Failed asserting that two arrays are equal. 
--- Expected +++ Actual @@ @@      16 => 'alternatename'      17 => 'picture'      18 => 'username' +    19 => 'profile_field_mergeusers_date' +    20 => 'profile_field_mergeusers_logid' +    21 => 'profile_field_mergeusers_olduserid' +    22 => 'profile_field_mergeusers_newuserid'  )  
/var/www/html/lib/tests/oauth2_test.php:555 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:76

profilefield_checkbox.profile_field_checkbox_test/test_show_field_contentprofilefield_checkbox\profile_field_checkbox_test::test_show_field_content 
Failed asserting that false is true.  
/var/www/html/user/profile/field/checkbox/tests/profile_field_checkbox_test.php:110 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:76

profilefield_checkbox.profile_field_checkbox_test/test_is_empty with data set "Value equals 0"profilefield_checkbox\profile_field_checkbox_test::test_is_empty with data set "Value equals 0" (array(0), false) Failed asserting that true matches expected false.  /var/www/html/user/profile/field/checkbox/tests/profile_field_checkbox_test.php:86 /var/www/html/lib/phpunit/classes/advanced_testcase.php:76

profilefield_checkbox.profile_field_checkbox_test/test_is_empty with data set "Value equals 1"profilefield_checkbox\profile_field_checkbox_test::test_is_empty with data set "Value equals 1" (array(1), false) Failed asserting that true matches expected false.  /var/www/html/user/profile/field/checkbox/tests/profile_field_checkbox_test.php:86 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions