Commit 2940daec authored by swatichouhan012's avatar swatichouhan012 Committed by Berdir
Browse files

Issue #3119728 by swatichouhan012, thalles: Visibility must be declared on method fixes

parent 607a59f6
......@@ -72,7 +72,7 @@ class PatternEditForm extends EntityForm {
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager service.
*/
function __construct(AliasTypeManager $manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager) {
public function __construct(AliasTypeManager $manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager) {
$this->manager = $manager;
$this->entityTypeBundleInfo = $entity_type_bundle_info;
$this->entityTypeManager = $entity_type_manager;
......
......@@ -51,7 +51,7 @@ class PathautoBulkUpdateTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
function setUp() {
protected function setUp() {
parent::setUp();
// Allow other modules to add additional permissions for the admin user.
......@@ -70,7 +70,7 @@ class PathautoBulkUpdateTest extends BrowserTestBase {
$this->patterns['forum'] = $this->createPattern('forum', '/forums/[term:name]');
}
function testBulkUpdate() {
public function testBulkUpdate() {
// Create some nodes.
$this->nodes = [];
for ($i = 1; $i <= 5; $i++) {
......@@ -139,7 +139,7 @@ class PathautoBulkUpdateTest extends BrowserTestBase {
/**
* Tests alias generation for nodes that existed before installing Pathauto.
*/
function testBulkUpdateExistingContent() {
public function testBulkUpdateExistingContent() {
// Create a node.
$node = $this->drupalCreateNode();
......
......@@ -38,7 +38,7 @@ class PathautoEnablingEntityTypesTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
function setUp() {
protected function setUp() {
parent::setUp();
$this->drupalCreateContentType(['type' => 'article']);
......@@ -60,7 +60,7 @@ class PathautoEnablingEntityTypesTest extends BrowserTestBase {
* ability to define alias patterns for a given entity type works. Test with
* the comment module, as it is not enabled by default.
*/
function testEnablingEntityTypes() {
public function testEnablingEntityTypes() {
// Verify that the comment entity type is not available when trying to add
// a new pattern, nor "broken".
$this->drupalGet('/admin/config/search/path/patterns/add');
......
......@@ -57,7 +57,7 @@ class PathautoMassDeleteTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
function setUp() {
protected function setUp() {
parent::setUp();
$permissions = [
......@@ -76,7 +76,7 @@ class PathautoMassDeleteTest extends BrowserTestBase {
/**
* Tests the deletion of all the aliases.
*/
function testDeleteAll() {
public function testDeleteAll() {
/** @var \Drupal\pathauto\AliasStorageHelperInterface $alias_storage_helper */
$alias_storage_helper = \Drupal::service('pathauto.alias_storage_helper');
......@@ -143,7 +143,7 @@ class PathautoMassDeleteTest extends BrowserTestBase {
/**
* Helper function to generate aliases.
*/
function generateAliases() {
public function generateAliases() {
// Delete all aliases to avoid duplicated aliases. They will be recreated
// below.
$this->deleteAllAliases();
......
......@@ -38,7 +38,7 @@ class PathautoNodeWebTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
function setUp() {
protected function setUp() {
parent::setUp();
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
......@@ -61,7 +61,7 @@ class PathautoNodeWebTest extends BrowserTestBase {
/**
* Tests editing nodes with different settings.
*/
function testNodeEditing() {
public function testNodeEditing() {
// Ensure that the Pathauto checkbox is checked by default on the node add
// form.
$this->drupalGet('node/add/page');
......@@ -149,7 +149,7 @@ class PathautoNodeWebTest extends BrowserTestBase {
/**
* Test node operations.
*/
function testNodeOperations() {
public function testNodeOperations() {
$node1 = $this->drupalCreateNode(['title' => 'node1']);
$node2 = $this->drupalCreateNode(['title' => 'node2']);
......
......@@ -92,7 +92,7 @@ class PathautoSettingsFormWebTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
function setUp() {
protected function setUp() {
parent::setUp();
$this->drupalCreateContentType(['type' => 'article']);
......@@ -112,7 +112,7 @@ class PathautoSettingsFormWebTest extends BrowserTestBase {
/**
* Test if the default values are shown correctly in the form.
*/
function testDefaultFormValues() {
public function testDefaultFormValues() {
$this->drupalGet('/admin/config/search/path/settings');
$this->assertNoFieldChecked('edit-verbose');
$this->assertField('edit-separator', $this->defaultFormValues['separator']);
......@@ -128,7 +128,7 @@ class PathautoSettingsFormWebTest extends BrowserTestBase {
/**
* Test the verbose option.
*/
function testVerboseOption() {
public function testVerboseOption() {
$edit = ['verbose' => '1'];
$this->drupalPostForm('/admin/config/search/path/settings', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'));
......@@ -149,7 +149,7 @@ class PathautoSettingsFormWebTest extends BrowserTestBase {
/**
* Tests generating aliases with different settings.
*/
function testSettingsForm() {
public function testSettingsForm() {
// Ensure the separator settings apply correctly.
$this->checkAlias('My awesome content', '/content/my.awesome.content', ['separator' => '.']);
......@@ -175,7 +175,7 @@ class PathautoSettingsFormWebTest extends BrowserTestBase {
/**
* Test the punctuation setting form items.
*/
function testPunctuationSettings() {
public function testPunctuationSettings() {
// Test the replacement of punctuations.
$settings = [];
foreach ($this->defaultPunctuations as $key => $punctuation) {
......
......@@ -35,7 +35,7 @@ class PathautoTaxonomyWebTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
function setUp() {
protected function setUp() {
parent::setUp();
// Allow other modules to add additional permissions for the admin user.
......@@ -54,7 +54,7 @@ class PathautoTaxonomyWebTest extends BrowserTestBase {
/**
* Basic functional testing of Pathauto with taxonomy terms.
*/
function testTermEditing() {
public function testTermEditing() {
$this->drupalGet('admin/structure');
$this->drupalGet('admin/structure/taxonomy');
......
......@@ -36,7 +36,7 @@ class PathautoUserWebTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
function setUp() {
protected function setUp() {
parent::setUp();
// Allow other modules to add additional permissions for the admin user.
......@@ -55,7 +55,7 @@ class PathautoUserWebTest extends BrowserTestBase {
/**
* Basic functional testing of Pathauto with users.
*/
function testUserEditing() {
public function testUserEditing() {
// There should be no Pathauto checkbox on user forms.
$this->drupalGet('user/' . $this->adminUser->id() . '/edit');
$this->assertNoFieldById('path[0][pathauto]');
......@@ -64,7 +64,7 @@ class PathautoUserWebTest extends BrowserTestBase {
/**
* Test user operations.
*/
function testUserOperations() {
public function testUserOperations() {
$account = $this->drupalCreateUser();
// Delete all current URL aliases.
......
......@@ -44,7 +44,7 @@ class PathautoLocaleTest extends WebDriverTestBase {
* Test that when an English node is updated, its old English alias is
* updated and its newer French alias is left intact.
*/
function testLanguageAliases() {
public function testLanguageAliases() {
$this->createPattern('node', '/content/[node:title]');
......@@ -92,7 +92,7 @@ class PathautoLocaleTest extends WebDriverTestBase {
/**
* Test that patterns work on multilingual content.
*/
function testLanguagePatterns() {
public function testLanguagePatterns() {
// Allow other modules to add additional permissions for the admin user.
$permissions = [
......
......@@ -38,7 +38,7 @@ class PathautoUiTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
function setUp() {
protected function setUp() {
parent::setUp();
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
......@@ -57,7 +57,7 @@ class PathautoUiTest extends WebDriverTestBase {
$this->drupalLogin($this->adminUser);
}
function testSettingsValidation() {
public function testSettingsValidation() {
$this->drupalGet('/admin/config/search/path/settings');
$this->assertSession()->fieldExists('max_length');
......@@ -67,7 +67,7 @@ class PathautoUiTest extends WebDriverTestBase {
$this->assertSession()->elementAttributeContains('css', '#edit-max-component-length', 'min', '1');
}
function testPatternsWorkflow() {
public function testPatternsWorkflow() {
$this->drupalPlaceBlock('local_tasks_block', ['id' => 'local-tasks-block']);
$this->drupalPlaceBlock('local_actions_block');
$this->drupalPlaceBlock('page_title_block');
......
......@@ -363,7 +363,7 @@ class PathautoKernelTest extends KernelTestBase {
/**
* Test using fields for path structures.
*/
function testParentChildPathTokens() {
public function testParentChildPathTokens() {
// First create a field which will be used to create the path. It must
// begin with a letter.
$this->installEntitySchema('taxonomy_term');
......@@ -411,7 +411,7 @@ class PathautoKernelTest extends KernelTestBase {
$this->assertEntityPattern('taxonomy_term', 'name', Language::LANGCODE_NOT_SPECIFIED, 'bundle');
}
function testNoExistingPathAliases() {
public function testNoExistingPathAliases() {
$this->config('pathauto.settings')
->set('punctuation.period', PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING)
->save();
......@@ -444,7 +444,7 @@ class PathautoKernelTest extends KernelTestBase {
/**
* Test programmatic entity creation for aliases.
*/
function testProgrammaticEntityCreation() {
public function testProgrammaticEntityCreation() {
$node = $this->drupalCreateNode(['title' => 'Test node', 'path' => ['pathauto' => TRUE]]);
$this->assertEntityAlias($node, '/content/test-node');
......@@ -474,7 +474,7 @@ class PathautoKernelTest extends KernelTestBase {
/**
* Tests word safe alias truncating.
*/
function testPathAliasUniquifyWordsafe() {
public function testPathAliasUniquifyWordsafe() {
$this->config('pathauto.settings')
->set('max_length', 26)
->save();
......@@ -492,7 +492,7 @@ class PathautoKernelTest extends KernelTestBase {
/**
* Test if aliases are (not) generated with enabled/disabled patterns.
*/
function testPatternStatus() {
public function testPatternStatus() {
// Create a node to get an alias for.
$title = 'Pattern enabled';
$alias = '/content/pattern-enabled';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment