@see http://qa.drupal.org/pifr/test/424668

I suspect that the API code applies a trim() on the actual, saved values.

The only difference below is a trailing space in each second array key:

StyleSerializerTest.php	202	Drupal\rest\Tests\Views\StyleSerializerTest->testUIFieldAlias():

Value array (
  0 => 
  array (
    'dTsf82Om' => 'George',
    'D(1h<|N' => 'TEST',
  ),
  1 => 
  array (
    'dTsf82Om' => 'Ringo',
    'D(1h<|N' => 'TEST',
  ),
  2 => 
  array (
    'dTsf82Om' => 'Meredith',
    'D(1h<|N' => 'TEST',
  ),
  3 => 
  array (
    'dTsf82Om' => 'Paul',
    'D(1h<|N' => 'TEST',
  ),
  4 => 
  array (
    'dTsf82Om' => 'John',
    'D(1h<|N' => 'TEST',
  ),
) is identical to value array (
  0 => 
  array (
    'dTsf82Om' => 'George',
    'D(1h<|N ' => 'TEST',
  ),
  1 => 
  array (
    'dTsf82Om' => 'Ringo',
    'D(1h<|N ' => 'TEST',
  ),
  2 => 
  array (
    'dTsf82Om' => 'Meredith',
    'D(1h<|N ' => 'TEST',
  ),
  3 => 
  array (
    'dTsf82Om' => 'Paul',
    'D(1h<|N ' => 'TEST',
  ),
  4 => 
  array (
    'dTsf82Om' => 'John',
    'D(1h<|N ' => 'TEST',
  ),
).
CommentFileSizeAuthor
#4 drupal-1892016-4.patch932 bytesdawehner
#1 drupal-1892016-1.patch824 bytesdawehner

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new824 bytes

What about simply that.

Is it just me or should randomString() tried to be avoided?

damiankloip’s picture

Status: Needs review » Reviewed & tested by the community

Yeah, this is being trimmed.... The tests should too. This is the right fix I think.

catch’s picture

Status: Reviewed & tested by the community » Needs work

If the API applies a trim(), then why isn't that happening on the form submission itself then? Or is it an assertIdentical() or similar later that fails because the saved value and the raw string are different? Could use a code comment to explain this.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new932 bytes

We talked about that and even opened another issue which adds validation to only allow expected characters in the form itself: #1892158: Only allow machine like names for the field alias row plugin

Let's here just fix the random test failure.

catch’s picture

Status: Needs review » Fixed

OK thanks for the code comment. Committed/pushed to 8.x.

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