Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
build: use drupal-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrfritsch authored Feb 12, 2020
1 parent 0a5e55c commit d2ffbc0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cache:
- "$HOME/.npm"

php:
- 7.2
- 7.3

branches:
only:
Expand All @@ -22,8 +22,18 @@ env:
global:
- PATH="$PATH:$HOME/.composer/vendor/bin"

matrix:
include:
- env: DRUPAL_TESTING_DRUPAL_VERSION=~8.8.0
php: 7.2
- env: DRUPAL_TESTING_DRUPAL_VERSION=~8.8.0

before_install:
- composer global require thunder/travis
- composer global require thunder/drupal-testing

before_script:
- phpenv config-rm xdebug.ini

script:
- test-drupal-project

Expand Down
2 changes: 2 additions & 0 deletions config/install/nexx_integration.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ nexx_api_url: 'https://api.nexx.cloud/hooks/thunder.omnia'
nexx_api_authkey: ''
omnia_id: 0
notification_access_key: ''
api_secret: ''
bigger_thumbnail: false
6 changes: 6 additions & 0 deletions config/schema/nexx_integration.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ nexx_integration.settings:
notification_access_key:
type: string
label: 'NEXX notification access key.'
api_secret:
type: string
label: 'NEXX notification API secret.'
bigger_thumbnail:
type: boolean
label: 'Allow bigger thumbnail'

media.source.nexx_video:
type: media.source.field_aware
Expand Down
9 changes: 5 additions & 4 deletions nexx_integration.module
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,12 @@ function nexx_integration_cron() {
$ids = $storage->getQuery()
->condition($video_field . '.validfrom_ssc', \Drupal::time()->getRequestTime(), '<=')
->condition($video_field . '.validto_ssc', \Drupal::time()->getRequestTime(), '>')
->condition("status", FALSE)
->condition("status", 0)
->execute();

foreach ($storage->loadMultiple($ids) as $video) {
$video->set("status", TRUE);
/** @var \Drupal\media\MediaInterface $video */
$video->setPublished();
$video->save();
$logger->info("Published nexx video \"@videoname\" (id: @id)", [
'@videoname' => $video->label(),
Expand All @@ -286,12 +287,12 @@ function nexx_integration_cron() {
$ids = $storage->getQuery()
->condition($video_field . '.validto_ssc', 0, '<>')
->condition($video_field . '.validto_ssc', \Drupal::time()->getRequestTime(), '<=')
->condition("status", TRUE)
->condition("status", 1)
->execute();

foreach ($storage->loadMultiple($ids) as $video) {
/** @var \Drupal\media\MediaInterface $video */
$video->set("status", FALSE);
$video->setUnpublished();
$video->save();
$logger->info("Unpublished nexx video \"@videoname\" (id: @id)", [
'@videoname' => $video->label(),
Expand Down

0 comments on commit d2ffbc0

Please sign in to comment.