nur-sery/nur_tests/io/CacheManagerTest.php

34 lines
880 B
PHP
Raw Normal View History

2023-12-03 22:11:29 +04:00
<?php
namespace nur\io;
use nur\b\io\CacheManager;
use nur\t\TestCase;
class CacheManagerTest extends TestCase {
function test() {
$cm = new CacheManager();
self::assertTrue($cm->shouldCache("a"));
self::assertTrue($cm->shouldCache("a"));
self::assertTrue($cm->shouldCache("a"));
$cm->setNoCache();
self::assertFalse($cm->shouldCache("b"));
self::assertTrue($cm->shouldCache("b"));
self::assertTrue($cm->shouldCache("b"));
$cm->setNoCache();
self::assertFalse($cm->shouldCache("c", false));
self::assertFalse($cm->shouldCache("c", false));
self::assertFalse($cm->shouldCache("c", false));
$cm->setNoCache();
self::assertFalse($cm->shouldCache("d"));
self::assertTrue($cm->shouldCache("d"));
$cm->setNoCache();
self::assertFalse($cm->shouldCache("d"));
self::assertTrue($cm->shouldCache("d"));
}
}