function ArchiverTestBase::assertArchiveNotContainsFile
Same name in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Archiver/ArchiverTestBase.php \Drupal\KernelTests\Core\Archiver\ArchiverTestBase::assertArchiveNotContainsFile()
Asserts an archive does not contain a given file.
Parameters
string $path: Absolute file path to an archived file.
string $file: File to assert does not exist within the archived file.
array $configuration: Optional configuration to pass to the archiver plugin.
1 call to ArchiverTestBase::assertArchiveNotContainsFile()
- ZipTest::testOverwriteArchive in core/
tests/ Drupal/ KernelTests/ Core/ Archiver/ ZipTest.php - Tests that the Zip archiver is created and overwritten.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Archiver/ ArchiverTestBase.php, line 67
Class
- ArchiverTestBase
- Provides archive specific assertions and helper properties for archive tests.
Namespace
Drupal\KernelTests\Core\ArchiverCode
protected function assertArchiveNotContainsFile($path, $file, array $configuration = []) {
$configuration['filepath'] = $path;
/** @var \Drupal\Core\Archiver\ArchiverManager $manager */
$manager = $this->container
->get('plugin.manager.archiver');
$archive = $manager->createInstance($this->archiverPluginId, $configuration);
$this->assertNotContains($file, $archive->listContents(), sprintf('The "%s" archive does not contain the "%s" file.', $path, $file));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.