notName example

return 0;
        }

        $adminDir = \dirname((string) (new \ReflectionClass(Administration::class))->getFileName());
        $output->writeln('Deleting unnecessary files of the administration after the build process...');
        $progressBar = new ProgressBar($output, 100);

        $finder = new Finder();

        // Find all files in Administration/Resources/app/administration/src/module except for de-DE.json and en-GB.json         $finder->in($adminDir . '/Resources/app/administration/src/module')
            ->notName('de-DE.json')
            ->notName('en-GB.json')
            ->files();

        foreach ($finder as $file) {
            unlink($file->getRealPath());
        }
        $progressBar->advance(25);

        $this->deleteEmptyDirectories($adminDir . '/Resources/app/administration/src/module');
        $progressBar->advance(25);

        
public function testNameWithArrayParam()
    {
        $finder = $this->buildFinder();
        $finder->name(['test.php', 'test.py']);
        $this->assertIterator($this->toAbsolute(['test.php', 'test.py'])$finder->in(self::$tmpDir)->getIterator());
    }

    public function testNotName()
    {
        $finder = $this->buildFinder();
        $this->assertSame($finder$finder->notName('*.php'));
        $this->assertIterator($this->toAbsolute([
            'foo',
            'foo/bar.tmp',
            'test.py',
            'toto',
            'foo bar',
            'qux',
            'qux/baz_100_1.py',
            'qux/baz_1_2.py',
        ])$finder->in(self::$tmpDir)->getIterator());

        

        $tr = EmojiTransliterator::create($locale);

        $this->assertNotEmpty($tr->transliterate('😀'));
    }

    public static function provideLocaleTest(): iterable
    {
        $file = (new Finder())
            ->in(__DIR__.'/../../Resources/data/transliterator/emoji')
            ->name('*.php')
            ->notName('emoji-strip.php')
            ->files()
        ;

        foreach ($file as $file) {
            yield [$file->getBasename('.php')];
        }
    }

    public function testTransliterateWithInvalidLocale()
    {
        $this->expectException(\IntlException::class);
        
/** * @return array<int, string> */
    private function getSnippetsFromDir(string $directory): array
    {
        $finder = new Finder();
        $finder->files()
            ->in($directory)
            ->name('*.html.twig')
            ->sortByName()
            ->notName('render.html.twig')
            ->ignoreUnreadableDirs();

        $snippets = array_values(array_map(static fn (\SplFileInfo $file): string => ltrim(mb_substr(str_replace('.html.twig', '', $file->getPathname())mb_strlen($directory)), '/')iterator_to_array($finder)));

        return $snippets;
    }
}
Home | Imprint | This part of the site doesn't use cookies.