function test_more_profile_info() { $vars = $this->_more_profile_info_setup(); extract($vars); save_more_profile_info($user_id); ob_start(); more_profile_info(get_user_by('id', $user_id)); $output = ob_get_contents(); ob_end_clean(); // Three inputs should be present and they should be checked or "on" after running // `save_more_profile_info`. $this->assertEquals(substr_count($output, 'checked'), 3); // There should be one job_title input and it should be populated with the value set by // `save_more_profile_info`. $this->assertEquals(substr_count($output, 'value="' . $job_title), 1); }
function test_more_profile_info() { $vars = $this->_more_profile_info_setup(); extract($vars); save_more_profile_info($user_id); ob_start(); more_profile_info(get_user_by('id', $user_id)); $output = ob_get_contents(); ob_end_clean(); // Four inputs should be present and four should be checked or "on" after running // `save_more_profile_info`, because $this->_more_profile_info sets show_email to true. $this->assertEquals(2, substr_count($output, 'checked'), "Not all inputs that should have been checked were."); // There should be one job_title input and it should be populated with the value set by // `save_more_profile_info`. $this->assertEquals(1, substr_count($output, 'value="' . $job_title)); }