monitorDirectory() public method

All files in these directories will be monitored too.
public monitorDirectory ( string $path, string $filenamePattern = null ) : void
$path string Absolute path of the directory to monitor
$filenamePattern string A pattern for filenames to consider for file monitoring (regular expression)
return void
 /**
  * @test
  */
 public function aDirectoryAppearsOnlyOnceInTheListOfMonitoredDirectories()
 {
     $monitor = new FileMonitor('Flow_Test');
     $monitor->monitorDirectory(__DIR__);
     $monitor->monitorDirectory(__DIR__ . '/');
     $this->assertSame([Files::getNormalizedPath($this->unixStylePath)], $monitor->getMonitoredDirectories());
 }
 /**
  * Let the given file monitor track changes of the specified directory if it exists.
  *
  * @param FileMonitor $fileMonitor
  * @param string $path
  * @param string $filenamePattern Optional pattern for filenames to consider for file monitoring (regular expression). @see FileMonitor::monitorDirectory()
  * @return void
  */
 protected static function monitorDirectoryIfItExists(FileMonitor $fileMonitor, $path, $filenamePattern = null)
 {
     if (is_dir($path)) {
         $fileMonitor->monitorDirectory($path, $filenamePattern);
     }
 }