You are here

class MTimeProtectedFileStorageTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php \Drupal\Tests\Component\PhpStorage\MTimeProtectedFileStorageTest

Tests the MTimeProtectedFileStorage implementation.

@coversDefaultClass \Drupal\Component\PhpStorage\MTimeProtectedFileStorage

@group Drupal @group PhpStorage

Hierarchy

Expanded class hierarchy of MTimeProtectedFileStorageTest

File

core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php, line 18
Contains \Drupal\Tests\Component\PhpStorage\MTimeProtectedFileStorageTest.

Namespace

Drupal\Tests\Component\PhpStorage
View source
class MTimeProtectedFileStorageTest extends MTimeProtectedFileStorageBase {

  /**
   * The expected test results for the security test.
   *
   * The default implementation protects against even the filemtime change so
   * both iterations will return FALSE.
   */
  protected $expected = array(
    FALSE,
    FALSE,
  );

  /**
   * The PHP storage class to test.
   */
  protected $storageClass = 'Drupal\\Component\\PhpStorage\\MTimeProtectedFileStorage';

}

Members

Namesort descending Modifiers Type Description Overrides
MTimeProtectedFileStorageBase::$secret protected property The secret string to use for file creation.
MTimeProtectedFileStorageBase::$settings protected property Test settings to pass to storage instances.
MTimeProtectedFileStorageBase::setUp protected function Overrides PhpStorageTestBase::setUp
MTimeProtectedFileStorageBase::testCRUD public function Tests basic load/save/delete operations.
MTimeProtectedFileStorageBase::testSecurity public function Tests the security of the MTimeProtectedFileStorage implementation.
MTimeProtectedFileStorageTest::$expected protected property The expected test results for the security test.
MTimeProtectedFileStorageTest::$storageClass protected property The PHP storage class to test. Overrides MTimeProtectedFileStorageBase::$storageClass
PhpStorageTestBase::$directory protected property A unique per test class directory path to test php storage.
PhpStorageTestBase::additionalAssertCRUD protected function Additional asserts to be run.
PhpStorageTestBase::assertCRUD public function Assert that a PHP storage's load/save/delete operations work.
UnitTestCase::$randomGenerator protected property The random generator.
UnitTestCase::$root protected property The app root.
UnitTestCase::assertArrayEquals protected function Asserts if two arrays are equal by sorting them first.
UnitTestCase::getBlockMockWithMachineName protected function Mocks a block with a block plugin.
UnitTestCase::getClassResolverStub protected function Returns a stub class resolver.
UnitTestCase::getConfigFactoryStub public function Returns a stub config factory that behaves according to the passed in array.
UnitTestCase::getConfigStorageStub public function Returns a stub config storage that returns the supplied configuration.
UnitTestCase::getContainerWithCacheTagsInvalidator protected function Sets up a container with a cache tags invalidator.
UnitTestCase::getRandomGenerator protected function Gets the random generator for the utility methods.
UnitTestCase::getStringTranslationStub public function Returns a stub translation manager that just returns the passed string.
UnitTestCase::randomMachineName public function Generates a unique random string containing letters and numbers.