diff --git a/composer.lock b/composer.lock index b98950b5..ab11ff8c 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "guzzlehttp/guzzle", - "version": "6.4.1", + "version": "6.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "0895c932405407fd3a7368b6910c09a24d26db11" + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11", - "reference": "0895c932405407fd3a7368b6910c09a24d26db11", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82", + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82", "shasum": "" }, "require": { @@ -32,12 +32,13 @@ "psr/log": "^1.1" }, "suggest": { + "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.3-dev" + "dev-master": "6.5-dev" } }, "autoload": { @@ -70,7 +71,7 @@ "rest", "web service" ], - "time": "2019-10-23T15:58:00+00:00" + "time": "2019-12-23T11:57:10+00:00" }, { "name": "guzzlehttp/promises", @@ -551,16 +552,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -595,7 +596,7 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "nette/bootstrap", @@ -1465,16 +1466,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "4.3.4", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", "shasum": "" }, "require": { @@ -1486,6 +1487,7 @@ "require-dev": { "doctrine/instantiator": "^1.0.5", "mockery/mockery": "^1.0", + "phpdocumentor/type-resolver": "0.4.*", "phpunit/phpunit": "^6.4" }, "type": "library", @@ -1512,7 +1514,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-09-12T14:27:41+00:00" + "time": "2019-12-28T18:55:12+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1563,33 +1565,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -1622,7 +1624,7 @@ "spy", "stub" ], - "time": "2019-10-03T11:07:50+00:00" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -2057,16 +2059,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.17", + "version": "7.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a" + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4c92a15296e58191a4cd74cff3b34fc8e374174a", - "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", "shasum": "" }, "require": { @@ -2137,7 +2139,7 @@ "testing", "xunit" ], - "time": "2019-10-28T10:37:36+00:00" + "time": "2020-01-08T08:45:45+00:00" }, { "name": "psr/container", @@ -3120,16 +3122,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "shasum": "" }, "require": { @@ -3141,7 +3143,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.14-dev" } }, "autoload": { @@ -3174,7 +3176,7 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2020-01-13T11:15:53+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3502,16 +3504,16 @@ }, { "name": "webmozart/assert", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598", + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598", "shasum": "" }, "require": { @@ -3546,7 +3548,7 @@ "check", "validate" ], - "time": "2019-11-24T13:36:37+00:00" + "time": "2020-02-14T12:15:55+00:00" } ], "aliases": [], diff --git a/src/Connector/Client.php b/src/Connector/Client.php index 2c1e65d8..25860e60 100644 --- a/src/Connector/Client.php +++ b/src/Connector/Client.php @@ -60,7 +60,10 @@ public static function factory(ConnectorInterface $connector) */ public function request(string $verb, string $path, array $options = []) { - $options = $this->options; + // @TODO follow this up by removing $options from the parameters able + // to be passed into this function and instead solely relying on the + // addOption() method as this can then be tested. + $options = $this->options + $options; $options['query'] = $this->query; if (!empty($options['query']['filter']) && is_array($options['query']['filter'])) { diff --git a/tests/Fixtures/Endpoints/Environments/getAllEnvironments.json b/tests/Fixtures/Endpoints/Environments/getAllEnvironments.json index 11c54668..f79f8500 100644 --- a/tests/Fixtures/Endpoints/Environments/getAllEnvironments.json +++ b/tests/Fixtures/Endpoints/Environments/getAllEnvironments.json @@ -1,223 +1,226 @@ { - "total": 3, - "_links": { - "self": { - "href": "{baseUri}/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470/environments" - }, - "sort": { - "href": "{baseUri}/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470/environments{?sort}", - "templated": true - }, - "filter": { - "href": "{baseUri}/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470/environments{?filter}", - "templated": true + "total": 3, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470/environments" + }, + "sort": { + "href": "https://cloud.acquia.com/api/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470/environments{?sort}", + "templated": true + }, + "filter": { + "href": "https://cloud.acquia.com/api/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470/environments{?filter}", + "templated": true + }, + "limit": { + "href": "https://cloud.acquia.com/api/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470/environments{?limit}", + "templated": true + }, + "parent": { + "href": "https://cloud.acquia.com/api/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470" + } + }, + "_embedded": { + "items": [ + { + "id": "24-a47ac10b-58cc-4372-a567-0e02b2c3d470", + "label": "Dev", + "name": "dev", + "application": { + "name": "Sample Drupal application", + "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470" }, - "limit": { - "href": "{baseUri}/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470/environments{?limit}", - "templated": true + "domains": [ + "sitedev.hosted.acquia-sites.com", + "example.com" + ], + "active_domain": "example.com", + "default_domain": "sitedev.hosted.acquia-sites.com", + "image_url": null, + "ips": [ + "10.0.1.5" + ], + "region": "us-east-1", + "status": "normal", + "type": "drupal", + "size": null, + "weight": 0, + "vcs": { + "type": "git", + "path": "master", + "url": "site@svn-3.hosted.acquia-sites.com:site.git" }, - "parent": { - "href": "{baseUri}/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470" - } - }, - "_embedded": { - "items": [ - { - "id": "24-a47ac10b-58cc-4372-a567-0e02b2c3d470", - "label": "Dev", - "name": "dev", - "application": { - "name": "Sample Drupal application", - "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470" - }, - "domains": [ - "sitedev.hosted.acquia-sites.com", "example.com" - ], - "active_domain": "example.com", - "default_domain": "sitedev.hosted.acquia-sites.com", - "image_url": null, - "ips": [ - "10.0.1.5" - ], - "region": "us-east-1", - "status": "normal", - "type": "drupal", - "size": null, - "weight": 0, - "vcs": { - "type": "git", - "path": "master", - "url": "site@svn-3.hosted.acquia-sites.com:site.git" - }, - "insight": { - "status": "ok", - "scores": { - "insight": 87, - "seo": 56 - }, - "counts": { - "best_practices": { - "pass": 7, - "fail": 0, - "ignored": 0, - "total": 7, - "percent": 100 - }, - "performance": { - "pass": 22, - "fail": 0, - "ignored": 0, - "total": 22, - "percent": 100 - }, - "security": { - "pass": 23, - "fail": 0, - "ignored": 0, - "total": 23, - "percent": 100 - } - } - }, - "flags": { - "cde": false, - "hsd": false, - "livedev": false, - "multi_region": false, - "production": false, - "production_mode": false, - "remote_admin": false, - "varnish": true, - "varnish_over_ssl": false, - "service_management": true - }, - "configuration": { - "operating_system": "precise", - "php": { - "version": "5.6", - "memory_limit": 128, - "apc": 96, - "max_execution_time": 300, - "max_post_size": 256, - "max_input_vars": 1000, - "sendmail_path": null - } - }, - "artifact": null, - "_links": { - "self": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470" - } - } + "insight": { + "status": "ok", + "scores": { + "insight": 87, + "seo": 56 + }, + "counts": { + "best_practices": { + "pass": 7, + "fail": 0, + "ignored": 0, + "total": 7, + "percent": 100 }, - { - "id": "15-a47ac10b-58cc-4372-a567-0e02b2c3d470", - "label": "Production", - "name": "prod", - "application": { - "name": "Sample SiteFactory application", - "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470" - }, - "domains": [ - "siteprod.hosted.acquia-sites.com", "my-domain-prod.com" - ], - "gardener": { - "site-update": "my-domain-prod.com/admin/gardens/site-update", - "multi-site": "my-domain-prod.com/admin/gardens/staging" - }, - "active_domain": "my-domain-prod.com", - "image_url": null, - "ips": [ - "10.0.1.1", "10.0.1.2" - ], - "region": "us-east-1", - "status": "normal", - "type": "drupal", - "size": null, - "weight": 0, - "vcs": { - "type": "git", - "path": "tags/01-01-2015", - "url": "site@svn-3.hosted.acquia-sites.com:site.git" - }, - "insight": null, - "flags": { - "cde": false, - "hsd": false, - "livedev": false, - "multi_region": false, - "production": true, - "production_mode": true, - "remote_admin": false, - "varnish": true, - "varnish_over_ssl": false, - "service_management": false - }, - "configuration": null, - "artifact": null, - "_links": { - "self": { - "href": "{baseUri}/environments/15-a47ac10b-58cc-4372-a567-0e02b2c3d470" - } - } + "performance": { + "pass": 22, + "fail": 0, + "ignored": 0, + "total": 22, + "percent": 100 }, - { - "id": "32-a47ac10b-58cc-4372-a567-0e02b2c3d470", - "label": "Stage", - "name": "test", - "application": { - "name": "Sample Node application", - "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470" - }, - "domains": [ - "sitetest.hosted.acquia-sites.com", "my-domain-test.com" - ], - "active_domain": "my-domain-test.com", - "image_url": null, - "ips": [], - "region": "us-east-1", - "status": "normal", - "type": "node", - "size": "medium", - "weight": 20, - "vcs": { - "type": "git", - "path": null, - "url": "qa10@svn-3.networkdev.ahserversdev.com:qa10.git" - }, - "insight": { - "status": "not-found", - "scores": null, - "counts": null - }, - "flags": { - "cde": false, - "hsd": false, - "livedev": false, - "multi_region": false, - "production": false, - "production_mode": false, - "remote_admin": false, - "varnish": true, - "varnish_over_ssl": false, - "service_management": false - }, - "configuration": { - "operating_system": "precise", - "node": { - "version": "6.11.1" - } - }, - "artifact": { - "id": 1, - "name": "Example artifact" - }, - "_links": { - "self": { - "href": "{baseUri}/environments/32-a47ac10b-58cc-4372-a567-0e02b2c3d470" - } - } + "security": { + "pass": 23, + "fail": 0, + "ignored": 0, + "total": 23, + "percent": 100 } - ] - } + } + }, + "flags": { + "cde": false, + "hsd": false, + "livedev": false, + "multi_region": false, + "production": false, + "production_mode": false, + "remote_admin": false, + "varnish": true, + "varnish_over_ssl": false + }, + "configuration": { + "operating_system": "precise", + "php": { + "version": "7.2", + "memory_limit": 128, + "opcache": 96, + "apcu": 32, + "interned_strings_buffer": 16, + "max_execution_time": 300, + "max_post_size": 256, + "max_input_vars": 1000, + "sendmail_path": null + } + }, + "artifact": null, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470" + } + } + }, + { + "id": "15-a47ac10b-58cc-4372-a567-0e02b2c3d470", + "label": "Production", + "name": "prod", + "application": { + "name": "Sample SiteFactory application", + "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470" + }, + "domains": [ + "siteprod.hosted.acquia-sites.com", + "example.com" + ], + "gardener": { + "site-update": "prod.example.com/admin/gardens/site-update", + "multi-site": "prod.example.com/admin/gardens/staging" + }, + "active_domain": "example.com", + "image_url": null, + "ips": [ + "10.0.1.1", + "10.0.1.2" + ], + "region": "us-east-1", + "status": "normal", + "type": "drupal", + "size": null, + "weight": 0, + "vcs": { + "type": "git", + "path": "tags/01-01-2015", + "url": "site@svn-3.hosted.acquia-sites.com:site.git" + }, + "insight": null, + "flags": { + "cde": false, + "hsd": false, + "livedev": false, + "multi_region": false, + "production": true, + "production_mode": true, + "remote_admin": false, + "varnish": true, + "varnish_over_ssl": false + }, + "configuration": null, + "artifact": null, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/environments/15-a47ac10b-58cc-4372-a567-0e02b2c3d470" + } + } + }, + { + "id": "32-a47ac10b-58cc-4372-a567-0e02b2c3d470", + "label": "Stage", + "name": "test", + "application": { + "name": "Sample Node application", + "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470" + }, + "domains": [ + "sitetest.hosted.acquia-sites.com", + "test.example.com" + ], + "active_domain": "test.example.com", + "image_url": null, + "ips": [], + "region": "us-east-1", + "status": "normal", + "type": "node", + "size": "medium", + "weight": 20, + "vcs": { + "type": "git", + "path": null, + "url": "qa10@svn-3.networkdev.ahserversdev.com:qa10.git" + }, + "insight": { + "status": "not-found", + "scores": null, + "counts": null + }, + "flags": { + "cde": false, + "hsd": false, + "livedev": false, + "multi_region": false, + "production": false, + "production_mode": false, + "remote_admin": false, + "varnish": true, + "varnish_over_ssl": false + }, + "configuration": { + "operating_system": "precise", + "node": { + "version": "6.11.1" + } + }, + "artifact": { + "id": 1, + "name": "Example artifact" + }, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/environments/32-a47ac10b-58cc-4372-a567-0e02b2c3d470" + } + } + } + ] + } } diff --git a/tests/Fixtures/Endpoints/Environments/getEnvironment.json b/tests/Fixtures/Endpoints/Environments/getEnvironment.json index 3bc188e9..347395f9 100644 --- a/tests/Fixtures/Endpoints/Environments/getEnvironment.json +++ b/tests/Fixtures/Endpoints/Environments/getEnvironment.json @@ -1,146 +1,154 @@ { - "id": "24-a47ac10b-58cc-4372-a567-0e02b2c3d470", - "label": "Dev", - "name": "dev", - "application": { - "name": "Sample application", - "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470" - }, - "domains": [ - "sitedev.hosted.acquia-sites.com", "example.com" - ], - "active_domain": "example.com", - "default_domain": "sitedev.hosted.acquia-sites.com", - "image_url": null, - "ips": [ - "10.0.1.5" - ], - "region": "us-east-1", - "status": "normal", - "type": "drupal", - "size": null, - "ssh_url": "site.dev@server-123.hosted.hosting.acquia.com", - "weight": 0, - "vcs": { - "type": "git", - "path": "master", - "url": "site@svn-3.hosted.acquia-sites.com:site.git" + "id": "24-a47ac10b-58cc-4372-a567-0e02b2c3d470", + "label": "Dev", + "name": "dev", + "application": { + "name": "Sample application", + "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470" + }, + "domains": [ + "sitedev.hosted.acquia-sites.com", + "example.com" + ], + "active_domain": "example.com", + "default_domain": "sitedev.hosted.acquia-sites.com", + "image_url": null, + "ips": [ + "10.0.1.5" + ], + "region": "us-east-1", + "status": "normal", + "type": "drupal", + "size": null, + "ssh_url": "site.dev@server-123.hosted.hosting.acquia.com", + "weight": 0, + "vcs": { + "type": "git", + "path": "master", + "url": "site@svn-3.hosted.acquia-sites.com:site.git" + }, + "insight": { + "status": "ok", + "scores": { + "insight": 87, + "seo": 56 + }, + "counts": { + "best_practices": { + "pass": 7, + "fail": 0, + "ignored": 0, + "total": 7, + "percent": 100 + }, + "performance": { + "pass": 22, + "fail": 0, + "ignored": 0, + "total": 22, + "percent": 100 + }, + "security": { + "pass": 23, + "fail": 0, + "ignored": 0, + "total": 23, + "percent": 100 + } + } + }, + "flags": { + "cde": false, + "hsd": false, + "livedev": false, + "multi_region": false, + "production": false, + "production_mode": false, + "remote_admin": false, + "varnish": true, + "varnish_over_ssl": false + }, + "configuration": { + "operating_system": "precise", + "php": { + "version": "7.1", + "memory_limit": 128, + "opcache": 96, + "apcu": 64, + "interned_strings_buffer": 16, + "max_execution_time": 300, + "max_post_size": 256, + "max_input_vars": 1000, + "sendmail_path": null + } + }, + "gardener": { + "site-update": "example.com/admin/gardens/site-update", + "multi-site": "example.com/admin/gardens/staging" + }, + "artifact": null, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470" + }, + "alerts": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/alerts" + }, + "available-runtimes": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/available-runtimes" + }, + "connection-history": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/connection-history" + }, + "crons": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/crons" + }, + "databases": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/databases" + }, + "dns": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/dns" + }, + "domains": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/domains" }, "insight": { - "status": "ok", - "scores": { - "insight": 87, - "seo": 56 - }, - "counts": { - "best_practices": { - "pass": 7, - "fail": 0, - "ignored": 0, - "total": 7, - "percent": 100 - }, - "performance": { - "pass": 22, - "fail": 0, - "ignored": 0, - "total": 22, - "percent": 100 - }, - "security": { - "pass": 23, - "fail": 0, - "ignored": 0, - "total": 23, - "percent": 100 - } - } + "href": "https://cloud.acquia.com/api/environments/8-185f07c7-9c4f-407b-8968-67892ebcb38a/insight" }, - "flags": { - "cde": false, - "hsd": false, - "livedev": false, - "multi_region": false, - "production": false, - "production_mode": false, - "remote_admin": false, - "varnish": true, - "varnish_over_ssl": false, - "service_management": true - }, - "configuration": { - "operating_system": "precise", - "php": { - "version": "5.6", - "memory_limit": 128, - "apc": 96, - "max_execution_time": 300, - "max_post_size": 256, - "max_input_vars": 1000, - "sendmail_path": null - } + "logs": { + "href": "https://cloud.acquia.com/api/environments/8-185f07c7-9c4f-407b-8968-67892ebcb38a/logs" }, - "gardener": { - "site-update": "my-domain-prod.com/admin/gardens/site-update", - "multi-site": "my-domain-prod.com/admin/gardens/staging" + "metrics": { + "href": "https://cloud.acquia.com/api/environments/8-185f07c7-9c4f-407b-8968-67892ebcb38a/metrics" }, - "artifact": null, - "_links": { - "self": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470" - }, - "alerts": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/alerts" - }, - "connection-history": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/connection-history" - }, - "crons": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/crons" - }, - "databases": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/databases" - }, - "domains": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/domains" - }, - "insight": { - "href": "{baseUri}/environments/8-185f07c7-9c4f-407b-8968-67892ebcb38a/insight" - }, - "logs": { - "href": "{baseUri}/environments/8-185f07c7-9c4f-407b-8968-67892ebcb38a/logs" - }, - "metrics": { - "href": "{baseUri}/environments/8-185f07c7-9c4f-407b-8968-67892ebcb38a/metrics" - }, - "modules": { - "href": "{baseUri}/environments/8-185f07c7-9c4f-407b-8968-67892ebcb38a/modules" - }, - "score-history": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/score-history" - }, - "servers": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/servers" - }, - "ssl": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/ssl" - }, - "variables": { - "href": "{baseUri}/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/variables" - }, - "parent": { - "href": "{baseUri}/environments" - } + "modules": { + "href": "https://cloud.acquia.com/api/environments/8-185f07c7-9c4f-407b-8968-67892ebcb38a/modules" + }, + "score-history": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/score-history" + }, + "servers": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/servers" }, - "_embedded": { - "application": { - "name": "Sample application", - "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470", - "_links": { - "self": { - "href": "{baseUri}/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470" - } - } + "ssl": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/ssl" + }, + "variables": { + "href": "https://cloud.acquia.com/api/environments/24-a47ac10b-58cc-4372-a567-0e02b2c3d470/variables" + }, + "parent": { + "href": "https://cloud.acquia.com/api/environments" + } + }, + "_embedded": { + "application": { + "name": "Sample application", + "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470", + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/applications/a47ac10b-58cc-4372-a567-0e02b2c3d470" } + } } -} \ No newline at end of file + } +} diff --git a/tests/Fixtures/Endpoints/Insights/getAllAlerts.json b/tests/Fixtures/Endpoints/Insights/getAllAlerts.json index d33dc726..2719e3fe 100644 --- a/tests/Fixtures/Endpoints/Insights/getAllAlerts.json +++ b/tests/Fixtures/Endpoints/Insights/getAllAlerts.json @@ -1,54 +1,95 @@ { - "total": 0, - "_links": [ + "total": 3, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/insight/site_id/alerts" + }, + "parent": { + "href": "https://cloud.acquia.com/api/insight/site_id" + } + }, + "_embedded": { + "items": [ { - "href": "string" - } - ], - "_embedded": { - "items": [ - { - "alert_id": 0, - "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "name": "string", - "message": "string", - "article_link": "string", - "severity": 0, - "severity_label": "string", - "failed_value": "string", - "fix_details": "string", - "categories": { - "value": "insight" - }, - "flags": { - "additionalProp1": { - "ignored": true, - "cleared": true, - "resolved": true, - "pass_hide": true, - "free_tier_hide": true - }, - "additionalProp2": { - "ignored": true, - "cleared": true, - "resolved": true, - "pass_hide": true, - "free_tier_hide": true - }, - "additionalProp3": { - "ignored": true, - "cleared": true, - "resolved": true, - "pass_hide": true, - "free_tier_hide": true - } - }, - "_links": [ - { - "href": "string" - } - ] + "alert_id": 40, + "uuid": "a47ac10b-58cc-4372-a567-0e02b2c3d470", + "name": "PHP errors visible", + "message": "

Your website is configured to display PHP error messages to users. These error messages can reveal sensitive information about your website and its server to site visitors.

", + "article_link": "https://docs.acquia.com/acquia-cloud/insight/alerts/", + "severity": 8, + "severity_label": "WARNING", + "failed_value": "display_errors", + "fix_details": "

To suppress the error messages, edit your settings.php file.

", + "categories": [ + "insight", + "security" + ], + "flags": { + "ignored": false, + "cleared": false, + "resolved": false, + "pass_hide": false, + "free_tier_hide": true + }, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/insight/d97bd970-3c0f-102f-a581-1231390f9c94/alerts/a47ac10b-58cc-4372-a567-0e02b2c3d470" + } } - ] - } -} \ No newline at end of file + }, + { + "alert_id": 43, + "uuid": "f938d912-a6a0-11e2-b0d3-12313931d529", + "name": "Scheduler module not enabled", + "message": "

Writing content and scheduling its publishing is an easy way to keep your site current and appealing to site visitors. The Scheduler module makes it easy to release content over a period of time, and thus maintain freshness.

", + "article_link": "https://docs.acquia.com/acquia-cloud/insight/alerts/", + "severity": 0, + "severity_label": "DEBUG", + "failed_value": "scheduler", + "fix_details": "

Enable the Scheduler module for your website.

", + "categories": [ + "seo" + ], + "flags": { + "ignored": false, + "cleared": false, + "resolved": false, + "pass_hide": false, + "free_tier_hide": false + }, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/insight/d97bd970-3c0f-102f-a581-1231390f9c94/alerts/f938d912-a6a0-11e2-b0d3-12313931d529" + } + } + }, + { + "alert_id": 82, + "uuid": "f93dbb1f-a6a0-11e2-b0d3-12313931d529", + "name": "CSS optimization disabled", + "message": "

With CSS optimization disabled, your website visitors are experiencing slower page performance and the server load is increased.

", + "article_link": "https://docs.acquia.com/acquia-cloud/performance/#sts=CSS%20and%20JavaScript%20aggregation%C2%B6", + "severity": 16, + "severity_label": "ERROR", + "failed_value": "preprocess_css", + "fix_details": "

To enable CSS optimization, on your website, open the Performance page at /admin/config/development/performance, and then select Aggregate and compress CSS files.

", + "categories": [ + "insight", + "performance" + ], + "flags": { + "ignored": false, + "cleared": true, + "resolved": true, + "pass_hide": false, + "free_tier_hide": true + }, + "_links": { + "self": { + "href": "https://cloud.acquia.com/api/insight/d97bd970-3c0f-102f-a581-1231390f9c94/alerts/f93dbb1f-a6a0-11e2-b0d3-12313931d529" + } + } + } + ] + } +}