コード例 #1
0
 /**
  * Creates a new delta update subscriber.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->file = $this->dir . '/test.php';
     touch($this->file);
     $this->iterator = new ArrayIterator(array($this->file => new SplFileInfo($this->file)));
     $this->subscriber = new DeltaUpdateSubscriber();
     $this->delta = new DeltaUpdateIterator($this->iterator, $this->subscriber, $this->builder, $this->dir . '/');
 }
コード例 #2
0
 /**
  * Creates a new test processor and subscriber instance.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->processor = new CallbackProcessor(function ($file) {
         return (bool) preg_match('/\\.php$/', $file);
     }, function ($file, $contents) {
         return $contents . "\n\necho \"Hello, {$file}!\n\";";
     });
     $this->subscriber = new ProcessorSubscriber($this->processor);
 }
コード例 #3
0
 /**
  * Creates a new instance of the subscriber for testing.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->subscriber = new DeltaUpdateSubscriber();
 }
コード例 #4
0
 /**
  * Creates a new instance of the event.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->event = new PreAddFileEvent($this->builder, $this->file, $this->local);
 }
コード例 #5
0
 /**
  * Creates a new instance of the event.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->event = new PreAddFromStringEvent($this->builder, $this->local, $this->contents);
 }
コード例 #6
0
 /**
  * Creates a new instance of the event.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->iterator = new ArrayIterator(array());
     $this->event = new PreBuildFromIteratorEvent($this->builder, $this->iterator, $this->base);
 }
コード例 #7
0
 /**
  * Creates a new mock filter subscriber.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->subscriber = $this->getMockBuilder('Box\\Component\\Builder\\Event\\Listener\\AbstractFilterSubscriber')->setMethods(array('isAllowed'))->getMockForAbstractClass();
 }
コード例 #8
0
 /**
  * Creates a new instance of the event.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->event = new PreBuildFromDirectoryEvent($this->builder, $this->dir, $this->filter);
 }
コード例 #9
0
ファイル: BuilderTest.php プロジェクト: box-project/builder
 /**
  * Cleans up the temporary paths.
  */
 protected function tearDown()
 {
     $this->dispatcher = null;
     parent::tearDown();
 }