Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Status: Needs review » Needs work
+++ b/src/Tests/DepartureTest.php
@@ -92,14 +92,20 @@ class DepartureTest extends EntityPilotTestBase {
+		$item1 = $this->container->get('entity_type.manager')
+			->getStorage('entity_test')
+			->create(array(
+				'name' => 'item1',
+			))
+			->save();
+
+		$item2 = $this->container->get('entity_type.manager')
+			->getStorage('entity_test')
+			->create(array(
+				'name' => 'item2',
+			))
+			->save();
+		

+++ b/src/Tests/EntityPilotTestBase.php
@@ -77,15 +77,18 @@ abstract class EntityPilotTestBase extends WebTestBase {
+	$bundle = $this->container->get('entity_type.manager')
+		->getStorage('ep_account')
+		->create(array(
+			'id' => Unicode::strtolower($label),
+			'label' => $label,
+			'carrierId' => $carrier_id ?: $this->randomMachineName(),
+			'blackBoxKey' => $black_box_key ?: $this->randomMachineName(),
+			'description' => $description ?: $this->randomMachineName(),
+			'secret' => "a22a0b2884fd73c4e211d68e1f031051",
+		))
+		->save();

@@ -102,11 +105,15 @@ abstract class EntityPilotTestBase extends WebTestBase {
+	if($flight = $this->container->get('entity_type.manager')
+		->getStorage('ep_departure')
+		->create(array(
+				'info' => $info ?: $this->randomMachineName(),
+				'account' => $bundle,
+				'langcode' => 'en',
+			))
+		->save();
+	) {
       $flight->save();

White space issues here - please see drupal.org/node/1391 for policy on tabs vs spaces.

pashupathi nath gajawada’s picture

I have removed the white spaces and updated the patch.
Find the updated patch.

pashupathi nath gajawada’s picture

Status: Needs work » Needs review
larowlan’s picture

Status: Needs review » Needs work

Still has whitespace issues, sorry

pashupathi nath gajawada’s picture

Updated the patch by removing the white spaces.
Please find the updated patch.

larowlan’s picture

  1. +++ b/src/Tests/DepartureTest.php
    @@ -92,14 +92,19 @@ class DepartureTest extends EntityPilotTestBase {
    -    $item2->save();
    ...
    +      ->save();
    
    +++ b/src/Tests/EntityPilotTestBase.php
    @@ -77,15 +77,18 @@ abstract class EntityPilotTestBase extends WebTestBase {
    -    ));
    -    $bundle->save();
    +      ))
    +      ->save();
    +    // $bundle->save();
    

    We need to keep the save call separate

  2. +++ b/src/Tests/DepartureTest.php
    @@ -92,14 +92,19 @@ class DepartureTest extends EntityPilotTestBase {
    +    $item1 = $this->container->get('entity_type.manager')
    +      ->getStorage('entity_test')
    ...
    +    $item2 = $this->container->get('entity_type.manager')
    +      ->getStorage('entity_test')
    

    Can we store this in a variable instead of calling the container twice.

  3. +++ b/src/Tests/DepartureTest.php
    @@ -272,5 +277,4 @@ class DepartureTest extends EntityPilotTestBase {
    -
    -}
    +}
    \ No newline at end of file
    

    Can you revert this change

  4. +++ b/src/Tests/EntityPilotTestBase.php
    @@ -102,14 +105,17 @@ abstract class EntityPilotTestBase extends WebTestBase {
    +      ->save();
    +	  ) {
    ...
    -}
    +}
    \ No newline at end of file
     
    

    Whitespace issues here, and same issue with save

larowlan’s picture

Status: Needs review » Needs work
larowlan’s picture

Priority: Normal » Minor
neerajsingh’s picture

Shashwat Purav’s picture

Status: Needs review » Needs work

The patch in #10 failed to applied successfully to 8.x-1.x branch.