diff --git a/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php b/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php index a125290..b048007 100644 --- a/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php +++ b/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php @@ -112,11 +112,7 @@ public function save($name, $data) { } } $full_path = $this->getFullPath($name, $directory, $mtime); - print_r("rename\n"); - print_r($temporary_path . "\n"); - print_r($full_path . "\n"); rename($temporary_path, $full_path); - print_r("rename end\n"); $i++; } return TRUE; diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php index 0446031..fe5e1ae 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php @@ -68,6 +68,9 @@ class Connection extends DatabaseConnection { public function __construct(\PDO $connection, array $connection_options) { parent::__construct($connection, $connection_options); + // We don't need a specific PDOStatement class here, we simulate it below. + $this->statementClass = NULL; + // This driver defaults to transaction support, except if explicitly passed FALSE. $this->transactionSupport = $this->transactionalDDLSupport = !isset($connection_options['transactions']) || $connection_options['transactions'] !== FALSE; diff --git a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php index 96359ec..adddda1 100644 --- a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php +++ b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php @@ -43,7 +43,7 @@ * * @var bool */ - protected $debug = FALSE; + protected $debug = TRUE; /** * Modules to enable. diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index e0bf4f2..0607702 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -23,7 +23,6 @@ use Drupal\Core\Site\Settings; use Drupal\simpletest\AssertContentTrait; use Drupal\simpletest\TestBase; -use org\bovigo\vfs\vfsStream; use Symfony\Component\DependencyInjection\Parameter; use Drupal\Core\StreamWrapper\StreamWrapperInterface; use Symfony\Component\DependencyInjection\Reference; @@ -177,8 +176,6 @@ protected function setUp() { // Restore and merge settings. // DrupalKernel::boot() initializes new Settings, and the containerBuild() // method sets additional settings. - print_r(123); - print_r($settings + Settings::getAll()); new Settings($settings + Settings::getAll()); // Create and set new configuration directories. diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index 0e7e18a..d533c66 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -8,6 +8,7 @@ namespace Drupal\simpletest; use Drupal\Component\Utility\Crypt; +use Drupal\Component\Utility\Random; use Drupal\Core\Database\Database; use Drupal\Component\Utility\String; use Drupal\Core\Config\ConfigImporter; @@ -21,7 +22,6 @@ use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\Utility\Error; -use Drupal\simpletest\RandomGeneratorTrait; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\DependencyInjection\Reference; diff --git a/core/modules/simpletest/tests/src/Unit/TestBaseTest.php b/core/modules/simpletest/tests/src/Unit/TestBaseTest.php index f5e3e24..69dfdf7 100644 --- a/core/modules/simpletest/tests/src/Unit/TestBaseTest.php +++ b/core/modules/simpletest/tests/src/Unit/TestBaseTest.php @@ -17,11 +17,11 @@ class TestBaseTest extends UnitTestCase { /** - * TestBase class stub. + * A stub built using the TestBase class. * - * @var \Drupal\simpletest\TestBase + * @var \Drupal\simpletest\TestBase|\PHPUnit_Framework_MockObject_MockObject */ - private $stub; + protected $stub; protected function setUp() { $this->stub = new StubTestBase(0); diff --git a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php b/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php index 29bf4be..24e002d 100644 --- a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php +++ b/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php @@ -56,7 +56,7 @@ function testReadOnlyBehavior() { $handle = fopen($uri, 'r'); $this->assertTrue($handle, 'Able to open a file for reading with the read-only stream wrapper.'); // Attempt to change file permissions - $this->assertFalse(@drupal_chmod($uri, 0777), 'Unable to change file permissions when using read-only stream wrapper.'); + $this->assertFalse(\Drupal::service('file_system')->chmod($uri, 0777), 'Unable to change file permissions when using read-only stream wrapper.'); // Attempt to acquire an exclusive lock for writing $this->assertFalse(@flock($handle, LOCK_EX | LOCK_NB), 'Unable to acquire an exclusive lock using the read-only stream wrapper.'); // Attempt to obtain a shared lock diff --git a/core/modules/views/src/Tests/Handler/AreaTextTest.php b/core/modules/views/src/Tests/Handler/AreaTextTest.php index b860ce3..0c2c0c1 100644 --- a/core/modules/views/src/Tests/Handler/AreaTextTest.php +++ b/core/modules/views/src/Tests/Handler/AreaTextTest.php @@ -55,9 +55,9 @@ public function testAreaText() { // Execute the view. $this->executeView($view); - $view->display_handler->handlers['header']['area']->options['content']['format'] = $this->randomString(); + $view->display_handler->handlers['header']['area']->options['content']['format'] = $format = $this->randomString(); $build = $view->display_handler->handlers['header']['area']->render(); - $this->setExpectedLogMessage(LogLevel::ALERT, 'Missing text format: %format'); + $this->setExpectedLogMessage(LogLevel::ALERT, sprintf('Missing text format: %s.', $format)); $this->assertEqual('', drupal_render($build), 'Nonexistent format should return empty markup.'); $view->display_handler->handlers['header']['area']->options['content']['format'] = filter_default_format(); diff --git a/core/modules/views/src/Tests/Plugin/DisplayPageTest.php b/core/modules/views/src/Tests/Plugin/DisplayPageTest.php index 6245354..4222f17 100644 --- a/core/modules/views/src/Tests/Plugin/DisplayPageTest.php +++ b/core/modules/views/src/Tests/Plugin/DisplayPageTest.php @@ -11,7 +11,6 @@ use Drupal\Core\Session\AnonymousUserSession; use Drupal\views\Views; use Drupal\views\Tests\ViewUnitTestBase; -use Psr\Log\LogLevel; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\HttpKernelInterface; diff --git a/core/tests/Drupal/Tests/AssertLegacyTrait.php b/core/tests/Drupal/Tests/AssertLegacyTrait.php index 42f7cbf..2140895 100644 --- a/core/tests/Drupal/Tests/AssertLegacyTrait.php +++ b/core/tests/Drupal/Tests/AssertLegacyTrait.php @@ -78,7 +78,10 @@ protected function assertNotIdentical($actual, $expected, $message = '') { * @see \Drupal\simpletest\TestBase::assertIdenticalObject() */ protected function assertIdenticalObject($actual, $expected, $message = '') { - $this->assertSame($expected, $actual, $message); + // Note: ::assertSame checks whether its the same object. ::assertEquals + // though compares + + $this->assertEquals($expected, $actual, $message); } /** diff --git a/core/tests/Drupal/Tests/KernelTestBase.php b/core/tests/Drupal/Tests/KernelTestBase.php index 512b660..95b81d5 100644 --- a/core/tests/Drupal/Tests/KernelTestBase.php +++ b/core/tests/Drupal/Tests/KernelTestBase.php @@ -18,7 +18,6 @@ use Drupal\Core\Entity\Schema\EntitySchemaProviderInterface; use Drupal\Core\Entity\Sql\SqlEntityStorageInterface; use Drupal\Core\Extension\ExtensionDiscovery; -use Drupal\Core\Language\Language; use Drupal\Core\Logger\RfcLogLevel; use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\StreamWrapperInterface; @@ -1036,7 +1035,7 @@ protected function setExpectedLogMessage($severity, $message = '') { * @see \Drupal\Tests\LogException */ public function log($level, $message, array $context = array()) { - if (in_array($level, [RfcLogLevel::INFO, RfcLogLevel::NOTICE, RfcLogLevel::DEBUG, RfcLogLevel::ERROR])) { + if (in_array($level, [RfcLogLevel::INFO, RfcLogLevel::NOTICE, RfcLogLevel::DEBUG, RfcLogLevel::ERROR, RfcLogLevel::ALERT])) { $placeholders = $this->container->get('logger.log_message_parser') ->parseMessagePlaceholders($message, $context); if (!empty($placeholders)) {