Commit 9f4034ac authored by alexpott's avatar alexpott

Issue #2642236 by TR: Various setUp() and tearDown() methods are not protected (the sequel)

parent f290489d
......@@ -23,7 +23,7 @@ class CommentInterfaceTest extends CommentTestBase {
/**
* Set up comments to have subject and preview disabled.
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->drupalLogin($this->adminUser);
// Make sure that comment field title is not displayed when there's no
......
......@@ -27,7 +27,7 @@ class CacheabilityMetadataConfigOverrideIntegrationTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// @todo If our block does not contain any content then the cache context
......
......@@ -32,7 +32,7 @@ class CacheabilityMetadataConfigOverrideTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installEntitySchema('block_content');
$this->installConfig(['config_override_test']);
......
......@@ -41,7 +41,7 @@ class ConfigEntityStaticCacheTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->entityTypeId = 'config_test';
$this->entityId = 'test_1';
......
......@@ -24,7 +24,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Add some basic test nodes.
......
......@@ -40,7 +40,7 @@ abstract class DateTimeHandlerTestBase extends HandlerTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Add a date field to page nodes.
......
......@@ -32,7 +32,7 @@ class FilterDateTest extends DateTimeHandlerTestBase {
*
* Create nodes with relative dates of yesterday, today, and tomorrow.
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Set to 'today'.
......
......@@ -34,7 +34,7 @@ class FilterDateTimeTest extends DateTimeHandlerTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
static::$date = REQUEST_TIME + 86400;
......
......@@ -24,7 +24,7 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Add some basic test nodes.
......
......@@ -49,7 +49,7 @@ class SqlContentEntityStorageSchemaColumnTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installEntitySchema('entity_test_rev');
......
......@@ -36,7 +36,7 @@ class SelectionTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Create nodes.
......
......@@ -35,7 +35,7 @@ class FieldDefaultValueCallbackTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->fieldName = 'field_test';
......
......@@ -22,7 +22,7 @@ class FieldTypeDefaultsTest extends MigrateProcessTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->plugin = new FieldTypeDefaults([], 'field_type_defaults', []);
}
......
......@@ -37,7 +37,7 @@ class EntityFileTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->destination = new TestEntityFile([]);
$this->destination->streamWrapperManager = \Drupal::getContainer()->get('stream_wrapper_manager');
......
......@@ -21,7 +21,7 @@ class ForumBreadcrumbBuilderBaseTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
......
......@@ -21,7 +21,7 @@ class ForumListingBreadcrumbBuilderTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
......
......@@ -21,7 +21,7 @@ class ForumNodeBreadcrumbBuilderTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
......
......@@ -24,7 +24,7 @@ class MigrateImageCacheTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installConfig(['image']);
}
......
......@@ -90,7 +90,7 @@ protected function getImageStyleMock($image_effect_id, $image_effect, $stubs = a
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->entityTypeId = $this->randomMachineName();
$this->provider = $this->randomMachineName();
$this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
......
......@@ -47,7 +47,7 @@ class DenyPrivateImageStyleDownloadTest extends UnitTestCase {
*/
protected $routeMatch;
public function setUp() {
protected function setUp() {
$this->routeMatch = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
$this->policy = new DenyPrivateImageStyleDownload($this->routeMatch);
$this->response = new Response();
......
......@@ -45,7 +45,7 @@ class MigrateImageStylesTest extends MigrateSqlSourceTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
foreach ($this->expectedResults as $k => $row) {
foreach (array('isid', 'name', 'label') as $field) {
$this->databaseContents['image_styles'][$k][$field] = $row[$field];
......
......@@ -28,7 +28,7 @@ class EntityDefaultLanguageTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installEntitySchema('user');
......
......@@ -56,7 +56,7 @@ class LanguageConfigOverrideTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->storage = $this->getMock('Drupal\Core\Config\StorageInterface');
$this->eventDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->typedConfig = $this->getMock('\Drupal\Core\Config\TypedConfigManagerInterface');
......
......@@ -27,7 +27,7 @@ class LocaleLocaleLookupTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Change the language default object to different values.
......
......@@ -173,7 +173,7 @@ class MenuLinkSourceTest extends MigrateSqlSourceTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->databaseContents['menu_links'] = $this->expectedResults;
// Add long link title attributes.
......
......@@ -43,7 +43,7 @@ class MigrateEventsTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->state = \Drupal::state();
\Drupal::service('event_dispatcher')->addListener(MigrateEvents::MAP_SAVE,
......
......@@ -32,7 +32,7 @@ class MigrateInterruptionTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
\Drupal::service('event_dispatcher')->addListener(MigrateEvents::POST_ROW_SAVE,
array($this, 'postRowSaveEventRecorder'));
......
......@@ -46,7 +46,7 @@ class MigrateMessageTest extends KernelTestBase implements MigrateMessageInterfa
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installConfig(['system']);
......
......@@ -61,7 +61,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->database = $this->getDatabase([]);
}
......
......@@ -39,7 +39,7 @@ class MigrationStorageTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->query = $this->getMock(QueryInterface::class);
$this->query->method('condition')
->willReturnSelf();
......
......@@ -43,7 +43,7 @@ class EntityContentBaseTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->migration = $this->prophesize(MigrationInterface::class);
......
......@@ -41,7 +41,7 @@ class EntityRevisionTest extends UnitTestCase {
*/
protected $fieldTypeManager;
public function setUp() {
protected function setUp() {
parent::setUp();
// Setup mocks to be used when creating a revision destination.
......
......@@ -24,7 +24,7 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Create a field on the user entity so that we can test nested property
......
......@@ -21,7 +21,7 @@ class MigrateNodeBundleSettingsTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installConfig(['node']);
$this->executeMigration('d6_node_type');
......
......@@ -47,7 +47,7 @@ class DenyNodePreviewTest extends UnitTestCase {
*/
protected $routeMatch;
public function setUp() {
protected function setUp() {
$this->routeMatch = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
$this->policy = new DenyNodePreview($this->routeMatch);
$this->response = new Response();
......
......@@ -28,7 +28,7 @@ class ViewsDataTest extends OptionsTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$field_name = 'test_options';
......
......@@ -32,7 +32,7 @@ class StringFieldRdfaTest extends FieldRdfaTestBase {
*/
protected $testSummary = 'test_summary_value';
public function setUp() {
protected function setUp() {
parent::setUp();
$this->createTestField();
......
......@@ -36,7 +36,7 @@ class ComplexDataNormalizerTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->normalizer = new ComplexDataNormalizer();
}
......
......@@ -45,7 +45,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->normalizer = new EntityReferenceFieldItemNormalizer();
$this->serializer = $this->prophesize(Serializer::class);
......
......@@ -24,7 +24,7 @@ class SimpleTestBrowserTest extends WebTestBase {
*/
public static $modules = array('simpletest', 'test_page_test');
public function setUp() {
protected function setUp() {
parent::setUp();
// Create and log in an admin user.
$this->drupalLogin($this->drupalCreateUser(array('administer unit tests')));
......
......@@ -17,7 +17,7 @@ class AjaxFormPageCacheTest extends AjaxTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$config = $this->config('system.performance');
......
......@@ -91,7 +91,7 @@ class ResolvedLibraryDefinitionsFilesMatchTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->themeHandler = $this->container->get('theme_handler');
......
......@@ -26,7 +26,7 @@ class EntitySchemaTest extends EntityUnitTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installSchema('user', array('users_data'));
$this->installSchema('system', array('router'));
......
......@@ -44,7 +44,7 @@ class UpdateApiEntityDefinitionUpdateTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->entityManager = $this->container->get('entity.manager');
......
......@@ -32,7 +32,7 @@ class ValidReferenceConstraintValidatorTest extends EntityUnitTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installSchema('user', array('users_data'));
$this->typedData = $this->container->get('typed_data_manager');
......
......@@ -54,7 +54,7 @@ class StableLibraryOverrideTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->themeManager = $this->container->get('theme.manager');
......
......@@ -40,7 +40,7 @@ class StableThemeTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->themeHandler = $this->container->get('theme_handler');
......
......@@ -81,7 +81,7 @@ public function containerBuild(ContainerBuilder $container) {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Determine what database backend is running, and set the skip flag.
......
......@@ -31,7 +31,7 @@ public function setDatabaseDumpFiles() {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
/** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
$theme_handler = \Drupal::service('theme_handler');
......
......@@ -29,7 +29,7 @@ public function setDatabaseDumpFiles() {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
/** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
$theme_handler = \Drupal::service('theme_handler');
......
......@@ -37,7 +37,7 @@ class UpdateSchemaTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
require_once \Drupal::root() . '/core/includes/update.inc';
......
......@@ -27,7 +27,7 @@ class DbDumpCommandTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Determine what database backend is running, and set the skip flag.
......
......@@ -37,7 +37,7 @@ class TaxonomyTermArgumentDepthTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Create a term with markup in the label.
......
......@@ -39,7 +39,7 @@ class TaxonomyTermFilterDepthTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
// Create a hierarchy 3 deep. Note the parent setup function creates two
......
......@@ -32,7 +32,7 @@ class TextFieldTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->plugin = new TextField([], 'text', []);
$migration = $this->prophesize(MigrationInterface::class);
......
......@@ -25,7 +25,7 @@ class AllowToolbarPathTest extends UnitTestCase {
*/
protected $policy;
public function setUp() {
protected function setUp() {
$this->policy = new AllowToolbarPath();
}
......
......@@ -61,7 +61,7 @@ class UserAccessControlHandlerTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$cache_contexts_manager = $this->prophesize(CacheContextsManager::class);
......
......@@ -32,7 +32,7 @@ class FieldDropButtonTest extends HandlerTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser(['access content overview', 'administer nodes', 'bypass node access']);
......
......@@ -24,7 +24,7 @@ class PluginBaseTest extends KernelTestBase {
*/
var $testPluginBase;
public function setUp() {
protected function setUp() {
parent::setUp();
$this->testPluginBase = new TestPluginBase();
}
......
......@@ -43,7 +43,7 @@ class EntityOperationsUnitTest extends UnitTestCase {
*
* @covers ::__construct
*/
public function setUp() {
protected function setUp() {
$this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
$this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
......
......@@ -46,7 +46,7 @@ class ViewsHandlerManagerTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->viewsData = $this->getMockBuilder('Drupal\views\ViewsData')
->disableOriginalConstructor()
->getMock();
......
......@@ -25,7 +25,7 @@ class CacheCollectorTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->installSchema('system', ['semaphore']);
}
......
......@@ -25,7 +25,7 @@ public function testDrupalSetMessage() {
$this->assertEquals('A message: bar', (string) $messages['status'][0]);
}
public function tearDown() {
protected function tearDown() {
// Clear session to prevent global leakage.
unset($_SESSION['messages']);
parent::tearDown();
......
......@@ -48,7 +48,7 @@ class StableTemplateOverrideTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->themeHandler = $this->container->get('theme_handler');
......
......@@ -49,7 +49,7 @@ class ContainerTest extends \PHPUnit_Framework_TestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->machineFormat = TRUE;
$this->containerClass = '\Drupal\Component\DependencyInjection\Container';
$this->containerDefinition = $this->getMockContainerDefinition();
......
......@@ -58,7 +58,7 @@ class OptimizedPhpArrayDumperTest extends \PHPUnit_Framework_TestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
// Setup a mock container builder.
$this->containerBuilder = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerBuilder');
$this->containerBuilder->getAliases()->willReturn(array());
......
......@@ -18,7 +18,7 @@ class PhpArrayDumperTest extends OptimizedPhpArrayDumperTest {
/**
* {@inheritdoc}
*/
public function setUp() {