public function setUp() { parent::setUp(); $this->spec->factory->setProvider(FlatFileStore::class, new CallbackProvider(function ($class, $args) { return new __FileStoreFixture_FlatFileStore($this->store, $args['basePath']); })); }
public function setUp() { parent::setUp(); $this->boxes = array(); $this->request = new WebRequest(Url::fromString(''), new Path(), 'get'); $this->factory = new Factory(); $this->store = new MemoryStore(); /** @noinspection PhpUnusedParameterInspection */ $this->factory->setProvider(RawFileStore::$CLASS, new CallbackProvider(function ($class, $args) { return new FileStoreAdapter($this->store, $args['rootDirectory']); })); }
public function setUp() { parent::setUp(); $this->tmpDir = __DIR__ . DIRECTORY_SEPARATOR . '__tmp'; if (!file_exists($this->tmpDir)) { mkdir($this->tmpDir, 0777, true); } $that = $this; $this->spec->undos[] = function () use($that) { $that->clear($that->tmpDir); }; }
public function setUp() { parent::setUp(); self::$loaded = array(); $this->factory = new Factory(); $this->tmpDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(); @mkdir($this->tmpDir); $tmpDir = $this->tmpDir; $this->spec->undos[] = function () use($tmpDir) { @rmdir($tmpDir); }; }
/** * @param Specification $spec * @param Factory $factory <- */ public function __construct(Specification $spec, Factory $factory) { parent::__construct($spec, $factory); $this->dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid() . DIRECTORY_SEPARATOR; $dir = $this->dir; $cleanUp = function () use($dir) { foreach (glob($dir . '/*') as $file) { @unlink($file); } @rmdir($dir); }; $this->spec->undos[] = function () use($cleanUp) { $cleanUp(); }; $cleanUp(); @mkdir($this->dir); }
public function setUp() { parent::setUp(); $this->request = new Request(new Path(), new Path()); }
public function setUp() { parent::setUp(); $this->registry = new RepresenterRegistry($this->spec->factory); }
public function setUp() { parent::setUp(); $this->environment = new TestWebEnvironmentStub(); }