Esempio n. 1
0
 public function evaluate()
 {
     if (!isset($this->adapter)) {
         $this->adapter = Listen::getDefaultAdapter();
         $this->adapter->initialize($this);
     }
     if ($this->logger) {
         $this->adapter->setLogger($this->logger);
     }
     $this->adapter->evaluate();
     $this->changeSet = $this->adapter->getChangeSet();
     $this->notify();
 }
Esempio n. 2
0
 function it_should_start_evaluate_filesystem_event_properly(AdapterInterface $adapter, LoggerInterface $logger, FilesystemEvent $event)
 {
     $this->callback(function (ChangeSetEvent $event) {
         static $count = 0;
         $event->getListener()->stop();
         $count++;
     });
     $adapter->setLogger($logger)->shouldBeCalled();
     $adapter->initialize($this)->shouldBeCalled();
     $adapter->evaluate()->shouldBeCalled();
     $adapter->getChangeSet()->willReturn(array($event))->shouldBeCalled();
     $this->setLogger($logger);
     $this->to(mfs::$tmpDir);
     $this->setAdapter($adapter);
     $this->latency(10000);
     $this->start();
     $this->getChangeset()->shouldContain($event);
 }