Platformsh\Cli\Tests\Toolstack\VanillaTest::testBuildCustomSourceDestination PHP Method

testBuildCustomSourceDestination() public method

Test with a custom source and destination.
    public function testBuildCustomSourceDestination()
    {
        // Copy the 'vanilla' app to a temporary directory.
        $sourceDir = $this->createTempSubDir();
        $fsHelper = new FilesystemHelper();
        $fsHelper->copyAll('tests/data/apps/vanilla', $sourceDir);
        // Create another temporary directory.
        $destination = $this->createTempSubDir();
        // Test with symlinking.
        $builder = new LocalBuild(['abslinks' => true], null, self::$output);
        $builder->build($sourceDir, $destination);
        $this->assertFileExists($destination . '/index.html');
        // Test with copying.
        $builder = new LocalBuild(['copy' => true, 'abslinks' => true], null, self::$output);
        $builder->build($sourceDir, $destination);
        $this->assertFileExists($destination . '/index.html');
        // Remove the temporary files.
        exec('rm -R ' . escapeshellarg($destination) . ' ' . escapeshellarg($sourceDir));
    }