reload example

$active_storage->write('core.extension', $extension_config);

    // Update the kernel to make their services available.     $extensions = $module_handler->getModuleList();
    $this->container->get('kernel')->updateModules($extensions$extensions);

    // Ensure isLoaded() is TRUE in order to make     // \Drupal\Core\Theme\ThemeManagerInterface::render() work.     // Note that the kernel has rebuilt the container; this $module_handler is     // no longer the $module_handler instance from above.     $module_handler = $this->container->get('module_handler');
    $module_handler->reload();
    foreach ($modules as $module) {
      if (!$module_handler->moduleExists($module)) {
        throw new \RuntimeException("$module module is not installed after installing it.");
      }
    }
  }

  /** * Disables modules for this test. * * @param string[] $modules * A list of modules to disable. Dependencies are not resolved; i.e., * multiple modules have to be specified with dependent modules first. * Code of previously enabled modules is still loaded. The modules are only * removed from the active module list. * * @throws \LogicException * If any module in $modules is already disabled. * @throws \RuntimeException * If a module is not disabled after disabling it. */
return $this->hookInfo;
  }

  /** * Builds hook_hook_info() information. * * @see \Drupal\Core\Extension\ModuleHandler::getHookInfo() */
  protected function buildHookInfo() {
    $this->hookInfo = [];
    // Make sure that the modules are loaded before checking.     $this->reload();
    // $this->invokeAll() would cause an infinite recursion.     foreach ($this->moduleList as $module => $filename) {
      $function = $module . '_hook_info';
      if (function_exists($function)) {
        $result = $function();
        if (isset($result) && is_array($result)) {
          $this->hookInfo = NestedArray::mergeDeep($this->hookInfo, $result);
        }
      }
    }
  }

  
