Exemplo n.º 1
0
 public function testPatch()
 {
     if (PHP_OS !== "Darwin") {
         return $this->markTestSkipped('openssl DSO patch test only runs on darwin platform');
     }
     $logger = new Logger();
     $logger->setQuiet();
     $fromVersion = '5.5.17';
     $sourceFixtureDirectory = getenv('PHPBREW_FIXTURES_PHP_DIR') . DIRECTORY_SEPARATOR . $fromVersion;
     $sourceDirectory = getenv('PHPBREW_BUILD_PHP_DIR');
     $this->setupBuildDirectory($fromVersion);
     $build = new Build($fromVersion);
     $build->setSourceDirectory($sourceDirectory);
     $build->enableVariant('openssl');
     $this->assertTrue($build->hasVariant('openssl'), 'openssl enabled');
     $patch = new OpenSSLDSOPatch();
     $matched = $patch->match($build, $logger);
     $this->assertTrue($matched, 'patch matched');
     $patchedCount = $patch->apply($build, $logger);
     $this->assertEquals(10, $patchedCount);
     /*
             We can't assume the file equals because the test may be run on different platform and openssl may be installed 
             into different locations.
     
             $sourceExpectedDirectory = getenv('PHPBREW_EXPECTED_PHP_DIR') . DIRECTORY_SEPARATOR . '5.5.17-openssl-dso-patch';
             $this->assertFileEquals($sourceExpectedDirectory. '/Makefile', $sourceDirectory . '/Makefile');
     */
 }
Exemplo n.º 2
0
 public function testPatch()
 {
     $logger = new Logger();
     $logger->setQuiet();
     $fromVersion = '5.3.29';
     $sourceFixtureDirectory = getenv('PHPBREW_FIXTURES_PHP_DIR') . DIRECTORY_SEPARATOR . $fromVersion;
     $sourceDirectory = getenv('PHPBREW_BUILD_PHP_DIR');
     if (!is_dir($sourceDirectory)) {
         return $this->markTestSkipped("{$sourceDirectory} does not exist.");
     }
     // Copy the source Makefile to the Makefile
     // copy($sourceFixtureDirectory . '/Makefile', $sourceDirectory . '/Makefile');
     $this->setupBuildDirectory($fromVersion);
     $build = new Build($fromVersion);
     $build->setSourceDirectory($sourceDirectory);
     $build->enableVariant('intl');
     $this->assertTrue($build->hasVariant('intl'), 'intl enabled');
     $patch = new IntlWith64bitPatch();
     $matched = $patch->match($build, $logger);
     $this->assertTrue($matched, 'patch matched');
     $patchedCount = $patch->apply($build, $logger);
     $this->assertEquals(3, $patchedCount);
     $sourceExpectedDirectory = getenv('PHPBREW_EXPECTED_PHP_DIR') . DIRECTORY_SEPARATOR . $fromVersion;
     $this->assertFileEquals($sourceExpectedDirectory . '/Makefile', $sourceDirectory . '/Makefile');
 }
Exemplo n.º 3
0
 public function testPackageUrl()
 {
     $logger = new Logger();
     $logger->setQuiet();
     $peclProvider = new PeclProvider();
     $downloader = new ExtensionDownloader($logger, new OptionResult());
     $peclProvider->setPackageName('APCu');
     $extractPath = $downloader->download($peclProvider, 'latest');
     $this->assertFileExists($extractPath);
 }
 public function test()
 {
     $logger = new Logger();
     $logger->setQuiet();
     $workingDir = new SplFileInfo(getcwd());
     $vendorDirName = 'vendor';
     $autoloadGenerator = new ComposerAutoloadGenerator($logger);
     $autoloadGenerator->setVendorDir('vendor');
     $autoloadGenerator->setWorkingDir($workingDir->getPathname());
     $autoloadGenerator->scanComposerJsonFiles($workingDir . DIRECTORY_SEPARATOR . $vendorDirName);
 }
Exemplo n.º 5
0
 public function testBitbucketPackage()
 {
     $logger = new Logger();
     $logger->setQuiet();
     $provider = new BitbucketProvider();
     $provider->setOwner('osmanov');
     $provider->setRepository('pecl-event');
     $provider->setPackageName('event');
     $extensionDownloader = new ExtensionDownloader($logger, new OptionResult());
     $versionList = $extensionDownloader->knownReleases($provider);
     $this->assertNotCount(0, $versionList);
 }
 public function testPatch()
 {
     $logger = new Logger();
     $logger->setQuiet();
     $fromVersion = '5.5.17';
     $sourceFixtureDirectory = getenv('PHPBREW_FIXTURES_PHP_DIR') . DIRECTORY_SEPARATOR . $fromVersion;
     $sourceDirectory = getenv('PHPBREW_BUILD_PHP_DIR');
     if (!is_dir($sourceDirectory)) {
         return $this->markTestSkipped("{$sourceDirectory} does not exist.");
     }
     $this->setupBuildDirectory($fromVersion);
     $build = new Build($fromVersion);
     $build->setSourceDirectory($sourceDirectory);
     $build->enableVariant('apxs2');
     $this->assertTrue($build->hasVariant('apxs2'), 'apxs2 enabled');
     $patch = new Apache2ModuleNamePatch();
     $matched = $patch->match($build, $logger);
     $this->assertTrue($matched, 'patch matched');
     $patchedCount = $patch->apply($build, $logger);
     $this->assertEquals(107, $patchedCount);
     $sourceExpectedDirectory = getenv('PHPBREW_EXPECTED_PHP_DIR') . DIRECTORY_SEPARATOR . '5.5.17-apxs-patch';
     $this->assertFileEquals($sourceExpectedDirectory . '/Makefile.global', $sourceDirectory . '/Makefile.global');
     $this->assertFileEquals($sourceExpectedDirectory . '/configure', $sourceDirectory . '/configure');
 }
Exemplo n.º 7
0
 public function setUp()
 {
     $logger = new Logger();
     $logger->setQuiet();
     $this->manager = new ExtensionManager($logger);
 }
Exemplo n.º 8
0
 public function createLogger()
 {
     $logger = new Logger();
     $logger->setQuiet();
     return $logger;
 }