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); }
/** * @param \PhpGuard\Listen\Adapter\AdapterInterface $adapter * * @return Listener */ public function setAdapter($adapter) { $this->adapter = $adapter; $adapter->initialize($this); return $this; }