Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jubianchi committed Nov 9, 2014
1 parent 0e90716 commit ddc4e24
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,72 @@
# atoum/json-schema-extension

![atoum](http://downloads.atoum.org/images/logo.png)

## Install it

Install extension using [composer](https://getcomposer.org):

```json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/jubianchi/atoum"
},
{
"type": "vcs",
"url": "https://github.com/jubianchi/json-schema-extension"
}
],
"require-dev": {
"atoum/atoum": "dev-extension",
"atoum/bdd-extension": "dev-master"
},
}

```

Enable the extension using atoum configuration file:

```php
<?php

// .atoum.php

require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

use mageekguy\atoum\jsonSchema;

$runner->addExtension(new jsonSchema\extension($script));
```

## Use it

```php
<?php
namespace jubianchi\example\json;

use atoum;

class foo extends atoum\test
{
public function testIsJson()
{
$this
->given($string = '{"foo": "bar"}')
->then
->json($string)
;
}

public function testValidatesSchema()
{
$this
->given($string = '["foo", "bar"]')
->then
->json($string)->validates('{"title": "test", "type": "array"}')
->json($string)->validates('/path/to/json.schema')
;
}
}
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "atoum/json-schema-extension",
"name": "atoum/",
"type": "library",
"description": "JSON Schema extension for atoum, the simple modern and intuitive unit testing framework for PHP 5.3+",
"keywords": ["TDD","atoum","test","unit testing","json"],
Expand Down

0 comments on commit ddc4e24

Please sign in to comment.