diff --git a/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php b/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php
index 43e27c25d2d7de95f90de2016e5b5b66b5013780..e2cc4df2523c32306c799f5d378d993157cf8291 100644
--- a/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php
+++ b/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php
@@ -24,7 +24,7 @@ trait TaxonomyTestTrait {
    * @return \Drupal\taxonomy\VocabularyInterface
    *   A vocabulary used for testing.
    */
-  public function createVocabulary(array $values = []) {
+  protected function createVocabulary(array $values = []) {
     $values += [
       'name' => $this->randomMachineName(),
       'description' => $this->randomMachineName(),
@@ -49,7 +49,7 @@ public function createVocabulary(array $values = []) {
    * @return \Drupal\taxonomy\TermInterface
    *   The new taxonomy term object.
    */
-  public function createTerm(VocabularyInterface $vocabulary, $values = []) {
+  protected function createTerm(VocabularyInterface $vocabulary, $values = []) {
     $term = Term::create($values + [
       'name' => $this->randomMachineName(),
       'description' => [