You are here

function CoderReviewUpgrade6xTest::testUpgrade6xCache in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_review/tests/coder_review_6x.test \CoderReviewUpgrade6xTest::testUpgrade6xCache()

File

coder_review/tests/coder_review_6x.test, line 188

Class

CoderReviewUpgrade6xTest

Code

function testUpgrade6xCache() {
  $this
    ->assertCoderReviewFail('  cache_set(\'simple_cid\', \'cache\', $simple);');
  $this
    ->assertCoderReviewFail('  cache_set(\'simple_cid\', "cache", $simple);');
  $this
    ->assertCoderReviewFail('  cache_set(\'simple_cid\', $table, $simple);');
  $this
    ->assertCoderReviewFail('  cache_set(\'complex_cid\', $tbl, serialize($complex));');
  $this
    ->assertCoderReviewFail('  cache_set(\'complex_cid\', serialize($complex));');
  $this
    ->assertCoderReviewPass('  cache_set(\'simple_cid\', $simple);');
  $this
    ->assertCoderReviewPass('  cache_set(\'simple_cid\', $simple, "cache");');
  $this
    ->assertCoderReviewFail('  $complex = unserialize(cache_get(\'complex_cid\'));');
  $this
    ->assertCoderReviewPass('  $complex = cache_get(\'complex_cid\');');
}