-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1 addition
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -270,80 +270,6 @@ To run test application to play with just type `composer try`. | |
admin form like you usually do with `Product` form via | ||
`sylius.menu.admin.product.form` event. | ||
|
||
## Testing | ||
|
||
### Play with API | ||
|
||
* Install https://stedolan.github.io/jq/ | ||
(type `brew install jq` at OSX terminal) | ||
|
||
* Get admin API access token: | ||
|
||
```bash | ||
SYLIUS_ADMIN_API_ACCESS_TOKEN=$(curl http://localhost:8000/api/oauth/v2/token \ | ||
--silent --show-error \ | ||
-d "client_id"=demo_client \ | ||
-d "client_secret"=secret_demo_client \ | ||
-d "grant_type"=password \ | ||
-d "username"[email protected] \ | ||
-d "password"=sylius-api | jq '.access_token' --raw-output) | ||
``` | ||
|
||
* Make requests: | ||
|
||
(`GET` requests indexing/showing resources shown here as an example, | ||
see `tests/Controller/*ApiTest.php` to discover more details | ||
about creating/updating/removing brand-related resources, | ||
creating new products with brand attached to it, | ||
uploading image files for `BrandImages` via API) | ||
|
||
To Brands admin API: | ||
|
||
```bash | ||
curl http://localhost:8000/api/v1/brands/ \ | ||
-H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN" | ||
``` | ||
|
||
```bash | ||
curl http://localhost:8000/api/v1/brands/setono/ \ | ||
-H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN" | ||
``` | ||
|
||
Brand images API: | ||
|
||
```bash | ||
curl http://localhost:8000/api/v1/brands/setono/images/ \ | ||
-H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN" | ||
``` | ||
|
||
Brand images by type API: | ||
|
||
```bash | ||
curl http://localhost:8000/api/v1/brands/setono/images/logo/ \ | ||
-H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN" | ||
``` | ||
|
||
```bash | ||
curl http://localhost:8000/api/v1/brands/setono/images/<ID>/ \ | ||
-H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN" | ||
``` | ||
|
||
Brand products API: | ||
|
||
```bash | ||
curl http://localhost:8000/api/v1/brands/setono/products/ \ | ||
-H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN" | ||
``` | ||
|
||
Product details API: | ||
|
||
```bash | ||
curl http://localhost:8000/api/v1/products/setono-mug/ \ | ||
-H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN" | ||
``` | ||
|
||
For XML output, add `-H "Accept: application/xml"` to request | ||
|
||
## Contribute | ||
|
||
Please, run `composer all` to run all checks and tests before committing. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,2 @@ | ||
imports: | ||
- "@LoevgaardSyliusBrandPlugin/Resources/config/grids/loevgaard_sylius_brand_admin_api_brand.yaml" | ||
- "@LoevgaardSyliusBrandPlugin/Resources/config/grids/loevgaard_sylius_brand_admin_api_brand_image.yaml" | ||
- "@LoevgaardSyliusBrandPlugin/Resources/config/grids/loevgaard_sylius_brand_admin_brand.yaml" | ||
|
||
jms_serializer: | ||
metadata: | ||
directories: | ||
loevgaard-sylius-brand: | ||
namespace_prefix: "Loevgaard\\SyliusBrandPlugin\\Model" | ||
path: "@LoevgaardSyliusBrandPlugin/Resources/config/serializer" |
23 changes: 0 additions & 23 deletions
23
src/Resources/config/grids/loevgaard_sylius_brand_admin_api_brand.yaml
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/Resources/config/grids/loevgaard_sylius_brand_admin_api_brand_image.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
tests/DataFixtures/ORM/authentication/api_administrator.yml
This file was deleted.
Oops, something went wrong.