This information is from the code coverage report (see http://coverage.cwgordon.com/coverage).

We need to test:

Key: Italicized means in progress, Crossed out means either done or determined currently untestable or unnecessary to test or dead code.

1) drupal_get_content() with no specified region.
2) drupal_get_headers().
3) drupal_get_destination() with extra GET parameters.
4) drupal_goto() with $_REQUEST['edit']['destination'] set.
5) Custom url for page not found.
6) Custom url for access denied.
7) drupal_http_request() self test.
8) drupal_http_request() to https://
9) Invalid requests with drupal_http_request()
10) drupal_http_request()'s Authorization feature
11) drupal_http_request()'s that result in invalid response codes
12) 301, 302, 307, 403, and 404 responses with drupal_http_request().
13) Database error handling.
14) valid_url() ($absolute = FALSE)
15) check_file()
16) RSS feeds.
17) format_plural() with locale_get_plural().
18) User configuration of timezones.
19) format_date().
20) url() with a fragment in the path.
21) url() with $options['query']
22) Toggling on/off of clean urls.
23) l() for an active path item that already has a class.
24) RTL language support.
25) CSS caching.
26) drupal_add_js() with $scope != 'header'.
27) js preprocessing.
28) drupal_json().
29) Form elements with #pre_render.
30) Form elements with #post_render.
31) element_properties()
32) drupal_schema_fields_sql() without $prefix.
33) drupal_write_record() on a nonexistant table.
34) drupal_parse_info_file() on a nonexistant file.
35) drupal_explode_tags().
36) drupal_implode_tags().
37) drupal_flush_all_caches()

Comments

cwgordon7’s picture

Assigned: cwgordon7 » Unassigned

heh... no.

cwgordon7’s picture

StatusFileSize
new2.38 KB

Let's get this started... this patch covers #'s 35 and 36 (drupal_explode_tags() and drupal_implode_tags()).

cwgordon7’s picture

Status: Active » Needs review
catch’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.38 KB

Tests pass so this looks RTBC to me if the sample text gets past Dries ;)

Did some cleanup of comments and escaped apostrophe inside t(), please don't credit on commit.

Susurrus’s picture

dries’s picture

I think the patch in #4 looks like an OK start, but

1) I'd want to invite you to improve the phpdoc of drupal_explode_tags() and drupal_implode_tags(). It took me a while to figure the context and to remember their purpose.
2) looking at the code of drupal_explode_tags() it doesn't look like our test cases are really representative. They seem to be low on commas, for example, and there isn't an actual multi-tag example?

dries’s picture

Status: Reviewed & tested by the community » Needs work

I've committed the patch as is, but I'm marking this 'code needs work' so we can still work on the comments in #6.

Thanks for the additional tests -- let's try to apply some more polish.

grndlvl’s picture

Status: Needs work » Needs review
StatusFileSize
new3.06 KB

Patch for #19 format_date().

grndlvl’s picture

patch for:

2) drupal_get_headers().
5) Custom url for page not found.
6) Custom url for access denied.

Also contains patch from comment #8

dries’s picture

Status: Needs review » Needs work

- Can we write 'medium' instead of 'med'.
- Can we add some code comments? Especially around the timezone handling and assertFormatDate().
- Otherwise looks great and needed.

grndlvl’s picture

Status: Needs review » Needs work

- Changed 'med' to 'medium'
- Added additional comments

grndlvl’s picture

Status: Needs work » Needs review
StatusFileSize
new8.98 KB

- Changed some comments around

grndlvl’s picture

Status: Needs work » Needs review

** need to apply will do tomorrow **
line #180: session_save_session(FALSE);

grndlvl’s picture

Status: Needs review » Active
grndlvl’s picture

session_save_session(FALSE);

also HEAD had changed since last past so patch now applies to HEAD

cwgordon7’s picture

StatusFileSize
new9.8 KB

session_save_session() is now drupal_save_session(). Also needed a bit of commenting standard love. Rerolled, ready for review. :)

grndlvl’s picture

Per catches suggestion I have split the patch from #16 into multiple issues so that there is less of a patch to review.

format_date() -- http://drupal.org/node/316189
drupal_get_headers() -- http://drupal.org/node/316188
Custom Page Not Found -- http://drupal.org/node/316187
Custom Access Denied -- http://drupal.org/node/316186

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

catch’s picture

Component: tests » base system
Category: bug » task
Priority: Critical » Normal

Moving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.

Robin Millette’s picture

Any news here? Should we close this issue?

  • Dries committed bf3887c on 8.3.x
    - Patch #276272 by catch, cwgordon7: more tests for common.inc.
    
    

  • Dries committed bf3887c on 8.3.x
    - Patch #276272 by catch, cwgordon7: more tests for common.inc.
    
    

  • Dries committed bf3887c on 8.4.x
    - Patch #276272 by catch, cwgordon7: more tests for common.inc.
    
    

  • Dries committed bf3887c on 8.4.x
    - Patch #276272 by catch, cwgordon7: more tests for common.inc.
    
    

  • Dries committed bf3887c on 9.1.x
    - Patch #276272 by catch, cwgordon7: more tests for common.inc.
    
    

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.