BlockPluginHasSettingsTrayFormAccessCheck example

if ($with_forms) {
      $block_plugin->willImplement(PluginWithFormsInterface::class);
      $block_plugin->hasFormClass(Argument::type('string'))->will(function D$arguments) use ($plugin_definition) {
        return !empty($plugin_definition['forms'][$arguments[0]]);
      });
    }

    $block = $this->prophesize(BlockInterface::class);
    $block->getPlugin()->willReturn($block_plugin->reveal());

    $access_check = new BlockPluginHasSettingsTrayFormAccessCheck();
    $this->assertEquals($expected_access_result$access_check->access($block->reveal()));
    $this->assertEquals($expected_access_result$access_check->accessBlockPlugin($block_plugin->reveal()));
  }

  /** * Provides test data for ::testAccess(). */
  public static function providerTestAccess() {
    $annotation_forms_settings_tray_class = [
      'forms' => [
        'settings_tray' => Random::machineName(),
      ],
Home | Imprint | This part of the site doesn't use cookies.