Posted by sun on January 18, 2013 at 8:09am
6 followers
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | rest.module |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | Random test failure |
Issue Summary
@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
#1
What about simply that.
Is it just me or should randomString() tried to be avoided?
#2
Yeah, this is being trimmed.... The tests should too. This is the right fix I think.
#3
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.
#4
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.
#5
OK thanks for the code comment. Committed/pushed to 8.x.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.