You are here

function BackupMigrateUnitTest::testGetFileTypes in Backup and Migrate 5

File

tests/BackupMigrateUnitTest.test, line 500

Class

BackupMigrateUnitTest
Unit tests for Backup and Migrate module.

Code

function testGetFileTypes() {
  $types = _backup_migrate_filetypes();
  $this
    ->assertTrue(is_array($types), t('Checking that the function returned an array'));
  $this
    ->assertTrue(count($types) > 1, t('Checking that the function returned an array'));
  foreach ($types as $key => $type) {
    $this
      ->assertTrue(preg_match('/.[a-z0-9\\.]+/', $type['extension']), t('Checking that the returned type has a valid extension'));
    $this
      ->assertTrue(preg_match('/[a-z0-9\\-\\.]+\\/[a-z0-9\\-\\.]+/', $type['filemime']), t('Checking that the returned type has a valid mimetype'));
  }
}