t('Basic flexifilter API tests'), 'desc' => t('Checks basic flexifilter API functionality to make sure it works.'), 'group' => 'Flexifilter Tests', ); } /** * Test function. */ function testFlexifilterAPI() { $fids = flexifilter_install_flexifilters('flexifilter'); foreach ($fids as $fid) { $this->assertTrue($fid !== FALSE, t('Check to make sure flexifilters install cleanly')); } foreach ($fids as $fid) { $flexifilter = flexifilter_load($fid); $this->assertTrue(is_array($flexifilter), t('Check to make sure flexifilters load correctly')); } foreach ($fids as $fid) { db_query('DELETE FROM {flexifilters_parts} WHERE fid = %d', $fid); db_query('DELETE FROM {flexifilters} WHERE fid = %d', $fid); } // Clear the internal cache flexifilter_get_filters(TRUE, TRUE); foreach ($fids as $fid) { $flexifilter = flexifilter_load($fid); $this->assertFalse(is_array($flexifilter), t('Check to make sure flexifilters delete properly')); } } }