Skip to content

Commit

Permalink
add testunit
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouzekri committed May 12, 2015
1 parent 273381f commit 5270660
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
checks:
php: true

tools:
external_code_coverage:
timeout: 600 # Timeout in seconds.

filter:
excluded_paths:
- tests/*
- Tests/*
- spec/*
- unit/*
- src/Jb/Bundle/PhumborBundle/Tests/*
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ php:
- 5.3
- 5.4
- 5.5
- 5.6
- nightly

before_script:
before_script:
- pear install pear/PHP_CodeSniffer
- composer install -n
- phpenv rehash
- wget https://scrutinizer-ci.com/ocular.phar

script:
- phpunit -c Tests/
script:
- phpunit -c Tests/ --coverage-clover=coverage.clover
- phpcs --standard=PSR2 --extensions=php --ignore=vendor .
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Jonathan Bouzekri
Copyright (c) 2015 Jonathan Bouzekri

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ Documentation
License
-------

MIT; see [LICENSE](LICENSE)
MIT - see [LICENSE](LICENSE)
4 changes: 4 additions & 0 deletions Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function getTransformationData()
{
return array(
array(array('fit_in'=>array('width'=>10,'height'=>20)), array('fit_in'=>array('width'=>10,'height'=>20))),
array(
array('full_fit_in'=>array('width'=>10,'height'=>20)),
array('full_fit_in'=>array('width'=>10,'height'=>20))
),
array(array('trim'=>true), array('trim'=>true)),
array(array('trim'=>'string'), array('trim'=>'string')),
array(
Expand Down
15 changes: 15 additions & 0 deletions Tests/Transformer/BaseTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,21 @@ public function testFitIn()
$this->assertEquals($transformedUrl, $buildedUrl);
}

/**
* Test fullFitIn
*/
public function testFullFitIn()
{
$transformedUrl = $this->transformer->transform(
'http://phumbor.jb.fr/logo.png',
null,
array('full_fit_in'=> array('width'=>10, 'height'=>10))
);
$buildedUrl = $this->factory->url('http://phumbor.jb.fr/logo.png')->fullFitIn(10, 10);

$this->assertEquals($transformedUrl, $buildedUrl);
}

/**
* Test halign
*/
Expand Down

0 comments on commit 5270660

Please sign in to comment.