Skip to content
Snippets Groups Projects
Commit 1e0505a7 authored by Kevin Kaland's avatar Kevin Kaland
Browse files

Issue #1905070: Port test to Drupal 8.

Fix fails along the way and create a config schema so that I can test
properly.
parent f883ad69
No related branches found
No related tags found
No related merge requests found
fillpdf.settings:
type: config_object
mapping:
remote_protocol:
type: string
label: 'FillPDF Service endpoint protocol'
remote_endpoint:
type: string
label: 'FillPDF Service endpoint URL without protocol'
scheme:
type: string
label: 'Filesystem scheme for uploads'
......@@ -10,3 +10,4 @@ dependencies:
- token
- views
- serialization
- options
......@@ -6,6 +6,7 @@
namespace Drupal\fillpdf\Form;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\File\FileSystemInterface;
......@@ -109,7 +110,7 @@ class FillPdfOverviewForm extends FillPdfAdminFormBase {
];
}
else {
drupal_set_message($this->t('You must install the <a href="@xmlrpc">contributed XML-RPC module</a> in order to use FillPDF Service as your PDF-filling method.', [
drupal_set_message($this->t('You must install the <a href=":xmlrpc">contributed XML-RPC module</a> in order to use FillPDF Service as your PDF-filling method.', [
'@xmlrpc' => Url::fromUri('https://drupal.org/project/xmlrpc')
->toString(),
]), 'error');
......@@ -117,7 +118,7 @@ class FillPdfOverviewForm extends FillPdfAdminFormBase {
}
else {
$form['message'] = [
'#markup' => '<p>' . $this->t('Before you can upload PDF files, you must !link.', ['!link' => $this->l($this->t('configure FillPDF'), Url::fromRoute('fillpdf.settings'))]) . '</p>',
'#markup' => '<p>' . $this->t('Before you can upload PDF files, you must @link.', ['@link' => new FormattableMarkup($this->l($this->t('configure FillPDF'), Url::fromRoute('fillpdf.settings')), [])]) . '</p>',
];
drupal_set_message($this->t('FillPDF is not configured.'), 'error');
}
......
<?php
/**
* @file fillpdf.test
* Contains tests for the module.
*/
namespace Drupal\fillpdf\Tests;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
/**
* Ensure the overview form at /admin/structure/fillpdf functions correctly.
*
* @ingroup fillpdf
*
* @group fillpdf
*/
class FillPdfOverviewFormTest extends WebTestBase {
static public $modules = ['fillpdf'];
protected $profile = 'minimal';
public function testUploadForm() {
// Create and log in our privileged user.
$user = $this->createUser([
'access administration pages',
'administer pdfs',
]);
$this->drupalLogin($user);
$this->drupalGet(Url::fromRoute('fillpdf.forms_admin'));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment