Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,38 @@ language: php
sudo: false

php:
- 7.3
- 7.2
- 7.1
- 7
- 5.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine to drop 5, let's keep 7.1 and 7.0

- 7.0

services:
- mysql

env:
global:
- DRUPAL_BUILD_DIR=$TRAVIS_BUILD_DIR/../drupal
- SIMPLETEST_DB=mysql://root:@127.0.0.1/graphql
- TRAVIS=true
matrix:
- DRUPAL_CORE=8.3.x
- DRUPAL_CORE=8.4.x
- DRUPAL_CORE=8.5.x
- DRUPAL_CORE=8.6.x
- DRUPAL_CORE=8.7.x
- DRUPAL_CORE=8.8.x

matrix:
# Don't wait for the allowed failures to build.
fast_finish: true
include:
- php: 7.1
- php: 7.3
env:
- DRUPAL_CORE=8.6.x
- DRUPAL_CORE=8.7.x
# Only run code coverage on the latest php and drupal versions.
- WITH_PHPDBG_COVERAGE=true
allow_failures:
# Allow the code coverage report to fail.
- php: 7.1
- php: 7.3
env:
- DRUPAL_CORE=8.6.x
- DRUPAL_CORE=8.7.x
# Only run code coverage on the latest php and drupal versions.
- WITH_PHPDBG_COVERAGE=true

Expand All @@ -54,14 +57,6 @@ before_install:
else export PHPINI=$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini;
fi

# PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated
# and will be removed in a future version. To avoid this warning set
# 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input
# stream instead.
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]];
then echo always_populate_raw_post_data = -1 >> $PHPINI;
fi;

# Disable the default memory limit.
- echo memory_limit = -1 >> $PHPINI

Expand Down Expand Up @@ -93,7 +88,15 @@ install:
# require also triggers a full 'composer install'.
- composer --working-dir=$DRUPAL_BUILD_DIR require webonyx/graphql-php:^0.12.5

- if [[ "$DRUPAL_CORE" != "8.3.x" && "$DRUPAL_CORE" != "8.4.x" ]];
# For Drupal < 8.8 we have to manually upgrade zend-stdlib to avoid PHP 7.3
# incompatibilities.
- if [[ "$DRUPAL_CORE" = "8.6.x" || "$DRUPAL_CORE" = "8.7.x" ]];
then composer --working-dir=$DRUPAL_BUILD_DIR require zendframework/zend-stdlib:3.2.1;
fi

# For Drupal < 8.8 we have to manually upgrade phpunit to avoid PHP 7.3
# incompatibilities.
- if [[ "$DRUPAL_CORE" = "8.6.x" || "$DRUPAL_CORE" = "8.7.x" ]];
then composer --working-dir=$DRUPAL_BUILD_DIR run-script drupal-phpunit-upgrade;
fi

Expand Down
10 changes: 9 additions & 1 deletion modules/graphql_core/tests/src/Kernel/Blocks/BlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
namespace Drupal\Tests\graphql_core\Kernel\Blocks;

use Drupal\block_content\Entity\BlockContent;
use Drupal\simpletest\BlockCreationTrait;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Tests\block\Traits\BlockCreationTrait;
use Drupal\Tests\graphql_core\Kernel\GraphQLCoreTestBase;

/**
Expand All @@ -25,6 +26,7 @@ class BlockTest extends GraphQLCoreTestBase {
'filter',
'editor',
'ckeditor',
'path',
'graphql_block_test',
];

Expand All @@ -39,6 +41,12 @@ protected function setUp() {
$themeInstaller->install(['stark']);

$this->installEntitySchema('block_content');
try {
$this->installEntitySchema('path_alias');
} catch (PluginNotFoundException $exc) {
// Ignore if the path_alias entity doesn't exist. This means we are
// testing a Drupal version < 8.8 and aliases are not entities yet.
}
$this->installConfig('block_content');
$this->installConfig('graphql_block_test');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\node\Entity\Node;
use Drupal\Tests\graphql_core\Traits\RevisionsTestTrait;
use Drupal\simpletest\ContentTypeCreationTrait;
use Drupal\simpletest\NodeCreationTrait;
use Drupal\simpletest\UserCreationTrait;
use Drupal\Tests\node\Traits\ContentTypeCreationTrait;
use Drupal\Tests\node\Traits\NodeCreationTrait;
use Drupal\Tests\user\Traits\UserCreationTrait;

/**
* Base class for node based tests.
Expand Down
9 changes: 0 additions & 9 deletions modules/graphql_core/tests/src/Kernel/Menu/MenuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ public function testMenuTree() {
],
],
1 => [
'label' => 'Inaccessible',
'route' => [
'path' => '/',
'routed' => TRUE,
],
'attribute' => NULL,
'links' => [],
],
2 => [
'label' => 'Drupal',
'route' => [
'path' => 'http://www.drupal.org',
Expand Down
10 changes: 9 additions & 1 deletion tests/src/Kernel/Framework/InvalidPayloadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
class InvalidPayloadTest extends GraphQLTestBase {

public function testEmptyPayload() {
$this->container->get('http_kernel')->handle(Request::create('/graphql', 'POST', [], [], [], [], '{ invalid'));
/** @var \Symfony\Component\HttpFoundation\Response $result */
$result = $this->container->get('http_kernel')
->handle(Request::create('/graphql', 'POST', [], [], [], [], '{ invalid'));
$this->assertJson($result->getContent(), json_encode([
'errors' => [
'message' => "GraphQL Request must include at least one of those two parameters: \u0022query\u0022 or \u0022queryId\u0022\"",
'category' => "request"
]
]));
}

}