Skip to content

Commit

Permalink
Merge pull request #16 from bunq/feature/test_readme
Browse files Browse the repository at this point in the history
Add readme for tests.
  • Loading branch information
dnl-blkv authored Aug 5, 2017
2 parents 1fd6594 + ac2181e commit d31f47b
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/php.xml

# Sensitive or high-churn files:
.idea/**/dataSources/
Expand Down Expand Up @@ -64,14 +65,15 @@ modules.xml
# bunq context file
bunq.conf
example/result_attachment.jpg
bunq-test.conf
connectQr.png
config.json

# Composer
vendor/

# Temporary files
tmp/
bunq-test.conf
connectQr.png
.DS_Store
.idea/php.xml
config.json

.DS_STORE

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# bunq PHP SDK
Version 0.9.0 **BETA**

## Introduction
Hi developers!
Expand Down Expand Up @@ -176,6 +175,7 @@ foreach ($monetaryAccountList as $monetaryAccount) {
##### Example
See [`example/monetary_account_example.php`](./example/monetary_account_example.php)


## Running Examples
In order to make the experience of getting into bunq PHP SDK smoother, we
have bundled it with example use cases (located under `./example`).
Expand Down Expand Up @@ -215,3 +215,8 @@ $ vendor/bin/bunq-install

Please do not forget to set the `_API_KEY` constant in
`api_context_save_example.[php]` to your actual API key before running the sample!

## Running Tests

Information regarding the test cases can be found in the [README.md](./tests/README.md)
located in [test](/tests).
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"autoload-dev": {
"psr-4": {
"bunq\\test\\": "test/"
"bunq\\test\\": "tests/"
}
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
cacheTokens="false">
<testsuites>
<testsuite name="Test Suite">
<directory>./test</directory>
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./lib</directory>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 51 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# bunq PHP SDK tests :mag:

## Introduction
Hi developers!


Welcome to the bunq PHP SDK integration tests. Currently we are not
targeting the 100% test coverage, but rather want to be certain that the most
common scenarios can run without any errors.


## Scenarios

These are the scenarios that are currently being tested:
* Create installation, session-server and device server
* Create a new MonetaryAccount
* Create a tab
* Update the tab
* Create attachment and avatar
* Request money from first MA to second MA
* Accept the request
* Make a transaction from first MA to second MA
* Create connect gr code
* Make a payment to another sandbox user
* Send a chat message in a recent payment
* Delete the current session
* Order a card with a second line

Besides these scenarios, some code of ApiContext, ApiClient and the JSON module
are also tested :thumbs_up:.

## Configuration

To run the tests you must first setup the test configuration JSON. The example
of a configuration file is located at [`tests/resource/config.example.json`](./resource/config.example.json).
In order to make use of the configuration file, please copy the example to the
same directory, fill in your sandbox user data and rename the copy to config.json.
## Execution

You can run the tests via command line:

```
vendor/phpunit/phpunit/phpunit
```

or via PhpStorm, but first you must configure PhpStorm by doing the following:
* Got to preferences --> Language and Frameworks --> Php --> Test Frameworks and add
`sdk_php/vendor/autoload.php` as path to script with `use composer autoloader` checked.

Afterwards you can right click on the tests folders and should be able to run
the tests cases form the IDE.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d31f47b

Please sign in to comment.