https://github.com/janstuemmel/slim3-doctrine-testing-example
Testing example for a slim3-doctrine setup with in-memory sqlite database
https://github.com/janstuemmel/slim3-doctrine-testing-example
doctrine php slim3 slim3-doctrine-setup slim3-doctrine-testing testing
Last synced: 2 days ago
JSON representation
Testing example for a slim3-doctrine setup with in-memory sqlite database
- Host: GitHub
- URL: https://github.com/janstuemmel/slim3-doctrine-testing-example
- Owner: janstuemmel
- Created: 2016-10-13T12:12:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-17T14:21:24.000Z (over 8 years ago)
- Last Synced: 2025-02-17T22:32:48.409Z (over 1 year ago)
- Topics: doctrine, php, slim3, slim3-doctrine-setup, slim3-doctrine-testing, testing
- Language: PHP
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/janstuemmel/slim3-doctrine-testing-example)
[](https://codeclimate.com/github/janstuemmel/slim3-doctrine-testing-example/coverage)
# Slim3-Doctrine Testing
Testing example for a slim3-doctrine setup with in-memory sqlite database.
## Requirements
* php >= 5.5
* sqlite
## Packages
* `phpunit/phpunit`
* `there4/slim-test-helpers`
## Usage
```sh
# install deps
composer install
# test
composer test
# serve
touch app.db && composer db:create
composer serve # starts build-in webserver at localhost:8080
# add some test data
curl --data '' localhost:8080/api/posts
curl --data 'title=Hello World' localhost:8080/api/posts
# get data
curl localhost:8080/api/posts
```
... you will get:
```json
[
{
"id": 1,
"title": "New post",
"content": "Insert content here..."
},
{
"id": 2,
"title": "Hello World",
"content": "Insert content here..."
}
]
```