openapi-generator/samples/server/petstore-security-test/php-slim
2018-08-31 20:34:06 +08:00
..
.openapi-generator Merge branch '3.3.x' of https://github.com/openapitools/openapi-generator into 3.3.x 2018-08-30 19:48:01 +08:00
lib [Slim] Add PHP CodeSniffer to check coding style (#897) 2018-08-26 15:26:09 +05:00
test [Slim] Add PHP CodeSniffer to check coding style (#897) 2018-08-26 15:26:09 +05:00
.gitignore [PHP] Add gitignore to AbstractPhpCodegen (#765) 2018-08-20 12:16:01 +08:00
.htaccess [Slim] Official htaccess (#838) 2018-08-21 11:59:29 +08:00
.openapi-generator-ignore [Slim] Refactoring (#402) 2018-07-02 00:16:55 +08:00
composer.json add back overtrue/phplint to php slim 2018-08-31 20:34:06 +08:00
composer.lock [Slim] Add PHPLint tool to check syntax (#898) 2018-08-26 15:42:59 +05:00
index.php [Slim] Add Basic authentication middleware (#606) 2018-08-01 00:55:30 +08:00
phpunit.xml.dist fix petstore security spec to remove validation errors (#739) 2018-08-06 17:02:02 +08:00
README.md add back phplint tool: e75b115 2018-08-30 19:57:22 +08:00

php-base - PHP Slim Server library for OpenAPI Petstore *_/ ' " =end -- \r\n \n \r

Slim Framework Documentation

Requirements

  • Web server with URL rewriting
  • PHP 5.5.9 or newer

This package contains .htaccess for Apache configuration. If you use another server(Nginx, HHVM, IIS, lighttpd) check out Web Servers doc.

Installation via Composer

Navigate into your project's root directory and execute the bash command shown below. This command downloads the Slim Framework and its third-party dependencies into your project's vendor/ directory.

$ composer install

Start devserver

Run the following command in terminal to start localhost web server, assuming ./php-slim-server/ is public-accessible directory with index.php file:

$ php -S localhost:8888 -t php-slim-server

Warning

This web server was designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network.

Run tests

This package uses PHPUnit 4.8 for unit testing and PHP Codesniffer to check source code against user defined coding standard(phpcsStandard generator config option). Test folder contains templates which you can fill with real test assertions. How to write tests read at PHPUnit Manual - Chapter 2. Writing Tests for PHPUnit. How to configure PHP CodeSniffer read at PHP CodeSniffer Documentation. There is phplint tool to check php syntax automatically.

Command Tool Target
$ composer test PHPUnit All tests
$ composer run test-apis PHPUnit Apis tests
$ composer run test-models PHPUnit Models tests
$ composer run phpcs PHP CodeSniffer All files
$ composer run phplint phplint All files

API Endpoints

All URIs are relative to *http://petstore.swagger.io / ' " =end -- \r\n \n \r/v2 */ ' " =end -- \r\n \n \r

Class Method HTTP request Description
FakeApi testCodeInjectEndRnNR PUT /fake To test code injection *_/ ' " =end -- \r\n \n \r

Models

  • OpenAPIServer\Model\ModelReturn

Authentication