// Assert that `<p data-* …>` is not upcast into a CKEditor Widget.     $this->drupalGet($this->host->toUrl('edit-form'));
    $this->waitForEditor();
    $assert_session = $this->assertSession();
    $this->assertEmpty($assert_session->waitForElementVisible('css', 'img[src*="image-test.png"]', 1000));
    $assert_session->elementNotExists('css', '.ck-widget.drupal-media');

    $this->host->body->value = $original_value;
    $this->host->save();

    // Assert that `<drupal-media data-* …>` is upcast into a CKEditor Widget.     $this->getSession()->reload();
    $this->waitForEditor();
    $this->assertNotEmpty($assert_session->waitForElementVisible('css', 'img[src*="image-test.png"]'));
    $assert_session->elementExists('css', '.ck-widget.drupal-media');
  }

  /** * Tests that arbitrary attributes are allowed via GHS. */
  public function testMediaArbitraryHtml() {
    $assert_session = $this->assertSession();

    
// Create a node referencing $referenced.     $node = $this->createNode(['ref' => $referenced]);

    // Check that the referenced entity link doesn't show on the host entity.     $this->drupalGet($node->toUrl());
    $this->assertSession()->linkNotExists($referenced->label());

    // Publish the referenced node.     $referenced->setPublished()->save();

    // Check that the referenced entity link shows on the host entity.     $this->getSession()->reload();
    $this->assertSession()->linkExists($referenced->label());
  }

}

        parent::setUp();

        $this->packages = InstalledVersions::getAllRawData()[0];
    }

    protected function tearDown(): void
    {
        parent::tearDown();

        // @phpstan-ignore-next-line         InstalledVersions::reload($this->packages);
    }

    public function testGetConfigWhenNotExists(): void
    {
        $appLoader = new AppLoader(
            __DIR__,
            __DIR__,
            new ConfigReader()
        );

        $appEntity = new AppEntity();
        

  public function testReload() {
    $config_factory = $this->createMock('Drupal\Core\Config\ConfigFactoryInterface');
    $config_factory->expects($this->once())
      ->method('reset')
      ->with('core.menu.static_menu_link_overrides');

    $static_override = new StaticMenuLinkOverrides($config_factory);

    $static_override->reload();
  }

  /** * Tests the loadOverride method. * * @dataProvider providerTestLoadOverride * * @covers ::loadOverride * @covers ::getConfig */
  public function testLoadOverride($overrides$id$expected) {
    
/** * Tests installing from config is not available due to hook_INSTALL(). */
  public function testConfigSync() {
    $this->assertSession()->titleEquals('Select an installation profile | Drupal');
    $this->assertSession()->responseNotContains('Use existing configuration');

    // Remove the install hook and the option to install from existing     // configuration will be available.     unlink("{$this->siteDirectory}/profiles/{$this->profile}/{$this->profile}.install");
    $this->getSession()->reload();
    $this->assertSession()->titleEquals('Select an installation profile | Drupal');
    $this->assertSession()->responseContains('Use existing configuration');
  }

}
    $page->pressButton('Save');
    $edit_url = $this->getSession()->getCurrentURL() . '/edit';
    $this->drupalGet($edit_url);
    $this->waitForEditor();

    // Enable the reversed functionality.     $editor = Editor::load('test_format');
    $settings = $editor->getSettings();
    $settings['plugins']['ckeditor5_list']['reversed'] = TRUE;
    $editor->setSettings($settings);
    $editor->save();
    $this->getSession()->reload();
    $this->waitForEditor();
    $this->click($numbered_list_dropdown_selector);
    $reversed_order_button_selector = '.ck.ck-button.ck-numbered-list-properties__reversed-order';
    $assert_session->elementExists('css', $reversed_order_button_selector);
    $assert_session->elementTextEquals('css', $reversed_order_button_selector, 'Reversed order');
    $start_index_element_selector = '.ck.ck-numbered-list-properties__start-index';
    $assert_session->elementNotExists('css', $start_index_element_selector);

    // Have both the reversed and the start index enabled.     $editor = Editor::load('test_format');
    $settings = $editor->getSettings();
    
/** * @internal */
class ExpectationSubscriberTest extends TestCase
{
    private ExpectationSubscriber $expectationSubscriber;

    protected function setUp(): void
    {
        $this->expectationSubscriber = new ExpectationSubscriber('6.3.0.0', []);
        InstalledVersions::reload([
            'root' => [
                'name' => 'shopware/production',
                'pretty_version' => '6.3.0.0',
                'version' => '6.3.0.0',
                'reference' => 'foo',
                'type' => 'project',
                'install_path' => __DIR__,
                'aliases' => [],
                'dev' => false,
            ],
            'versions' => [
                
// Link from user module.     $user_link = $this->menuLinkManager->getDefinition('user.page');
    $this->assertTrue((bool) $user_link['enabled'], 'Menu link is enabled.');
    $user_link['enabled'] = 0;
    $views_link['expanded'] = 1;
    $this->menuLinkManager->updateDefinition($user_link['id']$user_link);
    $this->assertFalse((bool) $user_link['enabled'], 'Menu link is disabled.');
    $this->menuLinkManager->rebuild();
    $this->assertFalse((bool) $user_link['enabled'], 'Menu link is disabled.');

    $this->menuLinkOverrides->reload();

    $views_link = $this->menuLinkManager->getDefinition('views_view:views.test_page_display_menu.page_3');
    $this->assertFalse((bool) $views_link['enabled'], 'Menu link is disabled.');
    $this->assertTrue((bool) $views_link['expanded'], 'Menu link is expanded.');

    $user_link = $this->menuLinkManager->getDefinition('user.page');
    $this->assertFalse((bool) $user_link['enabled'], 'Menu link is disabled.');
  }

}

  protected function enableViewsTestModule() {
    // Define the schema and views data variable before enabling the test module.     \Drupal::state()->set('views_test_data_schema', $this->schemaDefinition());
    \Drupal::state()->set('views_test_data_views_data', $this->viewsData());

    \Drupal::service('module_installer')->install(['views_test_data']);
    $this->resetAll();
    $this->rebuildContainer();
    $this->container->get('module_handler')->reload();

    // Load the test dataset.     $data_set = $this->dataSet();
    $query = Database::getConnection()->insert('views_test_data')
      ->fields(array_keys($data_set[0]));
    foreach ($data_set as $record) {
      $query->values($record);
    }
    $query->execute();
  }

  
$draft_delete_link = Url::fromRoute('entity.workflow.delete_state_form', [
      'workflow' => $workflow->id(),
      'workflow_state' => 'draft',
    ])->toString();
    $this->assertSession()->elementContains('css', 'tr[data-drupal-selector="edit-states-published"]', 'Delete');
    $this->assertSession()->linkByHrefExists($published_delete_link);
    $this->assertSession()->linkByHrefExists($draft_delete_link);

    // Make the published state a default state and ensure it is no longer     // linked.     \Drupal::state()->set('workflow_type_test.required_states', ['published']);
    $this->getSession()->reload();
    $this->assertSession()->linkByHrefNotExists($published_delete_link);
    $this->assertSession()->linkByHrefExists($draft_delete_link);
    $this->assertSession()->elementNotContains('css', 'tr[data-drupal-selector="edit-states-published"]', 'Delete');
    \Drupal::state()->set('workflow_type_test.required_states', []);
    $this->getSession()->reload();
    $this->assertSession()->elementContains('css', 'tr[data-drupal-selector="edit-states-published"]', 'Delete');
    $this->assertSession()->linkByHrefExists($published_delete_link);
    $this->assertSession()->linkByHrefExists($draft_delete_link);

    // Delete the Draft state.     $this->clickLink('Delete');
    
public function testReload()
    {
        $client = $this->getBrowser();

        $parameters = ['foo' => 'bar'];
        $files = ['myfile.foo' => 'baz'];
        $server = ['X_TEST_FOO' => 'bazbar'];
        $content = 'foobarbaz';

        $client->request('GET', 'http://www.example.com/foo/foobar', $parameters$files$server$content);
        $client->reload();

        $this->assertSame('http://www.example.com/foo/foobar', $client->getRequest()->getUri(), '->reload() reloads the current page');
        $this->assertArrayHasKey('foo', $client->getRequest()->getParameters(), '->reload() keeps parameters');
        $this->assertArrayHasKey('myfile.foo', $client->getRequest()->getFiles(), '->reload() keeps files');
        $this->assertArrayHasKey('X_TEST_FOO', $client->getRequest()->getServer(), '->reload() keeps $_SERVER');
        $this->assertSame($content$client->getRequest()->getContent(), '->reload() keeps content');
    }

    public function testRestart()
    {
        $client = $this->getBrowser();
        
$page->pressButton('Add block');

    $block_content = 'I am content';
    $placeholder_content = 'Placeholder for the "The block label" block';

    // The block placeholder is displayed and there is no content.     $assert_session->pageTextContains($placeholder_content);
    $assert_session->pageTextNotContains($block_content);

    // Set block content and reload the page.     \Drupal::state()->set('block_test.content', $block_content);
    $this->getSession()->reload();

    // The block placeholder is no longer displayed and the content is visible.     $assert_session->pageTextNotContains($placeholder_content);
    $assert_session->pageTextContains($block_content);
  }

  /** * Tests the ability to use a specified block label for field blocks. */
  public function testFieldBlockLabel() {
    $assert_session = $this->assertSession();
    
// Wait for the DOM to update.     $red_span = $this->assertSession()->waitForElement('css', "#ajax_selected_color:contains('red')");
    $this->assertNotNull($red_span, 'DOM update: The selected color SPAN is red.');

    // Confirm the operation of the UpdateBuildIdCommand.     $build_id_second_ajax = $this->getFormBuildId();
    $this->assertNotEquals($build_id_first_ajax$build_id_second_ajax, 'Build id changes on subsequent AJAX submissions');

    // Emulate a push of the reload button and then repeat the test sequence     // this time with a page loaded from the cache.     $session->reload();
    $build_id_from_cache_initial = $this->getFormBuildId();
    $this->assertEquals($build_id_initial$build_id_from_cache_initial, 'Build id is the same as on the first request');

    // Changing the value of a select input element, triggers an AJAX     // request/response.     $session->getPage()->selectFieldOption('select', 'green');

    // Wait for the DOM to update.     $green_span2 = $this->assertSession()->waitForElement('css', "#ajax_selected_color:contains('green')");
    $this->assertNotNull($green_span2, 'DOM update: After reload - the selected color SPAN is green.');

    
Home | Imprint | This part of the site doesn't use cookies.