This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ee7f3c
commit 42dac79
Showing
25 changed files
with
693 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
vendor | ||
build | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'array_syntax' => array('syntax' => 'long'), | ||
'combine_consecutive_unsets' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_class_elements' => true, | ||
'ordered_imports' => true, | ||
'phpdoc_add_missing_param_annotation' => true, | ||
'phpdoc_align' => false, | ||
'phpdoc_order' => true, | ||
'phpdoc_no_alias_tag' => false, | ||
'psr4' => true, | ||
'semicolon_after_instruction' => true, | ||
'strict_comparison' => true, | ||
'strict_param' => true, | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->exclude(['vendor']) | ||
->in(__DIR__) | ||
) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
language: php | ||
|
||
cache: | ||
directories: | ||
- vendor | ||
|
||
matrix: | ||
# mark as finished before allow_failures are run | ||
fast_finish: true | ||
include: | ||
- php: 5.6 | ||
- php: 7.0 | ||
- php: 7.1 | ||
|
||
# test only master (+ pull requests) | ||
branches: | ||
only: | ||
- master | ||
|
||
# install dependencies | ||
install: | ||
- composer install | ||
|
||
# execute phpunit as the script command | ||
script: | ||
- ./vendor/bin/phpunit -d memory_limit=-1 --colors -c phpunit.xml.dist --coverage-clover=coverage.xml | ||
|
||
# disable mail notifications | ||
notification: | ||
email: false | ||
|
||
# reduce depth (history) of git checkout | ||
git: | ||
depth: 30 | ||
|
||
# we don't need sudo | ||
sudo: false | ||
|
||
# send coverage to codecov.io | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
services: | ||
netgen_html_pdf_api: | ||
class: Netgen\HtmlPdfApi\HtmlPdfApi | ||
arguments: | ||
- "@netgen_html_pdf_api.http_client" | ||
- "@netgen_html_pdf_api.validator" | ||
|
||
netgen_html_pdf_api.http_client: | ||
alias: netgen_html_pdf_api.http_client.guzzle | ||
|
||
netgen_html_pdf_api.validator: | ||
alias: netgen_html_pdf_api.validator.htmlpdfapivalidator | ||
|
||
netgen_html_pdf_api.http_client.guzzle: | ||
class: Netgen\HtmlPdfApi\HttpClient\Guzzle | ||
arguments: | ||
- "%netgen_html_pdf_api.host%" | ||
- "%netgen_html_pdf_api.token%" | ||
- "%netgen_html_pdf_api.http_client.guzzle.service_json_location%" | ||
|
||
netgen_html_pdf_api.http_client.curl: | ||
class: Netgen\HtmlPdfApi\HttpClient\Curl | ||
arguments: | ||
- "%netgen_html_pdf_api.host%" | ||
- "%netgen_html_pdf_api.token%" | ||
|
||
netgen_html_pdf_api.validator.htmlpdfapivalidator: | ||
class: Netgen\HtmlPdfApi\Validator\HtmlPdfApiValidator |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
coverage: | ||
status: | ||
patch: false | ||
changes: false | ||
project: | ||
default: | ||
target: auto | ||
comment: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,42 @@ | ||
{ | ||
"name": "netgen/htmlpdfapi-bundle", | ||
"description": "Netgen HTMLPDFAPI bundle", | ||
"type": "symfony-bundle", | ||
"keywords": [ | ||
"netgen", | ||
"htmlpdfapi-bundle", | ||
"htmlpdfapi" | ||
], | ||
"homepage": "https://github.com/netgen/HtmlPdfApiBundle", | ||
"license": "GPL-2.0", | ||
"authors": [ | ||
{ | ||
"name": "Netgen", | ||
"homepage": "http://www.netgenlabs.com" | ||
} | ||
], | ||
"require": { | ||
"php": "~5.6|~7.0|~7.1", | ||
"symfony/framework-bundle": "~2.7|~3.0", | ||
"netgen/htmlpdfapi": "0.2" | ||
}, | ||
"minimum-stability": "dev", | ||
"target-dir": "Netgen/HtmlPdfApiBundle", | ||
"require-dev": { | ||
"phpunit/phpunit": "^5.7", | ||
"matthiasnoback/symfony-config-test": "~2.0", | ||
"matthiasnoback/symfony-dependency-injection-test": "~1.0" | ||
}, | ||
"autoload": { | ||
"psr-0": { "Netgen\\HtmlPdfApiBundle": "" } | ||
"psr-4": { | ||
"Netgen\\HtmlPdfApiBundle\\": "bundle" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Netgen\\HtmlPdfApiBundle\\Tests\\": "tests" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "@php vendor/bin/phpunit --colors=always", | ||
"coverage": "@php -dzend_extension=xdebug.so vendor/bin/phpunit --colors=always" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
colors="true" | ||
verbose="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
> | ||
<testsuites> | ||
<testsuite name="Netgen\HtmlPdfApiBundle\Tests"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">bundle</directory> | ||
<exclude> | ||
<directory>bundle/Resources</directory> | ||
<directory>bundle/Templates</directory> | ||
<file>bundle/NetgenHtmlPdfApiBundle.php</file> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
<logging> | ||
<log type="junit" target="build/report.junit.xml"/> | ||
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/> | ||
<log type="coverage-text" target="build/coverage.txt"/> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
</logging> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
namespace Netgen\HtmlPdfApiBundle\Tests\DependencyInjection; | ||
|
||
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; | ||
use Netgen\HtmlPdfApiBundle\DependencyInjection\Configuration; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ConfigurationTest extends TestCase | ||
{ | ||
use ConfigurationTestCaseTrait; | ||
|
||
protected function getConfiguration() | ||
{ | ||
return new Configuration(); | ||
} | ||
|
||
public function testConfigurationValuesAreOkAndValid() | ||
{ | ||
$this->assertConfigurationIsValid( | ||
array( | ||
'netgen_html_pdf_api' => array( | ||
'host' => 'host', | ||
'token' => 'token', | ||
), | ||
) | ||
); | ||
} | ||
|
||
public function testConfigurationValuesAreInvalid() | ||
{ | ||
$this->assertConfigurationIsInvalid( | ||
array( | ||
'netgen_html_pdf_api' => array( | ||
'host' => '', | ||
'token' => 'token', | ||
), | ||
) | ||
); | ||
|
||
$this->assertConfigurationIsInvalid( | ||
array( | ||
'netgen_html_pdf_api' => array( | ||
'host' => 'host', | ||
'token' => '', | ||
), | ||
) | ||
); | ||
|
||
$this->assertConfigurationIsInvalid( | ||
array( | ||
'netgen_html_pdf_api' => array( | ||
'host' => '', | ||
'token' => '', | ||
), | ||
) | ||
); | ||
} | ||
|
||
public function testConfigurationValuesAreValidWhenNotSet() | ||
{ | ||
$this->assertConfigurationIsValid( | ||
array( | ||
'netgen_html_pdf_api' => array( | ||
), | ||
) | ||
); | ||
|
||
$this->assertConfigurationIsValid( | ||
array( | ||
'netgen_html_pdf_api' => array( | ||
'host' => 'host', | ||
), | ||
) | ||
); | ||
|
||
$this->assertConfigurationIsValid( | ||
array( | ||
'netgen_html_pdf_api' => array( | ||
'token' => 'token', | ||
), | ||
) | ||
); | ||
} | ||
} |
Oops, something went wrong.