10 class makeConvertCase extends CommandUnishTestCase {
13 * Tests the conversion of make file to various formats.
15 * @param string $source_filename
16 * The source file to be converted.
19 * Options to be passed to the make-convert command. E.g., --format=yml.
21 * @param $expected_lines
22 * An array of lines expected to be present in the command output.
24 * @dataProvider providerTestMakeConvert
26 public function testMakeConvert($source_filename, $options, $expected_lines) {
27 $makefile_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'makefiles';
28 $source_file = $makefile_dir . DIRECTORY_SEPARATOR . $source_filename;
29 $return = $this->drush('make-convert', array($source_file), $options);
30 $output = $this->getOutput();
31 foreach ($expected_lines as $expected_line) {
32 $this->assertContains($expected_line, $output);
37 * Data provider for testMakeConvert().
40 * An array of test case data. See testMakeConvert() signature.
42 public function providerTestMakeConvert() {
45 // Source filename in makefiles directory.
48 array('format' => 'yml'),
49 // Expected output lines.
55 "- 'http://drupal.org/files/issues/features-drush-backend-invoke-25.patch'",
60 array('format' => 'composer'),
62 '"drupal/drupal": "7.*",',
63 '"drupal/features": "7.1.0-beta4",',
65 '"drupal/features": {',
66 '"Enter drupal/features patch #0 description here": "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch"',
71 array('format' => 'composer'),
73 '"drupal/drupal": "7.*",',
74 '"drupal/features": "7.1.0-beta4",',
76 '"drupal/features": {',
77 '"Enter drupal/features patch #0 description here": "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch"',
82 array('format' => 'make'),
86 // Ensure Drupal core tag is set correctly.
87 'projects[drupal][download][tag] = "7.43"',
88 'projects[features][download][type] = "git"',
89 'projects[features][download][url] = "https://git.drupal.org/project/features"',
90 'projects[features][download][tag] = "7.x-1.0-beta4"',
91 'projects[features][patch][0] = "http://drupal.org/files/issues/features-drush-backend-invoke-25.patch"'),
95 array('format' => 'yml'),
99 // Ensure Drupal core tag is set correctly.
102 'tag: 7.x-1.0-beta4',
104 "- 'http://drupal.org/files/issues/features-drush-backend-invoke-25.patch'",