diff --git a/core/modules/taxonomy/src/Tests/TermAutocompleteTest.php b/core/modules/taxonomy/src/Tests/TermAutocompleteTest.php index 471225a..62f6084 100644 --- a/core/modules/taxonomy/src/Tests/TermAutocompleteTest.php +++ b/core/modules/taxonomy/src/Tests/TermAutocompleteTest.php @@ -45,7 +45,7 @@ class TermAutocompleteTest extends TaxonomyTestBase { * * @var string */ - protected $autocomplete_url; + protected $autocompleteUrl; /** * The term IDs indexed by term names. @@ -95,9 +95,9 @@ protected function setUp() { 'entity_type' => 'node', 'type' => 'entity_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, - 'settings' => array( + 'settings' => [ 'target_type' => 'taxonomy_term', - ), + ], ])->save(); FieldConfig::create([ 'field_name' => $this->fieldName, @@ -131,7 +131,7 @@ protected function setUp() { // Retrieve the autocomplete url. $this->drupalGet('node/add/article'); $result = $this->xpath('//input[@name="' . $this->fieldName . '[0][target_id]"]'); - $this->autocomplete_url = $this->getAbsoluteUrl($result[0]['data-autocomplete-path']); + $this->autocompleteUrl = $this->getAbsoluteUrl($result[0]['data-autocomplete-path']); } /** @@ -142,21 +142,21 @@ protected function setUp() { public function testAutocompleteCountResults() { // Test that no matching term found. $data = $this->drupalGetJSON( - $this->autocomplete_url, + $this->autocompleteUrl, ['query' => ['q' => 'zzz']] ); $this->assertTrue(empty($data), 'Autocomplete returned no results'); // Test that only one matching term found, when only one matches. $data = $this->drupalGetJSON( - $this->autocomplete_url, + $this->autocompleteUrl, ['query' => ['q' => 'aaa 10']] ); $this->assertEqual(1, count($data), 'Autocomplete returned 1 result'); // Test the correct number of matches when multiple are partial matches. $data = $this->drupalGetJSON( - $this->autocomplete_url, + $this->autocompleteUrl, ['query' => ['q' => 'aaa 1']] ); $this->assertEqual(3, count($data), 'Autocomplete returned 3 results'); @@ -164,7 +164,7 @@ public function testAutocompleteCountResults() { // Tests that only 10 results are returned, even if there are more than 10 // matches. $data = $this->drupalGetJSON( - $this->autocomplete_url, + $this->autocompleteUrl, ['query' => ['q' => 'aaa']] ); $this->assertEqual(10, count($data), 'Autocomplete returned only 10 results (for over 10 matches)'); @@ -197,7 +197,7 @@ public function testAutocompleteOrderedResults() { } $data = $this->drupalGetJSON( - $this->autocomplete_url, + $this->autocompleteUrl, ['query' => ['q' => 'bbb']] );