Skip to content

Commit

Permalink
Merge pull request #1678 from Automattic/sensei-phpcs-take-2
Browse files Browse the repository at this point in the history
Add Sensei Coding Standard Step to circleci
  • Loading branch information
pgk authored Dec 15, 2016
2 parents f14d921 + 1d9fdcd commit e66da7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ machine:
CIRCLE_ENV: test
WP_MULTISITE: 0
WP_CORE_DIR: /home/ubuntu/wordpress-develop
SENSEI_CODING_STANDARD_DIR: /home/ubuntu/sensei_coding_standard
WP_TESTS_DIR: /home/ubuntu/wordpress-develop/tests/phpunit
plugin_loc: /home/ubuntu/$CIRCLE_PROJECT_REPONAME
plugin_slug: $CIRCLE_PROJECT_REPONAME
Expand All @@ -34,9 +35,12 @@ dependencies:
# setup phpunit
- wget https://phar.phpunit.de/phpunit-old.phar && chmod +x phpunit-old.phar && mv phpunit-old.phar /home/ubuntu/.phpenv/shims/phpunit
#Sensei Specific remove npm file as it is not needed
# Clone sensei-coding-standard
- git clone https://github.com/Automattic/sensei-coding-standard.git $SENSEI_CODING_STANDARD_DIR;

## tests override
test:
override:
#run tests with coverage
- cd $SENSEI_CODING_STANDARD_DIR; php bin/phpcs.phar --report-full --report-summary --standard=Sensei $plugin_loc
- cd $plugin_loc; phpunit #ignoring coverage for speed reasons: --coverage-html $CIRCLE_ARTIFACTS
5 changes: 3 additions & 2 deletions includes/class-sensei-quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -1214,9 +1214,10 @@ public static function the_user_status_message( $quiz_id ){
$lesson_id = Sensei()->quiz->get_lesson_id( $quiz_id );
$status = Sensei_Utils::sensei_user_quiz_status_message( $lesson_id , get_current_user_id() );
$message = '<div class="sensei-message ' . $status['box_class'] . '">' . $status['message'] . '</div>';
$messages = Sensei()->frontend->messages;

if ( !empty( Sensei()->frontend->messages ) ) {
$message .= Sensei()->frontend->messages;
if ( !empty( $messages ) ) {
$message .= $messages;
}

echo $message;
Expand Down

0 comments on commit e66da7b

Please sign in to comment.