/** * @covers ::pluginManager */ public function testPluginManager() { $container = new Container(); $plugin_manager = $this->getMock('\\Drupal\\Component\\Plugin\\PluginManagerInterface'); $container->set('plugin.manager.userprotect.user_protection', $plugin_manager); \Drupal::setContainer($container); $this->assertSame($plugin_manager, UserProtect::pluginManager()); }
/** * {@inheritdoc} */ public function getProtections() { if (!isset($this->protectionsCollection)) { $this->protectionsCollection = new UserProtectionPluginCollection(UserProtect::pluginManager(), $this->protections); } return $this->protectionsCollection; }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->manager = UserProtect::pluginManager(); $this->protectionRule = entity_create('userprotect_rule', array('name' => 'dummy', 'label' => 'Dummy', 'protections' => array('user_mail' => array('status' => TRUE)), 'protectedEntityTypeId' => 'user_role', 'protectedEntityId' => 'administrator')); }