Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.27 KB

There were two instances of short-syntax arrays.

Status: Needs review » Needs work

The last submitted patch, 2: views-n2903006-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

David_Rothstein’s picture

Status: Needs work » Needs review

The patch looks good - I was going to mark this RTBC, but not sure what's up with that unrelated test failure. I'll trigger a retest.

Note that this issue is also causing test failures in other modules besides Views, which use it in their tests (for example, see #1635750: OG Context handler for ajax calls (system, file upload, autocomplete, etc)).

Status: Needs review » Needs work

The last submitted patch, 2: views-n2903006-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

Yeah, that's annoying.

exception: [Warning] Line 228 of sites/all/modules/views/tests/views_cache.test:
simplexml_load_string(): Entity: line 2: parser error : XML declaration allowed only at the start of the document

That points to this line:

    $xml = simplexml_load_string($first_content);

.. and the variable comes from:

    $this->drupalGet('test_feed_http_headers_caching');
    $first_content = $this->drupalGetContent();

.. and test_feed_http_headers_caching is a view that comes from the views_test module. So this should work. I guess I need to run the tests locally to work out what's going on.

damienmckenna’s picture

FYI I get the same error locally too.

damienmckenna’s picture

I went back to 7.x-3.16 and ViewsCacheTest works ok there. Looking at the difference in the output, though, I wonder if the problem is simply a matter of unwanted whitespace? I added print_r($first_content) and there are more blank lines between the intro and the intro xml tag in the 7.x-3.x codebase than there are on 7.x-3.16.

Stevel’s picture

The error is caused by a space introduced at the top of tests/views_test.views_default.inc in the latest security patch. I'll roll a patch shortly to remove this space.

Stevel’s picture

Status: Needs work » Needs review
StatusFileSize
new229 bytes

Here's the patch that solved this for me.

Status: Needs review » Needs work

The last submitted patch, 10: 2903006-fix-whitespace.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Stevel’s picture

Status: Needs work » Needs review
StatusFileSize
new1.51 KB

New patch combining both above patches.

Edit: It worked for me without the array() patch, but I'm running PHP 7 and the shorthand syntax for array() was introduced in PHP 5.4. We still need to support 5.2.5+ here though.

  • DamienMcKenna committed 04e87cc on 7.x-3.x
    Issue #2903006 by Stevel, DamienMcKenna: Fix tests for 7.x-3.x.
    
damienmckenna’s picture

Status: Needs review » Fixed

Thanks for finding that, Stevel!

dawehner’s picture

Thank you for this quick fix!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.