chengkun
2025-09-09 774d962b76d63366ed26c395e0a33cdbec309242
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
 
use League\Flysystem\Cached\Storage\Noop;
use PHPUnit\Framework\TestCase;
 
class NoopCacheTests extends TestCase
{
    public function testNoop()
    {
        $cache = new Noop();
        $this->assertEquals($cache, $cache->storeMiss('file.txt'));
        $this->assertNull($cache->setComplete('', false));
        $this->assertNull($cache->load());
        $this->assertNull($cache->flush());
        $this->assertNull($cache->has('path.txt'));
        $this->assertNull($cache->autosave());
        $this->assertFalse($cache->isComplete('', false));
        $this->assertFalse($cache->read('something'));
        $this->assertFalse($cache->readStream('something'));
        $this->assertFalse($cache->getMetadata('something'));
        $this->assertFalse($cache->getMimetype('something'));
        $this->assertFalse($cache->getSize('something'));
        $this->assertFalse($cache->getTimestamp('something'));
        $this->assertFalse($cache->getVisibility('something'));
        $this->assertEmpty($cache->listContents('', false));
        $this->assertFalse($cache->rename('', ''));
        $this->assertFalse($cache->copy('', ''));
        $this->assertNull($cache->save());
        $object = ['path' => 'path.ext'];
        $this->assertEquals($object, $cache->updateObject('path.txt', $object));
        $this->assertEquals([['path' => 'some/file.txt']], $cache->storeContents('unknwon', [
            ['path' => 'some/file.txt'],
        ], false));
    }
}