removed unused code
This commit is contained in:
parent
9862e65ea9
commit
a228ea5554
@ -3,10 +3,8 @@
|
|||||||
namespace Drupal\opencase;
|
namespace Drupal\opencase;
|
||||||
|
|
||||||
use \Drupal;
|
use \Drupal;
|
||||||
use Drupal\Core\Entity\EntityTypeManager;
|
|
||||||
use Drupal\Core\Entity\Query\QueryInterface;
|
use Drupal\Core\Entity\Query\QueryInterface;
|
||||||
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
||||||
use RuntimeException;
|
|
||||||
|
|
||||||
class Utils {
|
class Utils {
|
||||||
|
|
||||||
@ -40,7 +38,7 @@ class Utils {
|
|||||||
*/
|
*/
|
||||||
public function getTidByName(string $name, string $vid):int {
|
public function getTidByName(string $name, string $vid):int {
|
||||||
if (empty($name) || empty($vid)) {
|
if (empty($name) || empty($vid)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$properties = [
|
$properties = [
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
|
@ -16,7 +16,6 @@ class UtilsTest extends UnitTestCase{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testGetTidByNameGetsTid():void {
|
public function testGetTidByNameGetsTid():void {
|
||||||
$this->entityTypeManager->method('getStorage')->willReturn($this->storage);
|
|
||||||
$term_entity = $this->getMockBuilder('\\Drupal\\Core\\Entity\\EntityBase')->disableOriginalConstructor()->getMock();
|
$term_entity = $this->getMockBuilder('\\Drupal\\Core\\Entity\\EntityBase')->disableOriginalConstructor()->getMock();
|
||||||
$term_entity->expects($this->once())->method('id')->willReturn('3');
|
$term_entity->expects($this->once())->method('id')->willReturn('3');
|
||||||
$this->storage->expects($this->once())->method('loadByProperties')->with(['name' => 'foo', 'vid' => 'bar'])
|
$this->storage->expects($this->once())->method('loadByProperties')->with(['name' => 'foo', 'vid' => 'bar'])
|
||||||
|
Reference in New Issue
Block a user