private function dirChmod($mode) { $dir = MockTest::mockDir('anyDir'); chmod($dir, $mode); MockTest::mockConf('logFileDir', $dir); MockTest::mockConf('createLogFile', true); }
/** * @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); }
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()); }