コード例 #1
0
 /**
  * @dataProvider filesystemProvider
  */
 public function testWrite(Filesystem $filesystem, $adapter, $cache)
 {
     $this->assertTrue($filesystem->write('some_file.txt', 'some content'));
     $this->assertTrue($filesystem->has('some_file.txt'));
     $this->assertTrue($cache->has('some_file.txt'));
     $this->assertTrue($adapter->has('some_file.txt'));
     $this->assertCount(1, $filesystem->listContents());
     $this->assertCount(1, $cache->listContents('', false));
     $this->assertCount(1, $adapter->listContents('', false));
     $filesystem->rename('some_file.txt', 'other_name.txt');
     $this->assertFalse($filesystem->has('some_file.txt'));
     $this->assertFalse($cache->has('some_file.txt'));
     $this->assertFalse($adapter->has('some_file.txt'));
     $this->assertTrue($filesystem->has('other_name.txt'));
     $this->assertTrue($cache->has('other_name.txt'));
     $this->assertTrue($adapter->has('other_name.txt'));
     $this->assertCount(1, $filesystem->listContents());
     $this->assertCount(1, $cache->listContents('', false));
     $this->assertCount(1, $adapter->listContents('', false));
     $filesystem->delete('other_name.txt');
     $this->assertFalse($filesystem->has('other_name.txt'));
     $this->assertFalse($cache->has('other_name.txt'));
     $this->assertFalse($adapter->has('other_name.txt'));
     $this->assertCount(0, $filesystem->listContents());
     $this->assertCount(0, $cache->listContents('', false));
     $this->assertCount(0, $adapter->listContents('', false));
 }