@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',
),
).
Comments
Comment #1
dawehnerWhat about simply that.
Is it just me or should randomString() tried to be avoided?
Comment #2
damiankloip commentedYeah, this is being trimmed.... The tests should too. This is the right fix I think.
Comment #3
catchIf 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.
Comment #4
dawehnerWe 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.
Comment #5
catchOK thanks for the code comment. Committed/pushed to 8.x.