You are here

function FileSpaceUsedTest::testStatus in SimpleTest 7

Test the status fields

File

tests/file.test, line 314
This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.

Class

FileSpaceUsedTest
This will run tests against the file_space_used() function.

Code

function testStatus() {

  // Check selection with a single bit set.
  $this
    ->assertEqual(file_space_used(NULL, 2), 4, t("Found the size of all user's files with status 2."));
  $this
    ->assertEqual(file_space_used(NULL, 4), 3, t("Found the size of all user's files with status 4."));

  // Check that the bitwise AND operator is used when selecting so that we
  // only get files with the 2 AND 4 bits set.
  $this
    ->assertEqual(file_space_used(NULL, 2 | 4), 3, t("Found the size of all user's files with status 6."));
}