X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Ftests%2FgenerateMakeTest.php;fp=vendor%2Fdrush%2Fdrush%2Ftests%2FgenerateMakeTest.php;h=b27042f2b3f3ef666c5806965b360640c8d38809;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/drush/drush/tests/generateMakeTest.php b/vendor/drush/drush/tests/generateMakeTest.php new file mode 100644 index 000000000..b27042f2b --- /dev/null +++ b/vendor/drush/drush/tests/generateMakeTest.php @@ -0,0 +1,126 @@ +_testGenerateMake('devel', 'bootstrap'); + } + + function testGenerateMakeOmega() { + # TODO: Don't skip this test by default once the underlying issue is resolved. + # See: https://github.com/drush-ops/drush/issues/2030 + $run_omega_make_test = getenv("DRUSH_TEST_MAKE_OMEGA"); + if ($run_omega_make_test) { + return $this->_testGenerateMake('devel', 'omega'); + } + else { + $this->markTestSkipped('Set `DRUSH_TEST_MAKE_OMEGA=1`, in order to run this test. See: https://github.com/drush-ops/drush/issues/2028'); + } + } + + function _testGenerateMake($module, $theme) { + $sites = $this->setUpDrupal(1, TRUE); + $major_version = UNISH_DRUPAL_MAJOR_VERSION . '.x'; + + $options = array( + 'yes' => NULL, + 'pipe' => NULL, + 'root' => $this->webroot(), + 'uri' => key($sites), + 'cache' => NULL, + 'strict' => 0, // Don't validate options + ); + // Omega requires these core modules. + $this->drush('pm-enable', array('block', 'search', 'help'), $options); + $this->drush('pm-download', array($theme, $module), $options); + $this->drush('pm-enable', array($theme, $module), $options); + + $makefile = UNISH_SANDBOX . '/dev.make.yml'; + + // First generate a simple makefile with no version information + $this->drush('generate-makefile', array($makefile), array('exclude-versions' => NULL) + $options); + $expected = <<assertEquals($expected, $actual); + + // Next generate a simple makefile with no version information in .ini format + $makefile = UNISH_SANDBOX . '/dev.make'; + $this->drush('generate-makefile', array($makefile), array('exclude-versions' => NULL, 'format' => 'ini') + $options); + $expected = <<assertEquals($expected, $actual); + + // Download a module to a 'contrib' directory to test the subdir feature + mkdir($this->webroot() + '/sites/all/modules/contrib'); + $this->drush('pm-download', array('libraries'), array('destination' => 'sites/all/modules/contrib') + $options); + $this->drush('pm-enable', array('libraries'), $options); + $makefile = UNISH_SANDBOX . '/dev.make.yml'; + $this->drush('generate-makefile', array($makefile), array('exclude-versions' => NULL) + $options); + $expected = <<assertEquals($expected, $actual); + + // Again in .ini format. + $makefile = UNISH_SANDBOX . '/dev.make'; + $this->drush('generate-makefile', array($makefile), array('exclude-versions' => NULL, 'format' => 'ini') + $options); + $expected = <<assertEquals($expected, $actual); + + // Generate a makefile with version numbers (in .ini format). + $this->drush('generate-makefile', array($makefile), array('format' => 'ini') + $options); + $actual = file_get_contents($makefile); + $this->assertContains('projects[' . $module . '][version] = "', $actual); + } +}