Neos\Flow\Tests\Unit\Monitor\FileMonitorTest::detectChangesDetectsCreatedFilesOfMonitoredDirectoriesOnlyIfPatternIsMatched PHP Метод

detectChangesDetectsCreatedFilesOfMonitoredDirectoriesOnlyIfPatternIsMatched() публичный Метод

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