Skip to content

Instantly share code, notes, and snippets.

View mikolajprzybysz's full-sized avatar

Mikołaj Przybysz mikolajprzybysz

View GitHub Profile
@mikolajprzybysz
mikolajprzybysz / add.reg
Last active August 29, 2015 14:08
Webdeveloper Windows 8 Context Menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.html\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\phpscript]
@="PHP Script"
"FriendlyTypeName"=hex(2):40,00,3d,00,22,00,50,00,48,00,50,00,20,00,53,00,63,\
00,72,00,69,00,70,00,74,00,22,00,00,00
{
"apiPackage" : "MyNamespace\\SDK\\Client\\Api",
"modelPackage" : "MyNamespace\\SDK\\Client\\Model",
"invokerPackage" : "MyNamespace\\SDK\\Client",
"packagePath" : "MyClient-sdk-php",
"gitUserId" : "mycompany",
"gitRepoId" : "myclient-sdk-php",
"variableNamingConvention" : "camelCase"
}
swagger: '2.0'
info:
version: 1.0.0
title: My Service API
description: '#### Returns some information'
schemes:
- http
host: myhost.net
basePath: /
paths:
SAMPLE_DATA_KEY=TEST_VALUE
openapi: 3.0.0
info:
title: Time track API
version: 0.1.0
servers:
- url: http://localhost/v1
description: Local development
paths:
/books/{id}:
get:
{
"request": {
"method": "GET",
"url": "/books/123"
},
"response": {
"status": 200,
"jsonBody": {
"title": "Sample book title",
"author": "Sample Author"
{
"request": {
"method": "GET",
"url": "/book/not-existing"
},
"response": {
"status": 404,
"jsonBody": {
"code": 4040,
"message": "Requested resource does not exist"
# Assuming you are in project root directory
# For linux
docker run -d -p 8080:8080 -v $(pwd)/tests/wiremock/mappings:/wiremock/mappings ekino/wiremock:2.7.1
# For mac
docker run -d -p 8080:8080 -v $PWD/tests/wiremock/mappings:/wiremock/mappings ekino/wiremock:2.7.1
# For Windows
docker run -d -p 8080:8080 -v %cd%/tests/wiremock/mappings:/wiremock/mappings ekino/wiremock:2.7.1
curl -v http://localhost:8080/book/123
curl -v http://localhost:8080/book/non-existing
#!/usr/bin/env bash
# For mac
docker run -it -v $PWD:/app -w /app composer:1.7 require "codeception/codeception" --dev
docker run -it -v $PWD:/app -w /app php:7.2-alpine ./vendor/bin/codecept init api
# Use the following answers. Important! There is no trailing slash!
> ? Where tests will be stored? (tests) tests/api
> ? Start url for tests (http://localhost/api) http://wiremock:8080
# At point we will create some bootstrap files, since we have one particular endpoint we would like to test simply edit