Browse Source

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.
pull/304/head
jonathangreen 12 years ago
parent
commit
092133272e
  1. 1
      .travis.yml
  2. 4
      includes/object_properties.form.inc
  3. 2
      includes/tuque_wrapper.inc
  4. 5
      islandora.install
  5. 2
      islandora.module
  6. 3
      tests/travis_setup.sh
  7. 3
      tests/web_test_case.inc
  8. 8
      theme/islandora-objects.tpl.php

1
.travis.yml

@ -11,4 +11,5 @@ before_install:
- $TRAVIS_BUILD_DIR/tests/travis_setup.sh - $TRAVIS_BUILD_DIR/tests/travis_setup.sh
- cd $HOME/drupal-* - cd $HOME/drupal-*
script: script:
- drush dcs sites/all/modules/islandora
- drush test-run --uri=http://localhost:8081 Islandora - drush test-run --uri=http://localhost:8081 Islandora

4
includes/object_properties.form.inc

@ -43,14 +43,14 @@ function islandora_object_properties_form(array $form, array &$form_state, Fedor
'#title' => t('Owner'), '#title' => t('Owner'),
'#default_value' => $object->owner, '#default_value' => $object->owner,
'#required' => FALSE, '#required' => FALSE,
'#description' => t('The owner\'s account name'), '#description' => t("The owner's account name"),
'#type' => 'textfield', '#type' => 'textfield',
), ),
'object_state' => array( 'object_state' => array(
'#title' => t('State'), '#title' => t('State'),
'#default_value' => $object->state, '#default_value' => $object->state,
'#required' => TRUE, '#required' => TRUE,
'#description' => t('The object\'s state (active, inactive or deleted)'), '#description' => t("The object's state (active, inactive or deleted)"),
'#type' => 'select', '#type' => 'select',
'#options' => array('A' => 'Active', 'I' => 'Inactive', 'D' => 'Deleted'), '#options' => array('A' => 'Active', 'I' => 'Inactive', 'D' => 'Deleted'),
), ),

2
includes/tuque_wrapper.inc

@ -36,7 +36,7 @@ $islandora_module_path = drupal_get_path('module', 'islandora');
*/ */
function islandora_alter_object(AbstractFedoraObject $object, array &$context) { function islandora_alter_object(AbstractFedoraObject $object, array &$context) {
module_load_include('inc', 'islandora', 'includes/utilities'); 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);
} }
/** /**

5
islandora.install

@ -10,13 +10,14 @@
*/ */
function islandora_requirements($phase) { function islandora_requirements($phase) {
$requirements = array(); $requirements = array();
// Ensure translations don't break at install time
// Ensure translations don't break at install time.
$t = get_t(); $t = get_t();
if (!class_exists('XSLTProcessor', FALSE)) { if (!class_exists('XSLTProcessor', FALSE)) {
$requirements['islandora_xsltprocessor']['title'] = $t('Islandora XSLTProcessor Prerequisite'); $requirements['islandora_xsltprocessor']['title'] = $t('Islandora XSLTProcessor Prerequisite');
$requirements['islandora_xsltprocessor']['value'] = $t('Not installed'); $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']['description'] = $t('The !xsllink is required. Check your installed PHP extensions and php.ini file.', array('!xsllink' => $link));
$requirements['islandora_xsltprocessor']['severity'] = REQUIREMENT_ERROR; $requirements['islandora_xsltprocessor']['severity'] = REQUIREMENT_ERROR;
} }

2
islandora.module

@ -120,7 +120,7 @@ function islandora_menu() {
FEDORA_METADATA_EDIT, FEDORA_METADATA_EDIT,
FEDORA_ADD_DS, FEDORA_ADD_DS,
FEDORA_PURGE, FEDORA_PURGE,
FEDORA_INGEST FEDORA_INGEST,
), 2), ), 2),
); );

3
tests/travis_setup.sh

@ -13,6 +13,7 @@ export CATALINA_HOME='.'
cd $HOME cd $HOME
pyrus channel-discover pear.drush.org pyrus channel-discover pear.drush.org
pyrus install drush/drush pyrus install drush/drush
pyrus install pear/PHP_CodeSniffer
phpenv rehash phpenv rehash
drush dl --yes drupal drush dl --yes drupal
cd 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 mv sites/all/modules/islandora/tests/travis.test_config.ini sites/all/modules/islandora/tests/test_config.ini
mkdir sites/all/libraries mkdir sites/all/libraries
ln -s $HOME/tuque sites/all/libraries/tuque ln -s $HOME/tuque sites/all/libraries/tuque
drush dl --yes coder
drush en --yes coder_review
drush en --yes simpletest drush en --yes simpletest
drush en --user=1 --yes islandora drush en --user=1 --yes islandora
drush cc all drush cc all

3
tests/web_test_case.inc

@ -18,7 +18,8 @@ class IslandoraWebTestCase extends DrupalWebTestCase {
// Always enable islandora. // Always enable islandora.
$args[] = 'islandora'; $args[] = 'islandora';
parent::setUp($args); 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');
module_load_include('inc', 'islandora', 'includes/tuque_wrapper'); module_load_include('inc', 'islandora', 'includes/tuque_wrapper');

8
theme/islandora-objects.tpl.php

@ -7,7 +7,13 @@
?> ?>
<div class="islandora-objects clearfix"> <div class="islandora-objects clearfix">
<span class="islandora-objects-display-switch"> <span class="islandora-objects-display-switch">
<?php print theme('links', array('links' => $display_links, 'attributes' => array('class' => array('links', 'inline')))); ?> <?php
print theme('links', array(
'links' => $display_links,
'attributes' => array('class' => array('links', 'inline')),
)
);
?>
</span> </span>
<?php print $pager; ?> <?php print $pager; ?>
<?php print $content; ?> <?php print $content; ?>

Loading…
Cancel
Save