I used this
$this->termStorage->loadByProperties(['name' => 'test']);
I got two terms: Test, test.
I want to get only one: test
This is working without case-sensitive:
$this->termStorage->getQuery()->condition('name', 'test', '=')->execute();
\Drupal::database()->select('taxonomy_term_field_data', 't')
->condition('t.name', 'test')
->fields('t', ['name'])
->execute()
->fetchAll();
\Drupal::database()->query("SELECT name FROM taxonomy_term_field_data WHERE name='test'")->fetchAll();