Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Commit 10a75ce

Browse files
authored
ci: fix automated tests (#312)
1 parent e2dd3d7 commit 10a75ce

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

scripts/development/build-contenta_jsonapi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ if [ $? -ne 0 ]; then
7474
fi
7575

7676
echo -e "${FG_C}${BG_C} EXECUTING ${NO_C} $DRUSH en -y recipes_magazin contentajs\n\n"
77-
$DRUSH en -y recipes_magazin contentajs
77+
$DRUSH en -y recipes_magazin contentajs contenta_graphql
7878

7979
echo -e "\n\n\n"
8080
echo -e "\t********************************"

scripts/development/start-contenta_jsonapi.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ if [ -e .env.local ]; then
77
fi
88

99
BASE_DIR="$(dirname $(dirname $(cd ${0%/*} && pwd)))"
10-
COMPOSER="$(which composer)"
1110
COMPOSER_BIN_DIR="$(composer config bin-dir)"
1211
DOCROOT="web"
1312

@@ -24,13 +23,11 @@ else
2423
DEST_DIR="$( dirname $BASE_DIR )/test_contenta_jsonapi"
2524
fi
2625

27-
cd ${DEST_DIR}
28-
cd ${DOCROOT}
26+
cd "$DEST_DIR/$DOCROOT"
2927

3028
echo -e "\n"
31-
pwd
32-
ls -lisa
33-
DRUSH="$BASE_DIR/$COMPOSER_BIN_DIR/drush"
29+
find $DEST_DIR -name drush
30+
DRUSH="$DEST_DIR/$COMPOSER_BIN_DIR/drush"
3431

3532

3633
echo "-------------------------------------"

tests/src/Functional/InstallationTest.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,17 @@ public function testKnownResources() {
7070
}
7171

7272
public function testRpcMethod() {
73-
$url = Url::fromUri('internal:/jsonrpc', [
74-
'query' => '{"jsonrpc":"2.0","method":"jsonapi.metadata","id":"cms-meta"}',
75-
'absolute' => TRUE,
76-
])->toString();
77-
$response = $this->httpClient->request('GET', $url);
73+
$response = $this->httpClient->request(
74+
'GET',
75+
$this->baseUrl . '/jsonrpc',
76+
[
77+
'query' => [
78+
'query' => '{"jsonrpc":"2.0","method":"jsonapi.metadata","id":"cms-meta"}'
79+
],
80+
]);
7881
$body = $response->getBody()->getContents();
7982
$output = Json::decode($body);
80-
$this->assertEquals('api', $output['result']['prefix']);
83+
$this->assertEquals('/api', $output['result']['prefix']);
8184
$this->assertEquals('/api', $output['result']['openApi']['basePath']);
8285
$response = $this->httpClient->request(
8386
'POST',
@@ -86,7 +89,7 @@ public function testRpcMethod() {
8689
);
8790
$body = $response->getBody()->getContents();
8891
$output = Json::decode($body);
89-
$this->assertEquals('api', $output['result']['prefix']);
92+
$this->assertEquals('/api', $output['result']['prefix']);
9093
$this->assertEquals('/api', $output['result']['openApi']['basePath']);
9194
}
9295

0 commit comments

Comments
 (0)