standardTests example

'version' => '8.x-1.0',
        'hidden' => FALSE,
      ],
    ];
    $this->config('update_test.settings')->set('system_info', $system_info)->save();
    $this->refreshUpdateStatus(
      [
        'drupal' => '0.0',
        'aaa_update_test' => '1_0',
      ]
    );
    $this->standardTests();
    $this->assertSession()->pageTextContains('Up to date');
    $this->assertSession()->responseContains('<h3>Modules</h3>');
    $this->assertSession()->pageTextNotContains('Update available');
    $this->assertSession()->linkExists('AAA Update test');
    $this->assertSession()->linkByHrefExists('http://example.com/project/aaa_update_test');

    // Since aaa_update_test is installed the fact it is hidden and in the     // Testing package means it should not appear.     $system_info['aaa_update_test']['hidden'] = TRUE;
    $this->config('update_test.settings')->set('system_info', $system_info)->save();
    $this->refreshUpdateStatus(
      [

  public function testNoUpdatesAvailable() {
    foreach ([0, 1] as $minor_version) {
      foreach ([0, 1] as $patch_version) {
        foreach (['-alpha1', '-beta1', ''] as $extra_version) {
          $this->setProjectInstalledVersion("8.$minor_version.$patch_version" . $extra_version);
          $this->refreshUpdateStatus([$this->updateProject => "$minor_version.$patch_version" . $extra_version]);
          $this->standardTests();
          // The XML test fixtures for this method all contain the '8.2.0'           // release but because '8.2.0' is not in a supported branch it will           // not be in the available updates.           $this->assertUpdateTableElementNotContains('8.2.0');
          $this->assertUpdateTableTextContains('Up to date');
          $this->assertUpdateTableTextNotContains('Update available');
          $this->assertUpdateTableTextNotContains('Security update required!');
          $this->assertUpdateTableElementContains('check.svg');
        }
      }
    }
  }

  protected function assertSecurityUpdates($project_path_part, array $expected_security_releases$expected_update_message_type$update_element_css_locator) {
    $assert_session = $this->assertSession();
    $page = $this->getSession()->getPage();
    $this->standardTests();
    $assert_session->elementTextNotContains('css', $update_element_css_locator, 'Not supported');
    $all_security_release_urls = array_map(function D$link) {
      return $link->getAttribute('href');
    }$page->findAll('css', "$update_element_css_locator .version-security a[href$='-release']"));
    if ($expected_security_releases) {
      $expected_release_urls = [];
      if ($expected_update_message_type === static::SECURITY_UPDATE_REQUIRED) {
        $assert_session->elementTextNotContains('css', $update_element_css_locator, 'Update available');
        $assert_session->elementTextContains('css', $update_element_css_locator, 'Security update required!');
        // Verify that the error icon is found.         $assert_session->responseContains('error.svg');
      }
Home | Imprint | This part of the site doesn't use cookies.