Skip to content
This repository has been archived by the owner on Feb 28, 2020. It is now read-only.

Commit

Permalink
Initial prep for stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioBlazek committed Jul 27, 2017
1 parent 7ee7f3c commit 42dac79
Show file tree
Hide file tree
Showing 25 changed files with 693 additions and 54 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor
build
composer.lock
29 changes: 29 additions & 0 deletions .php_cs
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__)
)
;
41 changes: 41 additions & 0 deletions .travis.yml
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)
340 changes: 340 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Netgen HtmlPdfApi Bundle
========================

[![Build Status](https://img.shields.io/travis/netgen/HtmlPdfApiBundle.svg?style=flat-square)](https://travis-ci.org/netgen/HtmlPdfApiBundle)
[![Code Coverage](https://img.shields.io/codecov/c/github/netgen/HtmlPdfApiBundle.svg?style=flat-square)](https://codecov.io/gh/netgen/HtmlPdfApiBundle)
[![Downloads](https://img.shields.io/packagist/dt/netgen/htmlpdfapi-bundle.svg?style=flat-square)](https://packagist.org/packages/netgen/htmlpdfapi-bundle/stats)
[![Latest stable](https://img.shields.io/packagist/v/netgen/htmlpdfapi-bundle.svg?style=flat-square)](https://packagist.org/packages/netgen/htmlpdfapi-bundle)
[![License](https://img.shields.io/packagist/l/netgen/htmlpdfapi-bundle.svg?style=flat-square)](LICENSE)

Netgen HtmlPdfApi Bundle is a bundle which exposes [HTML PDF API](https://htmlpdfapi.com/) functionalities through Netgen HtmlPdfApi PHP library.
HTMLPDFAPI provides an easy way for generating PDF documents from HTML code.

Expand Down
34 changes: 0 additions & 34 deletions Resources/config/services.yml

This file was deleted.

17 changes: 0 additions & 17 deletions Tests/Controller/DefaultControllerTest.php

This file was deleted.

File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions bundle/Resources/config/services.yml
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.
8 changes: 8 additions & 0 deletions codecov.yml
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
36 changes: 33 additions & 3 deletions composer.json
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"
}
}
34 changes: 34 additions & 0 deletions phpunit.xml.dist
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>
85 changes: 85 additions & 0 deletions tests/DependencyInjection/ConfigurationTest.php
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',
),
)
);
}
}
Loading

0 comments on commit 42dac79

Please sign in to comment.