Пример #1
0
 /**
  * Test load method
  */
 public function testLoad()
 {
     $this->setDir();
     $this->getDir();
     $this->directoryMock->freeze();
     $this->filemanagerMock->fileExists($this->getCachedFilePath())->once()->andReturn(true);
     $this->filemanagerMock->getRegularFile($this->getCachedFilePath())->once()->andReturn($this->regularFileMock);
     $this->filemanagerMock->freeze();
     $this->regularFileMock->getContent()->once()->andReturn(self::SERIALIZED_VALUE);
     $this->regularFileMock->freeze();
     $fileCache = new FileCache(self::PATH, $this->filemanagerMock);
     $this->assertSame(self::VALUE, $fileCache->load(self::KEY));
     $this->regularFileMock->assertExpectations();
     $this->directoryMock->assertExpectations();
     $this->filemanagerMock->assertExpectations();
 }