Skip to content

Commit

Permalink
coveralls config added
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Sep 11, 2016
1 parent ea33919 commit ec50583
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ before_script:
- composer install -n

script:
- vendor/bin/phpunit

- phpunit --coverage-clover build/logs/clover.xml
after_script:
- if [ $TRAVIS_PHP_VERSION = '7.0' ]; then php vendor/bin/coveralls; fi
- if [ $TRAVIS_PHP_VERSION = '7.0' ]; then php vendor/bin/coveralls; fi

after_success:
- travis_retry php vendor/bin/coveralls -v
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
"ezyang/htmlpurifier": "*"
},
"require-dev": {
"phpunit/phpunit": "4.8.*",
"codacy/coverage": "dev-master"
"phpunit/phpunit": "^5.4.0",
"satooshi/php-coveralls": "~1.0",
"phpunit/phpcov": "^3.1.0"
},

"autoload": {
Expand Down
4 changes: 3 additions & 1 deletion test/ModelUtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ protected function setUp()
$this->testData =<<<EOT
{
"name": {"_type": "string", "_input_type": null, "_min_length": 3, "_max_length": 128, "_required": true, "_index": true, "_default": "", "_ref": null, "_has_many": 0},
"html": {"_type": "string", "_input_type": "html", "_min_length": 0, "_max_length": 2048, "_required": true, "_index": true, "_default": "", "_ref": null, "_has_many": 0},
"email": {"_type": "string", "_input_type": "email", "_required": true, "_index": true, "_default": "", "_ref": null, "_has_many": 0},
"birthday": {"_type": "string", "_input_type": "date", "_required": true, "_index": true, "_default": "", "_ref": null, "_has_many": 0},
"created": {"_type": "integer", "_input_type": "timestamp" , "_required": true, "_index": true, "_default":"now", "_ref": null, "_has_many": 0},
Expand Down Expand Up @@ -62,6 +63,7 @@ public function testSuccessDocuments($dct)
$this->assertArrayHasKey('cat', $doc['profile']['pets']);

$doc = ModelUtils::setModelDefaults($model, $doc);

$doc = ModelUtils::validateDoc($model, $doc);

$this->assertArrayHasKey('dogs', $doc['profile']['pets']);
Expand All @@ -84,7 +86,7 @@ public function testFailureDocuments($dct)
public function successDataProvider()
{
return [
['{"name": "Mehmet", "birthday": "1980-01-01", "gender":"G", "experience": 4, "profile": {"weight":60.0,"age": 37,"pets": {"cat": 2}}}'],
['{"name": "Mehmet", "birthday": "1980-01-01", "gender":"G", "html":"<a href=\'deneme.html\'><strong>hellö</strong></a>", "experience": 4, "profile": {"weight":60.0,"age": 37,"pets": {"cat": 2}}}'],
];
}

Expand Down

0 comments on commit ec50583

Please sign in to comment.