Ejemplo n.º 1
0
 private function dirChmod($mode)
 {
     $dir = MockTest::mockDir('anyDir');
     chmod($dir, $mode);
     MockTest::mockConf('logFileDir', $dir);
     MockTest::mockConf('createLogFile', true);
 }
Ejemplo n.º 2
0
 /**
  * @expectedException \Ignaszak\Registry\RegistryException
  */
 public function testCantSave()
 {
     $dir = MockTest::mockDir('tmpPath');
     chmod($dir, 00);
     Conf::setTmpPath($dir);
     $stub = $this->getMock('AnyClass');
     $this->fileRegistry->set('anyName', $stub);
 }
Ejemplo n.º 3
0
 public function testGetRouteArray()
 {
     // Read from converter
     $this->cache = new Cache($this->mockIRoute('anyChecksum', ['anyRouteArray']));
     $tmpDir = MockTest::mockDir('anyDir');
     MockTest::inject($this->cache, 'tmpDir', $tmpDir);
     $this->assertEquals(['anyRouteArray'], $this->cache->getRouteArray());
     // Read from cache
     MockTest::inject($this->cache, 'route', $this->mockIRoute('anyChecksum', ['anyRouteArray']));
     $this->assertEquals(['anyRouteArray'], $this->cache->getRouteArray());
 }