예제 #1
0
 public function setUp()
 {
     parent::setUp();
     $this->spec->factory->setProvider(FlatFileStore::class, new CallbackProvider(function ($class, $args) {
         return new __FileStoreFixture_FlatFileStore($this->store, $args['basePath']);
     }));
 }
예제 #2
0
파일: BoxFixture.php 프로젝트: watoki/boxes
 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']);
     }));
 }
예제 #3
0
파일: FileFixture.php 프로젝트: rtens/fido
 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);
     };
 }
예제 #4
0
 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);
     };
 }
예제 #5
0
파일: FileFixture.php 프로젝트: watoki/cfg
 /**
  * @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);
 }
예제 #6
0
 public function setUp()
 {
     parent::setUp();
     $this->request = new Request(new Path(), new Path());
 }
예제 #7
0
 public function setUp()
 {
     parent::setUp();
     $this->registry = new RepresenterRegistry($this->spec->factory);
 }
예제 #8
0
 public function setUp()
 {
     parent::setUp();
     $this->environment = new TestWebEnvironmentStub();
 }