From 774566d1a129799b8c03c3ba493e31c028a51c6b Mon Sep 17 00:00:00 2001 From: James Drinkwater Date: Tue, 8 Nov 2022 16:51:54 +0000 Subject: [PATCH 1/3] Use composer to run the tests since the test script already exists in composer.json --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bcd7dfd..42a955a 100644 --- a/README.md +++ b/README.md @@ -215,17 +215,17 @@ PHPUnit is used to run tests. To run the whole suite: ```bash -./vendor/bin/phpunit +composer test ``` If you want to run the whole suite in verbose mode: ```bash -./vendor/bin/phpunit --verbose +composer test -- --verbose ``` You can also run a section of the suite by specifying the class's relative path on which you want to perform tests: ```bash -./vendor/bin/phpunit --verbose tests/Unit/TemplateRendererTest.php +composer test -- --verbose tests/Unit/TemplateRendererTest.php ``` For additional information on the commands available for PHPUnit, From 4bbd70628efe18ccd3fc92159a5ce589874fa179 Mon Sep 17 00:00:00 2001 From: James Drinkwater Date: Tue, 8 Nov 2022 17:19:22 +0000 Subject: [PATCH 2/3] Use composer to start the PHP built in server to run the examples --- README.md | 11 +++++++++-- composer.json | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42a955a..5a1776d 100644 --- a/README.md +++ b/README.md @@ -202,9 +202,16 @@ composer install ``` ### Example -From a web server capable of interpreting and compiling PHP, navigate to the `/examples/openactive` or `/examples/openactive-csp` folders. -From there you should be able to see the template populated with the JSON-LD data. +To run the examples using PHP's built in server: +```bash +composer start +``` +or +```bash +composer start-csp +``` +Once running navigate to `localhost:8080` in your browser to view the templates populated with JSON-LD data. The default mustache templates (`datasetsite.mustache` and `datasetsite-csp.mustache`) are included under the `src` folder. diff --git a/composer.json b/composer.json index 19f6ee4..7505a70 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,8 @@ "yoast/phpunit-polyfills": "^1.0" }, "scripts": { + "start": "php -S localhost:8080 -t examples/openactive", + "start-csp": "php -S localhost:8080 -t examples/openactive-csp", "test": "./vendor/bin/phpunit" } } From 53f980e4a27d79e5ba61a4c5b2cf158ce844458e Mon Sep 17 00:00:00 2001 From: James Drinkwater Date: Wed, 16 Nov 2022 15:36:48 +0000 Subject: [PATCH 3/3] Remove remote background image from the CSP example --- examples/openactive-csp/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/openactive-csp/index.php b/examples/openactive-csp/index.php index 3f4a912..38e6135 100644 --- a/examples/openactive-csp/index.php +++ b/examples/openactive-csp/index.php @@ -24,7 +24,7 @@ "platformName" => "AcmeBooker", "platformSoftwareVersion" => "2.0", "platformUrl" => "https://acmebooker.example.com/", - "backgroundImageUrl" => "https://data.better.org.uk/images/bg.jpg", + "backgroundImageUrl" => "", "dateFirstPublished" => "2019-10-28", "openBookingAPIBaseUrl" => "https://reference-implementation.openactive.io/api/openbooking", "openBookingAPIAuthenticationAuthorityUrl" => "https://auth.reference-implementation.openactive.io",