Skip to content

Commit

Permalink
Fix PHPCS and test case fail issue (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-intelli authored Aug 28, 2023
1 parent a096101 commit 230b0c5
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ protected function setUp(): void {
$this->installEntitySchema('team_member_role');

$this->addOrganizationMatchedResponse();

// Setting teams cache to 900 to make sure null value is not returned in getCacheMaxAge().
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('apigee_edge_teams.team_settings');

if (NULL === $config->get('cache_expiration')) {
$config->set('cache_expiration', 900);
$config->save(TRUE);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ protected function setUp(): void {
$this->installEntitySchema('team_member_role');

$this->addOrganizationMatchedResponse();

// Setting teams cache to 900 to make sure null value is not returned in getCacheMaxAge().
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('apigee_edge_teams.team_settings');

if (NULL === $config->get('cache_expiration')) {
$config->set('cache_expiration', 900);
$config->save(TRUE);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion modules/apigee_edge_teams/src/Entity/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ protected static function propertyToBaseFieldBlackList(): array {
* {@inheritdoc}
*/
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.team_settings')->get('cache_expiration');
return \Drupal::config('apigee_edge_teams.team_settings')->get('cache_expiration');
}

}
2 changes: 1 addition & 1 deletion modules/apigee_edge_teams/src/Entity/TeamApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ protected function urlRouteParameters($rel) {
* {@inheritdoc}
*/
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.team_app_settings')->get('cache_expiration');
return \Drupal::config('apigee_edge_teams.team_app_settings')->get('cache_expiration');
}

}
1 change: 1 addition & 0 deletions src/Entity/ApiProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,5 @@ public function setScopes(string ...$scopes): void {
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.api_product_settings')->get('cache_expiration');
}

}
1 change: 1 addition & 0 deletions src/Entity/DeveloperApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,5 @@ protected function urlRouteParameters($rel) {
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.developer_app_settings')->get('cache_expiration');
}

}

0 comments on commit 230b0c5

Please sign in to comment.