/** * Verify that the path is manageable. */ public function testSetAndRetrievePath() { self::assertEquals($this->path, $this->event->getPath(), 'The path was not returned.'); $path = 'alt.php'; $this->event->setPath($path); self::assertEquals($path, $this->event->getPath(), 'The path was not changed.'); }
/** * Replaces the contents of the file, if applicable. * * @param BeforeSetPathEvent $event The event manager. */ public function beforeSetPath(BeforeSetPathEvent $event) { $manager = $event->getManager(); if (PathInterface::DIRECTORY === $manager->getType()) { return; } $path = $event->getPath(); if ($this->isMatch($path)) { $event->setManager(new Memory($this->processContents($path, $manager->getContents()), $manager->getType(), $manager->getModified(), $manager->getPermissions())); } }
/** * Checks if the path should be filtered out. * * @param BeforeSetPathEvent $event The event manager. */ public function beforeSetPath(BeforeSetPathEvent $event) { if (!$this->isAllowed($event->getPath())) { $event->skip(); } }