Issue #1760764 by tim.plunkett: Remove usage of Standard profile in tests where possible.

8.0.x
Tim Plunkett 2012-08-28 21:44:59 +02:00
parent 4ea004218c
commit 1f0ac8aa02
13 changed files with 43 additions and 41 deletions

View File

@ -15,7 +15,12 @@ use Drupal\views\View;
*/
abstract class CommentTestBase extends ViewTestBase {
protected $profile = 'standard';
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('comment');
function setUp() {
parent::setUp();

View File

@ -11,6 +11,7 @@ namespace Drupal\views\Tests\Field;
* Test the produced views_data.
*/
class ApiDataTest extends FieldTestBase {
/**
* Stores the fields for this test case.
*/
@ -29,7 +30,6 @@ class ApiDataTest extends FieldTestBase {
$langcode = LANGUAGE_NOT_SPECIFIED;
$field_names = $this->setUpFields();
// The first one will be attached to nodes only.
@ -72,15 +72,6 @@ class ApiDataTest extends FieldTestBase {
$this->nodes[] = $this->drupalCreateNode($edit);
}
$permissions = array('access comments', 'access content', 'post comments', 'skip comment approval');
for ($i = 0; $i < 5; $i++) {
$account = $this->drupalCreateUser($permissions);
$account->field_name_1 = array($langcode => array((array('value' => $this->randomName()))));
$account->field_name_2 = array($langcode => array((array('value' => $this->randomName()))));
$account->save();
$this->users[] = $account;
}
// Reset views data cache.
$cache = &drupal_static('_views_fetch_data' . '_cache');
$recursion_protection = &drupal_static('_views_fetch_data' . '_recursion_protected');
@ -127,7 +118,6 @@ class ApiDataTest extends FieldTestBase {
);
$this->assertEqual($expected_join, $data[$revision_table]['table']['join']['node_revision']);
// Check the table and the joins of the second field.
// Attached to both node and user.
$field_2 = $this->fields[2];
@ -168,18 +158,6 @@ class ApiDataTest extends FieldTestBase {
)
);
$this->assertEqual($expected_join, $data[$current_table_2]['table']['join']['users']);
// Check the fields
// @todo
// Check the arguments
// @todo
// Check the sort criterias
// @todo
// Check the relationships
// @todo
}
}
}

View File

@ -25,8 +25,6 @@ use Drupal\views\Tests\ViewTestBase;
*/
abstract class FieldTestBase extends ViewTestBase {
protected $profile = 'standard';
/**
* Stores the field definitions used by the test.
* @var array

View File

@ -14,8 +14,6 @@ use Drupal\views\View;
*/
class ArgumentDefaultTest extends PluginTestBase {
protected $profile = 'standard';
/**
* A random string used in the default views.
*

View File

@ -12,8 +12,6 @@ namespace Drupal\views\Tests\Plugin;
*/
class ExposedFormTest extends PluginTestBase {
protected $profile = 'standard';
public static function getInfo() {
return array(
'name' => 'Exposed forms',
@ -26,6 +24,9 @@ class ExposedFormTest extends PluginTestBase {
parent::setUp();
$this->enableViewsTestModule();
$this->drupalCreateContentType(array('type' => 'article'));
$this->drupalCreateContentType(array('type' => 'page'));
}
/**

View File

@ -14,13 +14,6 @@ use Drupal\views\View;
*/
class QueryGroupByTest extends ViewTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('node');
public static function getInfo() {
return array(
'name' => 'Groupby',

View File

@ -17,6 +17,13 @@ class RelationshipNodeTermDataTest extends ViewTestBase {
protected $profile = 'standard';
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('taxonomy');
public static function getInfo() {
return array(
'name' => 'Taxonomy: Node term data Relationship',

View File

@ -14,7 +14,12 @@ use Drupal\views\Tests\ViewTestBase;
*/
abstract class UITestBase extends ViewTestBase {
protected $profile = 'standard';
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('block');
protected function setUp() {
parent::setUp();

View File

@ -19,7 +19,7 @@ class ViewTest extends ViewTestBase {
*
* @var array
*/
public static $modules = array('node', 'comment');
public static $modules = array('comment');
public static function getInfo() {
return array(

View File

@ -21,6 +21,9 @@ class BasicTest extends WizardTestBase {
}
function testViewsWizardAndListing() {
$this->drupalCreateContentType(array('type' => 'article'));
$this->drupalCreateContentType(array('type' => 'page'));
// Check if we can access the main views admin page.
$this->drupalGet('admin/structure/views');
$this->assertText(t('Add new view'));

View File

@ -24,6 +24,8 @@ class ItemsPerPageTest extends WizardTestBase {
* Tests the number of items per page.
*/
function testItemsPerPage() {
$this->drupalCreateContentType(array('type' => 'article'));
// Create articles, each with a different creation time so that we can do a
// meaningful sort.
$node1 = $this->drupalCreateNode(array('type' => 'article', 'created' => REQUEST_TIME));

View File

@ -12,6 +12,13 @@ namespace Drupal\views\Tests\Wizard;
*/
class TaggedWithTest extends WizardTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('taxonomy');
protected $node_type_with_tags;
protected $node_type_without_tags;

View File

@ -14,7 +14,12 @@ use Drupal\views\Tests\ViewTestBase;
*/
abstract class WizardTestBase extends ViewTestBase {
protected $profile = 'standard';
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('block');
function setUp() {
parent::setUp();