'return' => ['content'],
]);
$this->assertEquals($expectedContent, $getResult2['values'][$fileId]['content']);
+ // Do this again even though we just tested above to demonstrate that these fields should be returned even if you only ask to return 'content'.
foreach (['id', 'entity_table', 'entity_id', 'url'] as $field) {
- $this->assertEquals($createResult['values'][$fileId][$field], $getResult['values'][$fileId][$field], "Expect field $field to match");
+ if ($field == 'url') {
+ $this->assertEquals(substr($createResult['values'][$fileId][$field], 0, -15), substr($getResult2['values'][$fileId][$field], 0, -15));
+ $this->assertEquals(substr($createResult['values'][$fileId][$field], -3), substr($getResult2['values'][$fileId][$field], -3));
+ $this->assertApproxEquals(substr($createResult['values'][$fileId][$field], -14, 10), substr($getResult2['values'][$fileId][$field], -14, 10), 2);
+ }
+ else {
+ $this->assertEquals($createResult['values'][$fileId][$field], $getResult2['values'][$fileId][$field], "Expect field $field to match");
+ }
}
}