Neos\Flow\Tests\Unit\Monitor\FileMonitorTest::detectChangesDetectsChangesInFilesOfMonitoredDirectoriesIfPatternIsMatched PHP Method

detectChangesDetectsChangesInFilesOfMonitoredDirectoriesIfPatternIsMatched() public method

    public function detectChangesDetectsChangesInFilesOfMonitoredDirectoriesIfPatternIsMatched()
    {
        $testPath = vfsStream::url('testDirectory');
        // Initially known files per path
        $knownDirectoriesAndFiles = [Files::getNormalizedPath($testPath) => [$testPath . '/NodeTypes.foo.yaml' => 1]];
        file_put_contents($testPath . '/NodeTypes.foo.yaml', '');
        // Outcome of the change dection per file
        $changeDetectionResult = [$testPath . '/NodeTypes.foo.yaml' => ChangeDetectionStrategyInterface::STATUS_CHANGED];
        // Expected emitted changes for files
        $expectedEmittedChanges = [$testPath . '/NodeTypes.foo.yaml' => ChangeDetectionStrategyInterface::STATUS_CHANGED];
        $fileMonitor = $this->setUpFileMonitorForDetection($changeDetectionResult, $expectedEmittedChanges, $knownDirectoriesAndFiles);
        $fileMonitor->monitorDirectory($testPath, 'NodeTypes(\\..+)?\\.yaml');
        $fileMonitor->detectChanges();
    }