/** * Tests deleteAll() method. * * @group Drupal * @group PhpStorage */ public function testDeleteAll() { $php_read = new FileReadOnlyStorage($this->readonlyStorage); $this->assertFalse($php_read->deleteAll()); // Make sure directory exists prior to removal. $this->assertTrue(file_exists($this->directory . '/test'), 'File storage directory does not exist.'); }
/** * @covers ::deleteAll */ public function testDeleteAll() { $php = new FileStorage($this->standardSettings); $name = $this->randomMachineName() . '/' . $this->randomMachineName() . '.php'; // Find a global that doesn't exist. do { $random = mt_rand(10000, 100000); } while (isset($GLOBALS[$random])); // Write our the file so we can test deleting. $code = "<?php\n\$GLOBALS[{$random}] = TRUE;"; $this->assertTrue($php->save($name, $code)); $php_read = new FileReadOnlyStorage($this->readonlyStorage); $this->assertFalse($php_read->deleteAll()); // Make sure directory exists prior to removal. $this->assertTrue(file_exists($this->directory . '/test'), 'File storage directory does not exist.'); }