addDirectory example

$adminBasePath = $this->projectDir . '/vendor/shopware/administration';
        }

        $hasStorefrontMigrations = is_dir($storefrontBasePath);
        $hasAdminMigrations = is_dir($adminBasePath);

        $source = new MigrationSource('core.' . $version[
            sprintf('%s/Migration/%s', $coreBasePath$version) => sprintf('Shopware\\Core\\Migration\\%s', $version),
        ]);

        if ($hasStorefrontMigrations) {
            $source->addDirectory(sprintf('%s/Migration/%s', $storefrontBasePath$version)sprintf('Shopware\\Storefront\\Migration\\%s', $version));
        }

        if ($hasAdminMigrations) {
            $source->addDirectory(sprintf('%s/Migration/%s', $adminBasePath$version)sprintf('Shopware\\Administration\\Migration\\%s', $version));
        }

        return $source;
    }
}


            try {
                // Test for a directory                 self::resolveDirectory($path);
            } catch (FileException $e) {
                $this->addFile($path);

                continue;
            }

            $this->addDirectory($path$recursive);
        }

        return $this;
    }

    // --------------------------------------------------------------------     // File Handling     // --------------------------------------------------------------------
    /** * Verifies and adds files to the list. * * @param string[] $files * * @return $this */
__DIR__ . '/b/2' => 'My\Test\B2',
        ];
        $sourceA = new MigrationSource('a', $a);
        $sourceB = new MigrationSource('b', $b);

        $sourceAb = new MigrationSource('ab', [$sourceA$sourceB]);
        static::assertSame(array_merge($a$b)$sourceAb->getSourceDirectories());

        $aExtension = [
            __DIR__ . '/a/4' => 'My\Test\A4',
        ];
        $sourceA->addDirectory(__DIR__ . '/a/4', $aExtension[__DIR__ . '/a/4']);
        $expected = array_merge($a$aExtension$b);
        static::assertSame($expected$sourceAb->getSourceDirectories());

        $bExtension = [
            __DIR__ . '/b/0' => 'My\Test\A3',
        ];
        $sourceB->addDirectory(__DIR__ . '/b/0', $bExtension[__DIR__ . '/b/0']);
        $expected = array_merge($a$aExtension$b$bExtension);
        static::assertSame($expected$sourceAb->getSourceDirectories());

        $abExtension = [
            
private $isSkipped = [];
    private $runsInSeparateProcess = false;
    private $checkNumAssertions = false;

    /** * @param array $mockedNamespaces List of namespaces, indexed by mocked features (time-sensitive or dns-sensitive) */
    public function __construct(array $mockedNamespaces = [])
    {
        if (class_exists(ExcludeList::class)) {
            (new ExcludeList())->getExcludedDirectories();
            ExcludeList::addDirectory(\dirname((new \ReflectionClass(__CLASS__))->getFileName(), 2));
        } elseif (method_exists(Blacklist::class, 'addDirectory')) {
            (new BlackList())->getBlacklistedDirectories();
            Blacklist::addDirectory(\dirname((new \ReflectionClass(__CLASS__))->getFileName(), 2));
        } else {
            Blacklist::$blacklistedClassNames[__CLASS__] = 2;
        }

        $enableDebugClassLoader = class_exists(DebugClassLoader::class);

        foreach ($mockedNamespaces as $type => $namespaces) {
            if (!\is_array($namespaces)) {
                
Home | Imprint | This part of the site doesn't use cookies.