function makeMakefileCase::testInfoFileWritingGit

8.0.x makeTest.php makeMakefileCase::testInfoFileWritingGit()
6.x makeTest.php makeMakefileCase::testInfoFileWritingGit()
7.x makeTest.php makeMakefileCase::testInfoFileWritingGit()
5.x makeTest.php makeMakefileCase::testInfoFileWritingGit()
master makeTest.php makeMakefileCase::testInfoFileWritingGit()

Test .info file writing and the use of a git reference cache for git downloads.

File

tests/makeTest.php, line 356

Class

makeMakefileCase
Make makefile tests. @group make @group slow

Code

function testInfoFileWritingGit() {
  // Use the git-simple.make file.
  $config = $this->getMakefile('git-simple');

  $options = array('no-core' => NULL);
  $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile'];
  $this->drush('make', array($makefile, UNISH_SANDBOX . '/test-build'), $options);

  // Test cck_signup.info file.
  $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/cck_signup/cck_signup.info');
  $contents = file_get_contents(UNISH_SANDBOX . '/test-build/sites/all/modules/cck_signup/cck_signup.info');
  $this->assertContains('; Information added by drush on ' . date('Y-m-d'), $contents);
  $this->assertContains('version = "2fe932c"', $contents);
  $this->assertContains('project = "cck_signup"', $contents);

  // Verify that a reference cache was created.
  $cache_dir = UNISH_CACHE . DIRECTORY_SEPARATOR . 'cache';
  $this->assertFileExists($cache_dir . '/git/cck_signup-' . md5('http://git.drupal.org/project/cck_signup.git'));

  // Test context_admin.info file.
  $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/context_admin/context_admin.info');
  $contents = file_get_contents(UNISH_SANDBOX . '/test-build/sites/all/modules/context_admin/context_admin.info');
  $this->assertContains('; Information added by drush on ' . date('Y-m-d'), $contents);
  $this->assertContains('version = "eb9f05e"', $contents);
  $this->assertContains('project = "context_admin"', $contents);

  // Verify git reference cache exists.
  $this->assertFileExists($cache_dir . '/git/context_admin-' . md5('http://git.drupal.org/project/context_admin.git'));

  // Text caption_filter .info rewrite.
  $this->assertFileExists(UNISH_SANDBOX . '/test-build/sites/all/modules/contrib/caption_filter/caption_filter.info');
  $contents = file_get_contents(UNISH_SANDBOX . '/test-build/sites/all/modules/contrib/caption_filter/caption_filter.info');
  $this->assertContains('; Information added by drush on ' . date('Y-m-d'), $contents);
  $this->assertContains('version = "7.x-1.2+0-dev"', $contents);
  $this->assertContains('project = "caption_filter"', $contents);
}