public function test()
 {
     $build = new Patch64BitSupportTaskTestBuild();
     $fixture = new TemporaryFileFixture($this, getenv('PHPBREW_FIXTURES_PHP_DIR') . '/' . $build->getVersion() . '/Makefile');
     $fixture->setTemporaryDirectory($build->getSourceDirectory());
     $fixture->withFile('Makefile', function ($self, $fixturePath) use($build) {
         $task = new Patch64BitSupportTask($self->logger, new OptionResult());
         $task->patch($build);
         $self->assertFileEquals(getenv('PHPBREW_EXPECTED_PHP_DIR') . '/' . $build->getVersion() . '/Makefile', $fixturePath);
     });
 }
Esempio n. 2
0
 public function testApply()
 {
     $version = '5.3.29';
     $fixture = new TemporaryFileFixture($this, getenv('PHPBREW_FIXTURES_PHP_DIR') . "/{$version}/Makefile.in");
     $fixture->withFile('Makefile', function ($self, $fixturePath) use($version) {
         $build = new Build($version);
         $build->setSourceDirectory(dirname($fixturePath));
         $patch = new RegexpPatch($self->logger, $build, array(basename($fixturePath)), array(RegexpPatchRule::always('/LIBTOOL/', '')));
         $patch->apply();
         $self->assertFileEquals($fixturePath, getenv('PHPBREW_EXPECTED_PHP_DIR') . '/5.3.29/Makefile.in');
     });
 }
Esempio n. 3
0
 public function test()
 {
     $build = new Apxs2PatchTaskTestBuild();
     $makefileFixture = new TemporaryFileFixture($this, $build->getMakefileSourcePath());
     $configureFixture = new TemporaryFileFixture($this, $build->getConfigureSourcePath());
     $makefileFixture->setTemporaryDirectory($build->getSourceDirectory());
     $configureFixture->setTemporaryDirectory($build->getSourceDirectory());
     $makefileFixture->withFile('Makefile.global', function ($self, $makefileFixturePath) use($build, $configureFixture) {
         $configureFixture->withFile('configure', function ($self, $configureFixturePath) use($build, $makefileFixturePath) {
             $task = new Apxs2PatchTask($self->logger);
             $task->patch($build, new OptionResult());
             $self->assertFileEquals(getenv('PHPBREW_EXPECTED_PHP_DIR') . '/5.5.19/Makefile.global', $makefileFixturePath);
             $self->assertFileEquals(getenv('PHPBREW_EXPECTED_PHP_DIR') . '/5.5.19/configure', $configureFixturePath);
         });
     });
 }