diff --git a/src/Utils.php b/src/Utils.php index 544a61f..3a410d0 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -3,10 +3,8 @@ namespace Drupal\opencase; use \Drupal; -use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Entity\Query\QueryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use RuntimeException; class Utils { @@ -40,7 +38,7 @@ class Utils { */ public function getTidByName(string $name, string $vid):int { if (empty($name) || empty($vid)) { - return 0; + return 0; } $properties = [ 'name' => $name, diff --git a/tests/src/Unit/UtilsTest.php b/tests/src/Unit/UtilsTest.php index 5e51445..f3da7a1 100644 --- a/tests/src/Unit/UtilsTest.php +++ b/tests/src/Unit/UtilsTest.php @@ -16,7 +16,6 @@ class UtilsTest extends UnitTestCase{ } public function testGetTidByNameGetsTid():void { - $this->entityTypeManager->method('getStorage')->willReturn($this->storage); $term_entity = $this->getMockBuilder('\\Drupal\\Core\\Entity\\EntityBase')->disableOriginalConstructor()->getMock(); $term_entity->expects($this->once())->method('id')->willReturn('3'); $this->storage->expects($this->once())->method('loadByProperties')->with(['name' => 'foo', 'vid' => 'bar'])