diff --git a/core/modules/hal/src/Tests/NormalizeTest.php b/core/modules/hal/src/Tests/NormalizeTest.php
index b73d4b7..5fca46c 100644
--- a/core/modules/hal/src/Tests/NormalizeTest.php
+++ b/core/modules/hal/src/Tests/NormalizeTest.php
@@ -9,7 +9,6 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
-use Drupal\entity_test\Entity\EntityTest;
/**
* Tests that entities can be normalized in HAL.
diff --git a/core/tests/Drupal/Tests/Listeners/VerbosePrinter.php b/core/tests/Drupal/Tests/Listeners/VerbosePrinter.php
index d156585..2f88bb3 100644
--- a/core/tests/Drupal/Tests/Listeners/VerbosePrinter.php
+++ b/core/tests/Drupal/Tests/Listeners/VerbosePrinter.php
@@ -25,11 +25,16 @@ public function __construct($out, $verbose, $colors, $debug, $numberOfColumns) {
$this->cleanUpLastTestRun($this->directory);
}
// Create the directory.
- mkdir($this->directory, 0775);
- if (is_writable($this->directory)) {
- chmod($this->directory, 0775);
+ if (mkdir($this->directory, 0775)) {
+ if (is_writable($this->directory)) {
+ chmod($this->directory, 0775);
+ }
+ file_put_contents($this->directory . '/.htaccess', "\nExpiresActive Off\n\n");
+ }
+ else {
+ $this->writeWithColor('bg-red, fg-black', "Verbose directory {$this->directory} could not be created.");
+ $this->directory = NULL;
}
- file_put_contents($this->directory . '/.htaccess', "\nExpiresActive Off\n\n");
}
/**
@@ -37,6 +42,11 @@ public function __construct($out, $verbose, $colors, $debug, $numberOfColumns) {
*/
public function printResult(\PHPUnit_Framework_TestResult $result) {
parent::printResult($result);
+
+ if (!$this->directory) {
+ return;
+ }
+
$counter = 0;
foreach (glob($this->directory . '/*.html') as $filename) {
if (!$counter) {
@@ -59,7 +69,7 @@ public function printResult(\PHPUnit_Framework_TestResult $result) {
* Directory to remove.
*/
protected function cleanUpLastTestRun($directory) {
- if (is_dir($directory)) {
+ if (isset($directory) && is_dir($directory)) {
$objects = scandir($directory);
foreach ($objects as $object) {
if ($object !== "." && $object !== "..") {