summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-04-12 10:51:45 (GMT)
committerAlex Pott2015-04-12 10:51:45 (GMT)
commitfab761647c33e7ef184b33d1e22ffc0db880fcf2 (patch)
tree5ab39799df78f381eb601f3a31edccb608aadf10
parent0c7e1e98b62671e445e7e9b2f3211002c85cf96f (diff)
Issue #2418559 by Palashvijay4O, chintan4u, rteijeiro: Fix comment formatting in /core/modules/rest/src/Tests/CreateTest.php
-rw-r--r--core/modules/rest/src/Tests/CreateTest.php37
1 files changed, 22 insertions, 15 deletions
diff --git a/core/modules/rest/src/Tests/CreateTest.php b/core/modules/rest/src/Tests/CreateTest.php
index d125f1b..98b944a 100644
--- a/core/modules/rest/src/Tests/CreateTest.php
+++ b/core/modules/rest/src/Tests/CreateTest.php
@@ -100,13 +100,13 @@ class CreateTest extends RESTTestBase {
}
/**
- * Tests several valid and invalid create requests for 'entity_test' entity type.
+ * Tests valid and invalid create requests for 'entity_test' entity type.
*/
public function testCreateEntityTest() {
$entity_type = 'entity_test';
// Enables the REST service for 'entity_test' entity type.
$this->enableService('entity:' . $entity_type, 'POST');
- // Create two accounts that have the required permissions to create resources.
+ // Create two accounts with the required permissions to create resources.
// The second one has administrative permissions.
$accounts = $this->createAccountPerEntity($entity_type);
@@ -122,7 +122,8 @@ class CreateTest extends RESTTestBase {
// Create the entity over the REST API.
$this->assertCreateEntityOverRestApi($entity_type, $serialized);
- // Get the entity ID from the location header and try to read it from the database.
+ // Get the entity ID from the location header and try to read it from the
+ // database.
$this->assertReadEntityIdFromHeaderAndDb($entity_type, $entity, $entity_values);
// Try to create an entity with an access protected field.
@@ -139,7 +140,8 @@ class CreateTest extends RESTTestBase {
$serialized = $this->serializer->serialize($entity, $this->defaultFormat, ['account' => $account]);
$this->httpRequest('entity/' . $entity_type, 'POST', $serialized, $this->defaultMimeType);
- // The value selected is not a valid choice because the format must be 'plain_txt'.
+ // The value selected is not a valid choice because the format must be
+ // 'plain_txt'.
$this->assertResponse(422);
$this->assertFalse(EntityTest::loadMultiple(), 'No entity has been created in the database.');
@@ -153,7 +155,8 @@ class CreateTest extends RESTTestBase {
// Try to send no data at all, which does not make sense on POST requests.
$this->assertCreateEntityNoData($entity_type);
- // Try to send invalid data to trigger the entity validation constraints. Send a UUID that is too long.
+ // Try to send invalid data to trigger the entity validation constraints.
+ // Send a UUID that is too long.
$this->assertCreateEntityInvalidSerialized($entity, $entity_type);
// Try to create an entity without proper permissions.
@@ -170,8 +173,8 @@ class CreateTest extends RESTTestBase {
$entity_type = 'node';
// Enables the REST service for 'node' entity type.
$this->enableService('entity:' . $entity_type, 'POST');
- // Create two accounts that have the required permissions to create resources.
- // The second one has administrative permissions.
+ // Create two accounts that have the required permissions to create
+ // resources. The second one has administrative permissions.
$accounts = $this->createAccountPerEntity($entity_type);
// Verify create requests per user.
@@ -181,7 +184,8 @@ class CreateTest extends RESTTestBase {
$entity_values = $this->entityValues($entity_type);
$entity = Node::create($entity_values);
- // Verify that user cannot create content when trying to write to fields where it is not possible.
+ // Verify that user cannot create content when trying to write to fields
+ // where it is not possible.
if (!$account->hasPermission('administer nodes')) {
$serialized = $this->serializer->serialize($entity, $this->defaultFormat, ['account' => $account]);
$this->httpRequest('entity/' . $entity_type, 'POST', $serialized, $this->defaultMimeType);
@@ -200,7 +204,8 @@ class CreateTest extends RESTTestBase {
// Create the entity over the REST API.
$this->assertCreateEntityOverRestApi($entity_type, $serialized);
- // Get the new entity ID from the location header and try to read it from the database.
+ // Get the new entity ID from the location header and try to read it from
+ // the database.
$this->assertReadEntityIdFromHeaderAndDb($entity_type, $entity, $entity_values);
// Try to send invalid data that cannot be correctly deserialized.
@@ -226,8 +231,8 @@ class CreateTest extends RESTTestBase {
$entity_type = 'user';
// Enables the REST service for 'user' entity type.
$this->enableService('entity:' . $entity_type, 'POST');
- // Create two accounts that have the required permissions to create resources.
- // The second one has administrative permissions.
+ // Create two accounts that have the required permissions to create
+ // resources. The second one has administrative permissions.
$accounts = $this->createAccountPerEntity($entity_type);
foreach ($accounts as $key => $account) {
@@ -251,7 +256,8 @@ class CreateTest extends RESTTestBase {
// Create the entity over the REST API.
$this->assertCreateEntityOverRestApi($entity_type, $serialized);
- // Get the new entity ID from the location header and try to read it from the database.
+ // Get the new entity ID from the location header and try to read it from
+ // the database.
$this->assertReadEntityIdFromHeaderAndDb($entity_type, $entity, $entity_values);
// Try to send invalid data that cannot be correctly deserialized.
@@ -268,8 +274,8 @@ class CreateTest extends RESTTestBase {
}
/**
- * Creates user accounts that have the required permissions to create resources via the REST API.
- * The second one has administrative permissions.
+ * Creates user accounts that have the required permissions to create
+ * resources via the REST API. The second one has administrative permissions.
*
* @param string $entity_type
* Entity type needed to apply user permissions.
@@ -307,7 +313,8 @@ class CreateTest extends RESTTestBase {
}
/**
- * Get the new entity ID from the location header and try to read it from the database.
+ * Gets the new entity ID from the location header and tries to read it from
+ * the database.
*
* @param string $entity_type
* Entity type we need to load the entity from DB.