Skip to content
Snippets Groups Projects
Commit 47199417 authored by Liam Morland's avatar Liam Morland
Browse files

ISTWCMS-2587: Create minimal test

parent 976742a6
No related branches found
No related tags found
7 merge requests!433ISTWCMS-6296 Create test for all event dates test cases,!136Istwcms 4725 ebremner config sync,!63Feature/istwcms 4512 l26yan add first last name fields to users,!48Feature/istwcms 4465 l26yan remove paragraphs edit from base profile,!9Feature/istwcms 4139 l26yan update leaflet,!8Feature/istwcms 4156 l26yan set up catalogs terms,!2Feature/istwcms 4137 ebremner use linkit
......@@ -12,3 +12,23 @@ imageMagick 8.x-2.x-beta1-uw_wcms
* Base: 8.x-2.0-beta1
* Patch 60b739: Fix Animated GIF resizing.
https://www.drupal.org/node/1802534#comment-12246133
## Testing
To prepare a Drupal install for testing with PHPUnit, copy
DRUPAL_ROOT/core/phpunit.xml.dist to phpunit.xml and in that file set:
SIMPLETEST_BASE_URL to the BASE_URL for your site.
SIMPLETEST_DB to the database URL following the pattern in the file.
SYMFONY_DEPRECATIONS_HELPER to "weak".
Tests can be run from the Drupal UI. To run tests from the command line,
run this in the DRUPAL_ROOT:
sudo --user www-data vendor/bin/phpunit -c core <test-file>
Where <test-file> is like:
profiles/uw_base_profile/tests/src/Functional/UwWcmsBasicTest.php
Tests need to run with sudo because they need to run as the user that
runs the web server.
<?php
namespace Drupal\Tests\uw_base_profile\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Basic WCMS test.
*
* @group UwWcms
*/
class UwWcmsBasicTest extends BrowserTestBase {
/**
* See https://www.drupal.org/node/1911318.
*
* @var string
*/
protected $profile = 'uw_base_profile';
/**
* It would be better if we didn't need this, but tests fail without it.
*
* @var bool
*/
protected $strictConfigSchema = FALSE;
/**
* Basic test.
*/
public function testPage() {
$this->drupalGet('');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('200 University Avenue West');
}
}
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