From 092133272e6c910936db36b1e7e4411a28f0a9e6 Mon Sep 17 00:00:00 2001 From: jonathangreen Date: Thu, 4 Apr 2013 20:09:18 -0300 Subject: [PATCH 1/3] Added codesniffer to travisci When code is pushed it is now failed if it fails codesniffer. Also pushed a number of coding standards fixes so that this commit will build correctly. --- .travis.yml | 3 ++- includes/object_properties.form.inc | 4 ++-- includes/tuque_wrapper.inc | 2 +- islandora.install | 5 +++-- islandora.module | 2 +- tests/travis_setup.sh | 3 +++ tests/web_test_case.inc | 3 ++- theme/islandora-objects.tpl.php | 8 +++++++- 8 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index e5ced01d..dc0a8794 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,6 @@ env: before_install: - $TRAVIS_BUILD_DIR/tests/travis_setup.sh - cd $HOME/drupal-* -script: +script: + - drush dcs sites/all/modules/islandora - drush test-run --uri=http://localhost:8081 Islandora diff --git a/includes/object_properties.form.inc b/includes/object_properties.form.inc index 0898db0c..c9de5e8f 100644 --- a/includes/object_properties.form.inc +++ b/includes/object_properties.form.inc @@ -43,14 +43,14 @@ function islandora_object_properties_form(array $form, array &$form_state, Fedor '#title' => t('Owner'), '#default_value' => $object->owner, '#required' => FALSE, - '#description' => t('The owner\'s account name'), + '#description' => t("The owner's account name"), '#type' => 'textfield', ), 'object_state' => array( '#title' => t('State'), '#default_value' => $object->state, '#required' => TRUE, - '#description' => t('The object\'s state (active, inactive or deleted)'), + '#description' => t("The object's state (active, inactive or deleted)"), '#type' => 'select', '#options' => array('A' => 'Active', 'I' => 'Inactive', 'D' => 'Deleted'), ), diff --git a/includes/tuque_wrapper.inc b/includes/tuque_wrapper.inc index 8e4e8a0f..4d989e9f 100644 --- a/includes/tuque_wrapper.inc +++ b/includes/tuque_wrapper.inc @@ -36,7 +36,7 @@ $islandora_module_path = drupal_get_path('module', 'islandora'); */ function islandora_alter_object(AbstractFedoraObject $object, array &$context) { module_load_include('inc', 'islandora', 'includes/utilities'); - drupal_alter(islandora_build_hook_list('islandora_object', $object->models) ,$object, $context); + drupal_alter(islandora_build_hook_list('islandora_object', $object->models), $object, $context); } /** diff --git a/islandora.install b/islandora.install index 9a1825b5..caff7d75 100644 --- a/islandora.install +++ b/islandora.install @@ -10,13 +10,14 @@ */ function islandora_requirements($phase) { $requirements = array(); - // Ensure translations don't break at install time + + // Ensure translations don't break at install time. $t = get_t(); if (!class_exists('XSLTProcessor', FALSE)) { $requirements['islandora_xsltprocessor']['title'] = $t('Islandora XSLTProcessor Prerequisite'); $requirements['islandora_xsltprocessor']['value'] = $t('Not installed'); - $link = l($t('PHP XSL extension'), 'http://us2.php.net/manual/en/book.xsl.php', array('attributes' => array('target'=>'_blank'))); + $link = l($t('PHP XSL extension'), 'http://us2.php.net/manual/en/book.xsl.php', array('attributes' => array('target' => '_blank'))); $requirements['islandora_xsltprocessor']['description'] = $t('The !xsllink is required. Check your installed PHP extensions and php.ini file.', array('!xsllink' => $link)); $requirements['islandora_xsltprocessor']['severity'] = REQUIREMENT_ERROR; } diff --git a/islandora.module b/islandora.module index 05a3a57b..981189bc 100644 --- a/islandora.module +++ b/islandora.module @@ -120,7 +120,7 @@ function islandora_menu() { FEDORA_METADATA_EDIT, FEDORA_ADD_DS, FEDORA_PURGE, - FEDORA_INGEST + FEDORA_INGEST, ), 2), ); diff --git a/tests/travis_setup.sh b/tests/travis_setup.sh index 936aea0d..abbaccd2 100755 --- a/tests/travis_setup.sh +++ b/tests/travis_setup.sh @@ -13,6 +13,7 @@ export CATALINA_HOME='.' cd $HOME pyrus channel-discover pear.drush.org pyrus install drush/drush +pyrus install pear/PHP_CodeSniffer phpenv rehash drush dl --yes drupal cd drupal-* @@ -22,6 +23,8 @@ ln -s $TRAVIS_BUILD_DIR sites/all/modules/islandora mv sites/all/modules/islandora/tests/travis.test_config.ini sites/all/modules/islandora/tests/test_config.ini mkdir sites/all/libraries ln -s $HOME/tuque sites/all/libraries/tuque +drush dl --yes coder +drush en --yes coder_review drush en --yes simpletest drush en --user=1 --yes islandora drush cc all diff --git a/tests/web_test_case.inc b/tests/web_test_case.inc index 3651e3db..8a5b9a00 100644 --- a/tests/web_test_case.inc +++ b/tests/web_test_case.inc @@ -18,7 +18,8 @@ class IslandoraWebTestCase extends DrupalWebTestCase { // Always enable islandora. $args[] = 'islandora'; parent::setUp($args); - // Its possible test are running before class autoloading + + // Its possible test are running before class autoloading. module_load_include('inc', 'islandora', 'includes/tuque'); module_load_include('inc', 'islandora', 'includes/tuque_wrapper'); diff --git a/theme/islandora-objects.tpl.php b/theme/islandora-objects.tpl.php index 5b55eb88..f1893ef6 100644 --- a/theme/islandora-objects.tpl.php +++ b/theme/islandora-objects.tpl.php @@ -7,7 +7,13 @@ ?>
- $display_links, 'attributes' => array('class' => array('links', 'inline')))); ?> + $display_links, + 'attributes' => array('class' => array('links', 'inline')), + ) + ); + ?> From b9d0eaebb09a171e82eca34a9d174e63aa93447c Mon Sep 17 00:00:00 2001 From: jonathangreen Date: Thu, 4 Apr 2013 20:15:17 -0300 Subject: [PATCH 2/3] Added a lint to travis. Just in case. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index dc0a8794..124d7ce9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,6 @@ before_install: - $TRAVIS_BUILD_DIR/tests/travis_setup.sh - cd $HOME/drupal-* script: + - ant lint - drush dcs sites/all/modules/islandora - drush test-run --uri=http://localhost:8081 Islandora From d67c95f90174876700121d3b56aea8062c65a29f Mon Sep 17 00:00:00 2001 From: jonathangreen Date: Thu, 4 Apr 2013 20:22:27 -0300 Subject: [PATCH 3/3] Fixed ant path issue --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 124d7ce9..0c5fe32a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,6 @@ before_install: - $TRAVIS_BUILD_DIR/tests/travis_setup.sh - cd $HOME/drupal-* script: - - ant lint + - ant -buildfile sites/all/modules/islandora/build.xml lint - drush dcs sites/all/modules/islandora - drush test-run --uri=http://localhost:8081 Islandora