Add PaperDB
This commit is contained in:
parent
2bc9d2f86b
commit
947c93bf1b
@ -13,7 +13,8 @@
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4"
|
||||
"php": ">=5.4",
|
||||
"doctrine/orm": "^2.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.7"
|
||||
|
||||
671
composer.lock
generated
671
composer.lock
generated
@ -4,9 +4,423 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "b9da4001e3942b87f110cd4dfebcb541",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
"hash": "c7aedb4a025e243da1c87dfd496221ac",
|
||||
"packages": [
|
||||
{
|
||||
"name": "doctrine/annotations",
|
||||
"version": "v1.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/annotations.git",
|
||||
"reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
|
||||
"reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/lexer": "1.*",
|
||||
"php": ">=5.3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/cache": "1.*",
|
||||
"phpunit/phpunit": "4.*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\Common\\Annotations\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Docblock Annotations Parser",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"annotations",
|
||||
"docblock",
|
||||
"parser"
|
||||
],
|
||||
"time": "2015-08-31 12:32:49"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/cache",
|
||||
"version": "v1.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/cache.git",
|
||||
"reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/f8af318d14bdb0eff0336795b428b547bd39ccb6",
|
||||
"reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~5.5|~7.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/common": ">2.2,<2.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.8|~5.0",
|
||||
"predis/predis": "~1.0",
|
||||
"satooshi/php-coveralls": "~0.6"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.6.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Caching library offering an object-oriented API for many cache backends",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching"
|
||||
],
|
||||
"time": "2015-12-31 16:37:02"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/collections",
|
||||
"version": "v1.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/collections.git",
|
||||
"reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
|
||||
"reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\Common\\Collections\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Collections Abstraction library",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"array",
|
||||
"collections",
|
||||
"iterator"
|
||||
],
|
||||
"time": "2015-04-14 22:21:58"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/common",
|
||||
"version": "v2.6.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/common.git",
|
||||
"reference": "a579557bc689580c19fee4e27487a67fe60defc0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/common/zipball/a579557bc689580c19fee4e27487a67fe60defc0",
|
||||
"reference": "a579557bc689580c19fee4e27487a67fe60defc0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/annotations": "1.*",
|
||||
"doctrine/cache": "1.*",
|
||||
"doctrine/collections": "1.*",
|
||||
"doctrine/inflector": "1.*",
|
||||
"doctrine/lexer": "1.*",
|
||||
"php": "~5.5|~7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.8|~5.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\": "lib/Doctrine/Common"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Common Library for Doctrine projects",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"annotations",
|
||||
"collections",
|
||||
"eventmanager",
|
||||
"persistence",
|
||||
"spl"
|
||||
],
|
||||
"time": "2015-12-25 13:18:31"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/dbal",
|
||||
"version": "v2.5.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/dbal.git",
|
||||
"reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/abbdfd1cff43a7b99d027af3be709bc8fc7d4769",
|
||||
"reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/common": ">=2.4,<2.7-dev",
|
||||
"php": ">=5.3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.*",
|
||||
"symfony/console": "2.*"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "For helpful console commands such as SQL execution and import of files."
|
||||
},
|
||||
"bin": [
|
||||
"bin/doctrine-dbal"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.5.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\DBAL\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Database Abstraction Layer",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"database",
|
||||
"dbal",
|
||||
"persistence",
|
||||
"queryobject"
|
||||
],
|
||||
"time": "2016-01-05 22:11:12"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/inflector",
|
||||
"version": "v1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/inflector.git",
|
||||
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
|
||||
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\Common\\Inflector\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Common String Manipulations with regard to casing and singular/plural rules.",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"inflection",
|
||||
"pluralize",
|
||||
"singularize",
|
||||
"string"
|
||||
],
|
||||
"time": "2015-11-06 14:35:42"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
"version": "1.0.5",
|
||||
@ -61,6 +475,257 @@
|
||||
],
|
||||
"time": "2015-06-14 21:17:01"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/lexer",
|
||||
"version": "v1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/lexer.git",
|
||||
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
|
||||
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\Common\\Lexer\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"lexer",
|
||||
"parser"
|
||||
],
|
||||
"time": "2014-09-09 13:34:57"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/orm",
|
||||
"version": "v2.5.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/doctrine2.git",
|
||||
"reference": "bc4ddbfb0114cb33438cc811c9a740d8aa304aab"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/bc4ddbfb0114cb33438cc811c9a740d8aa304aab",
|
||||
"reference": "bc4ddbfb0114cb33438cc811c9a740d8aa304aab",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/cache": "~1.4",
|
||||
"doctrine/collections": "~1.2",
|
||||
"doctrine/common": ">=2.5-dev,<2.7-dev",
|
||||
"doctrine/dbal": ">=2.5-dev,<2.6-dev",
|
||||
"doctrine/instantiator": "~1.0.1",
|
||||
"ext-pdo": "*",
|
||||
"php": ">=5.4",
|
||||
"symfony/console": "~2.5|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"symfony/yaml": "~2.3|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/yaml": "If you want to use YAML Metadata Mapping Driver"
|
||||
},
|
||||
"bin": [
|
||||
"bin/doctrine",
|
||||
"bin/doctrine.php"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\ORM\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Object-Relational-Mapper for PHP",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"database",
|
||||
"orm"
|
||||
],
|
||||
"time": "2016-01-05 21:34:58"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v3.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "ebcdc507829df915f4ca23067bd59ee4ef61f6c3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/ebcdc507829df915f4ca23067bd59ee4ef61f6c3",
|
||||
"reference": "ebcdc507829df915f4ca23067bd59ee4ef61f6c3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/event-dispatcher": "~2.8|~3.0",
|
||||
"symfony/process": "~2.8|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/log": "For using the console logger",
|
||||
"symfony/event-dispatcher": "",
|
||||
"symfony/process": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Console\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-12-22 10:39:06"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "1289d16209491b584839022f29257ad859b8532d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d",
|
||||
"reference": "1289d16209491b584839022f29257ad859b8532d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2016-01-20 09:13:37"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "phpdocumentor/reflection-docblock",
|
||||
"version": "2.0.4",
|
||||
|
||||
@ -57,11 +57,11 @@ class Article
|
||||
throw new \Exception('No id provided');
|
||||
}
|
||||
|
||||
/** @var Option\Type\Base $options */
|
||||
foreach($this->options as $options)
|
||||
/** @var Option\Type\Base $option */
|
||||
foreach($this->options as $option)
|
||||
{
|
||||
if($options->getId() == $id) {
|
||||
return $options;
|
||||
if($option->getId() == $id) {
|
||||
return $option;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
namespace PSC\Library\Calc;
|
||||
|
||||
|
||||
|
||||
use Doctrine\Common\Persistence\ObjectRepository;
|
||||
|
||||
class Engine
|
||||
{
|
||||
|
||||
@ -11,6 +14,11 @@ class Engine
|
||||
/** @var \ArrayIterator $articles */
|
||||
protected $articles;
|
||||
|
||||
/** @var PaperContainer $paperContainer */
|
||||
protected $paperContainer;
|
||||
|
||||
/** @var ObjectRepository */
|
||||
protected $paperRepository;
|
||||
|
||||
/**
|
||||
* Load XML From String
|
||||
@ -33,6 +41,8 @@ class Engine
|
||||
protected function parse()
|
||||
{
|
||||
$parser = new Parser();
|
||||
$parser->setPaperContainer($this->paperContainer);
|
||||
$parser->setPaperRepository($this->paperRepository);
|
||||
|
||||
foreach ($this->xml as $article) {
|
||||
$this->articles->append($parser->parse($article));
|
||||
@ -72,4 +82,36 @@ class Engine
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PaperContainer
|
||||
*/
|
||||
public function getPaperContainer()
|
||||
{
|
||||
return $this->paperContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PaperContainer $paperContainer
|
||||
*/
|
||||
public function setPaperContainer($paperContainer)
|
||||
{
|
||||
$this->paperContainer = $paperContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ObjectRepository
|
||||
*/
|
||||
public function getPaperRepository()
|
||||
{
|
||||
return $this->paperRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ObjectRepository $paperRepository
|
||||
*/
|
||||
public function setPaperRepository($paperRepository)
|
||||
{
|
||||
$this->paperRepository = $paperRepository;
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,12 +3,17 @@ namespace PSC\Library\Calc\Option;
|
||||
|
||||
use PSC\Library\Calc\Option\Parser\Input;
|
||||
use PSC\Library\Calc\Option\Parser\Select;
|
||||
use PSC\Library\Calc\PaperContainer\Container;
|
||||
|
||||
class Parser
|
||||
{
|
||||
protected $node;
|
||||
|
||||
public function parse(\SimpleXMLElement $node)
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function getOptByType(\SimpleXMLElement $node)
|
||||
{
|
||||
$this->node = $node;
|
||||
|
||||
@ -16,17 +21,13 @@ class Parser
|
||||
|
||||
switch(strtolower((string)$node['type'])) {
|
||||
case 'input':
|
||||
$obj = new Input();
|
||||
$obj = new Input($node);
|
||||
break;
|
||||
case 'select':
|
||||
$obj = new Select();
|
||||
$obj = new Select($node);
|
||||
break;
|
||||
}
|
||||
|
||||
if($obj) {
|
||||
$obj = $obj->parse($node);
|
||||
}
|
||||
|
||||
return $obj;
|
||||
|
||||
}
|
||||
|
||||
@ -9,25 +9,24 @@ class Base
|
||||
/** @var \SimpleXMLElement $node */
|
||||
protected $node;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected function parse(\SimpleXMLElement $node)
|
||||
public function __construct(\SimpleXMLElement $node)
|
||||
{
|
||||
$this->node = $node;
|
||||
$this->element->setId((string)$node['id']);
|
||||
$this->element->setName((string)$node['name']);
|
||||
}
|
||||
|
||||
if(isset($node['default'])) {
|
||||
$this->element->setDefault((string)$node['default']);
|
||||
protected function parse()
|
||||
{
|
||||
$this->element->setId((string)$this->node['id']);
|
||||
$this->element->setName((string)$this->node['name']);
|
||||
|
||||
if(isset($this->node['default'])) {
|
||||
$this->element->setDefault((string)$this->node['default']);
|
||||
}
|
||||
if(isset($node['require'])) {
|
||||
$this->element->setRequire($this->getBoolean($node['require']));
|
||||
if(isset($this->node['require'])) {
|
||||
$this->element->setRequire($this->getBoolean($this->node['require']));
|
||||
}
|
||||
if(isset($node['help'])) {
|
||||
$this->element->setHelp((string)$node['help']);
|
||||
if(isset($this->node['help'])) {
|
||||
$this->element->setHelp((string)$this->node['help']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,15 +6,15 @@ class Input extends Base
|
||||
|
||||
protected $element;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function parse(\SimpleXMLElement $node)
|
||||
public function __construct(\SimpleXMLElement $node)
|
||||
{
|
||||
$this->element = new \PSC\Library\Calc\Option\Type\Input();
|
||||
parent::__construct($node);
|
||||
}
|
||||
|
||||
parent::parse($node);
|
||||
public function parse()
|
||||
{
|
||||
parent::parse();
|
||||
|
||||
return $this->element;
|
||||
}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
namespace PSC\Library\Calc\Option\Parser;
|
||||
|
||||
use Doctrine\Common\Persistence\ObjectRepository;
|
||||
use PSC\Library\Calc\Option\Parser\Select\Opt;
|
||||
use PSC\Library\Calc\PaperContainer;
|
||||
use PSC\Library\Calc\Tests\Mock\Paper;
|
||||
|
||||
class Select extends Base
|
||||
{
|
||||
@ -11,25 +14,87 @@ class Select extends Base
|
||||
/** @var \SimpleXMLElement $node */
|
||||
protected $node;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/** @var PaperContainer */
|
||||
protected $paperContainer;
|
||||
|
||||
}
|
||||
/** @var ObjectRepository */
|
||||
protected $paperRepository;
|
||||
|
||||
public function parse(\SimpleXMLElement $node)
|
||||
public function __construct(\SimpleXMLElement $node)
|
||||
{
|
||||
$this->element = new \PSC\Library\Calc\Option\Type\Select();
|
||||
parent::__construct($node);
|
||||
}
|
||||
|
||||
parent::parse($node);
|
||||
public function parse()
|
||||
{
|
||||
parent::parse();
|
||||
|
||||
$optParser = new Opt();
|
||||
|
||||
foreach ($this->node->opt as $opt) {
|
||||
|
||||
$this->element->addOption($optParser->parse($opt));
|
||||
if(isset($this->node['mode']) && (string)$this->node['mode'] == \PSC\Library\Calc\Option\Type\Select::$modePaperDb) {
|
||||
$this->parseModePapierDb();
|
||||
}else{
|
||||
$this->parseModeNormal();
|
||||
}
|
||||
|
||||
return $this->element;
|
||||
}
|
||||
|
||||
private function parseModePapierDb()
|
||||
{
|
||||
/** @var PaperContainer\Container $container */
|
||||
$container = $this->getPaperContainer()->getContainerById((string)$this->node['container']);
|
||||
|
||||
/** @var PaperContainer\Item $papier */
|
||||
foreach ($container->getItems() as $papier) {
|
||||
/** @var Paper $papierDb */
|
||||
$papierDb = $this->getPaperRepository()->findOneBy(array('artNr' => $papier->getId()));
|
||||
if($papierDb) {
|
||||
$optPapier = new \PSC\Library\Calc\Option\Type\Select\Opt();
|
||||
$optPapier->setId($papierDb->getArtNr());
|
||||
$optPapier->setLabel($papierDb->getDescription1());
|
||||
$this->element->addOption($optPapier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function parseModeNormal()
|
||||
{
|
||||
foreach ($this->node->opt as $opt) {
|
||||
$optParser = new Opt($opt);
|
||||
$this->element->addOption($optParser->parse());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PaperContainer
|
||||
*/
|
||||
public function getPaperContainer()
|
||||
{
|
||||
return $this->paperContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PaperContainer $paperContainer
|
||||
*/
|
||||
public function setPaperContainer($paperContainer)
|
||||
{
|
||||
$this->paperContainer = $paperContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ObjectRepository $repostory
|
||||
*/
|
||||
public function setPaperRepository($repository)
|
||||
{
|
||||
$this->paperRepository = $repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ObjectRepository
|
||||
*/
|
||||
public function getPaperRepository()
|
||||
{
|
||||
return $this->paperRepository;
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,20 +3,21 @@ namespace PSC\Library\Calc\Option\Parser\Select;
|
||||
|
||||
use PSC\Library\Calc\Option\Parser\Base;
|
||||
|
||||
class Opt extends Base
|
||||
class Opt
|
||||
{
|
||||
|
||||
protected $element;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function parse(\SimpleXMLElement $node)
|
||||
public function __construct(\SimpleXMLElement $node)
|
||||
{
|
||||
$this->element = new \PSC\Library\Calc\Option\Type\Select\Opt();
|
||||
$this->node = $node;
|
||||
}
|
||||
|
||||
parent::parse($node);
|
||||
public function parse()
|
||||
{
|
||||
$this->element->setId((string)$this->node['id']);
|
||||
$this->element->setLabel((string)$this->node['name']);
|
||||
|
||||
return $this->element;
|
||||
}
|
||||
|
||||
@ -6,10 +6,20 @@ use PSC\Library\Calc\Option\Type\Select\Opt;
|
||||
class Select extends Base
|
||||
{
|
||||
|
||||
static public $modePaperDb = 'papierdb';
|
||||
|
||||
static public $modeNone = '';
|
||||
|
||||
static public $type = 'select';
|
||||
|
||||
/** @var \ArrayIterator $options */
|
||||
protected $options;
|
||||
|
||||
static public $type = 'select';
|
||||
/** @var String $container */
|
||||
protected $container = '';
|
||||
|
||||
/** @var String $mode */
|
||||
protected $mode = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -31,9 +41,49 @@ class Select extends Base
|
||||
foreach($this->options as $opt)
|
||||
{
|
||||
if($opt->getId() == $this->getRawValue()) {
|
||||
$this->setValue($opt->getName());
|
||||
$this->setValue($opt->getLabel());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
public function getMode()
|
||||
{
|
||||
return $this->mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String $mode
|
||||
*/
|
||||
public function setMode($mode)
|
||||
{
|
||||
$this->mode = $mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
public function getContainer()
|
||||
{
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String $container
|
||||
*/
|
||||
public function setContainer($container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \ArrayIterator
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,8 +3,45 @@ namespace PSC\Library\Calc\Option\Type\Select;
|
||||
|
||||
use PSC\Library\Calc\Option\Type\Base;
|
||||
|
||||
class Opt extends Base
|
||||
class Opt
|
||||
{
|
||||
static public $type = 'opt';
|
||||
/** @var string $id */
|
||||
protected $id;
|
||||
|
||||
/** @var string $label */
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel()
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $label
|
||||
*/
|
||||
public function setLabel($label)
|
||||
{
|
||||
$this->label = $label;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
51
src/PaperContainer.php
Normal file
51
src/PaperContainer.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
namespace PSC\Library\Calc;
|
||||
|
||||
use PSC\Library\Calc\PaperContainer\Container;
|
||||
use PSC\Library\Calc\PaperContainer\Item;
|
||||
|
||||
class PaperContainer
|
||||
{
|
||||
|
||||
/** @var \ArrayIterator $container */
|
||||
protected $container;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->container = new \ArrayIterator();
|
||||
}
|
||||
|
||||
public function parse(\SimpleXMLElement $node)
|
||||
{
|
||||
foreach($node->papiercontainer as $containerNode) {
|
||||
$container = new Container();
|
||||
$container->setId((string)$containerNode['id']);
|
||||
foreach($containerNode->papier as $paper) {
|
||||
$item = new Item();
|
||||
$item->setId((string)$paper['id']);
|
||||
$container->addItem($item);
|
||||
}
|
||||
$this->container->append($container);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \ArrayIterator
|
||||
*/
|
||||
public function getContainer()
|
||||
{
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
public function getContainerById($id)
|
||||
{
|
||||
/** @var Container $article */
|
||||
foreach($this->container as $container)
|
||||
{
|
||||
if($container->getId() == $id) {
|
||||
return $container;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
48
src/PaperContainer/Container.php
Normal file
48
src/PaperContainer/Container.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace PSC\Library\Calc\PaperContainer;
|
||||
|
||||
class Container
|
||||
{
|
||||
/** @var String */
|
||||
protected $id;
|
||||
|
||||
/** @var \ArrayIterator $items */
|
||||
protected $items;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->items = new \ArrayIterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Item $item
|
||||
*/
|
||||
public function addItem(Item $item) {
|
||||
$this->items->append($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \ArrayIterator
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String $id
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
}
|
||||
26
src/PaperContainer/Item.php
Normal file
26
src/PaperContainer/Item.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace PSC\Library\Calc\PaperContainer;
|
||||
|
||||
class Item
|
||||
{
|
||||
|
||||
/** @var String */
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String $id
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,10 +1,24 @@
|
||||
<?php
|
||||
namespace PSC\Library\Calc;
|
||||
|
||||
|
||||
use Doctrine\Common\Persistence\ObjectRepository;
|
||||
use PSC\Library\Calc\Option\Parser\Select;
|
||||
|
||||
class Parser
|
||||
{
|
||||
protected $article;
|
||||
|
||||
/** @var PaperContainer */
|
||||
protected $paperContainer;
|
||||
|
||||
/** @var ObjectRepository */
|
||||
protected $paperRepository;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function parse(\SimpleXMLElement $node)
|
||||
{
|
||||
$optionParser = new \PSC\Library\Calc\Option\Parser();
|
||||
@ -12,13 +26,52 @@ class Parser
|
||||
$this->article = new Article((string)$node->name);
|
||||
|
||||
foreach ($node->option as $option) {
|
||||
$obj = $optionParser->parse($option);
|
||||
$obj = $optionParser->getOptByType($option);
|
||||
if($obj) {
|
||||
$this->article->addOption($obj);
|
||||
|
||||
if($obj instanceof Select) {
|
||||
$obj->setPaperContainer($this->getPaperContainer());
|
||||
$obj->setPaperRepository($this->getPaperRepository());
|
||||
}
|
||||
|
||||
$element = $obj->parse();
|
||||
$this->article->addOption($element);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->article;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PaperContainer
|
||||
*/
|
||||
public function getPaperContainer()
|
||||
{
|
||||
return $this->paperContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PaperContainer $paperContainer
|
||||
*/
|
||||
public function setPaperContainer($paperContainer)
|
||||
{
|
||||
$this->paperContainer = $paperContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ObjectRepository
|
||||
*/
|
||||
public function getPaperRepository()
|
||||
{
|
||||
return $this->paperRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ObjectRepository $paperRepository
|
||||
*/
|
||||
public function setPaperRepository($paperRepository)
|
||||
{
|
||||
$this->paperRepository = $paperRepository;
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,12 +4,22 @@ namespace PSC\Library\Calc\Tests\Article;
|
||||
use PSC\Library\Calc\Article;
|
||||
use PSC\Library\Calc\Engine;
|
||||
use PSC\Library\Calc\Option\Type\Select;
|
||||
use PSC\Library\Calc\PaperContainer;
|
||||
use PSC\Library\Calc\PaperContainer\Container;
|
||||
use PSC\Library\Calc\Tests\Mock\PaperRepostory;
|
||||
|
||||
class CalendarXmlTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testIfArticleCountInXmlCorrect()
|
||||
{
|
||||
$repository = new PaperRepostory();
|
||||
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../TestFiles/Option/Select/papierContainer.xml')));
|
||||
|
||||
$parser = new Engine();
|
||||
$parser->setPaperRepository($repository);
|
||||
$parser->setPaperContainer($paperContainer);
|
||||
$this->assertTrue($parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/calendar.xml')));
|
||||
|
||||
$this->assertEquals(1, $parser->getArticles()->Count());
|
||||
@ -17,7 +27,14 @@ class CalendarXmlTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testGetArticleByName()
|
||||
{
|
||||
$repository = new PaperRepostory();
|
||||
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../TestFiles/Option/Select/papierContainer.xml')));
|
||||
|
||||
$parser = new Engine();
|
||||
$parser->setPaperRepository($repository);
|
||||
$parser->setPaperContainer($paperContainer);
|
||||
$parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/calendar.xml'));
|
||||
|
||||
/** @var Article $article */
|
||||
@ -28,7 +45,14 @@ class CalendarXmlTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testGetOptionById()
|
||||
{
|
||||
$repository = new PaperRepostory();
|
||||
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../TestFiles/Option/Select/papierContainer.xml')));
|
||||
|
||||
$parser = new Engine();
|
||||
$parser->setPaperRepository($repository);
|
||||
$parser->setPaperContainer($paperContainer);
|
||||
$parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/calendar.xml'));
|
||||
/** @var Article $article */
|
||||
$article = $parser->getArticleByName('Kalender');
|
||||
@ -42,7 +66,14 @@ class CalendarXmlTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testGetPrintableValuesFromSavedParamsWithCleaning()
|
||||
{
|
||||
$repository = new PaperRepostory();
|
||||
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../TestFiles/Option/Select/papierContainer.xml')));
|
||||
|
||||
$parser = new Engine();
|
||||
$parser->setPaperRepository($repository);
|
||||
$parser->setPaperContainer($paperContainer);
|
||||
$parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/calendar.xml'));
|
||||
|
||||
/** @var Article $article */
|
||||
@ -77,7 +108,24 @@ class CalendarXmlTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('13', $option->getRawValue());
|
||||
$this->assertEquals('13 Seiten Monatskalender mit Deckblatt', $option->getValue());
|
||||
|
||||
}
|
||||
|
||||
public function testGetOptionsForArticle()
|
||||
{
|
||||
$repository = new PaperRepostory();
|
||||
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../TestFiles/Option/Select/papierContainer.xml')));
|
||||
|
||||
$parser = new Engine();
|
||||
$parser->setPaperRepository($repository);
|
||||
$parser->setPaperContainer($paperContainer);
|
||||
$parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/calendar.xml'));
|
||||
|
||||
/** @var Article $article */
|
||||
$article = $parser->getArticleByName('Kalender');
|
||||
|
||||
$this->assertEquals(10, $article->getOptions()->count());
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,12 +2,13 @@
|
||||
namespace PSC\Library\Calc\Tests\Article;
|
||||
|
||||
use PSC\Library\Calc\Engine;
|
||||
use PSC\Library\Calc\PaperContainer\Container;
|
||||
|
||||
class SimpleXmlTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testIfArticleCountInXmlCorrect()
|
||||
{
|
||||
$parser = new Engine();
|
||||
$parser = new Engine(new Container());
|
||||
$this->assertTrue($parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/simple.xml')));
|
||||
|
||||
$this->assertEquals(1, $parser->getArticles()->Count());
|
||||
@ -15,7 +16,7 @@ class SimpleXmlTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testIfArticleCountInXmlCorrectWith2Article()
|
||||
{
|
||||
$parser = new Engine();
|
||||
$parser = new Engine(new Container());
|
||||
$this->assertTrue($parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/simple2articles.xml')));
|
||||
|
||||
$this->assertEquals(2, $parser->getArticles()->Count());
|
||||
@ -23,7 +24,7 @@ class SimpleXmlTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testGetArticleByName()
|
||||
{
|
||||
$parser = new Engine();
|
||||
$parser = new Engine(new Container());
|
||||
$parser->loadString(file_get_contents(__DIR__ .'/../TestFiles/General/simple2articles.xml'));
|
||||
|
||||
$article = $parser->getArticleByName('Blocks A5 25blatt geleimt');
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
namespace PSC\Library\Calc\Tests\General;
|
||||
|
||||
use PSC\Library\Calc\Engine;
|
||||
use PSC\Library\Calc\PaperContainer\Container;
|
||||
|
||||
class LoadTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
1096
tests/Mock/Paper.php
Normal file
1096
tests/Mock/Paper.php
Normal file
File diff suppressed because it is too large
Load Diff
117
tests/Mock/PaperRepostory.php
Normal file
117
tests/Mock/PaperRepostory.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* PrintshopCreator Suite
|
||||
*
|
||||
* PHP Version 5.3
|
||||
*
|
||||
* @author Thomas Peterson <info@thomas-peterson.de>
|
||||
* @copyright 2012-2013 PrintshopCreator GmbH
|
||||
* @license Private
|
||||
* @link http://www.printshopcreator.de
|
||||
*/
|
||||
namespace PSC\Library\Calc\Tests\Mock;
|
||||
|
||||
use Doctrine\Common\Persistence\ObjectRepository;
|
||||
|
||||
class PaperRepostory implements ObjectRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* Finds an object by its primary key / identifier.
|
||||
*
|
||||
* @param mixed $id The identifier.
|
||||
*
|
||||
* @return object The object.
|
||||
*/
|
||||
public function find($id)
|
||||
{
|
||||
// TODO: Implement find() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all objects in the repository.
|
||||
*
|
||||
* @return array The objects.
|
||||
*/
|
||||
public function findAll()
|
||||
{
|
||||
// TODO: Implement findAll() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds objects by a set of criteria.
|
||||
*
|
||||
* Optionally sorting and limiting details can be passed. An implementation may throw
|
||||
* an UnexpectedValueException if certain values of the sorting or limiting details are
|
||||
* not supported.
|
||||
*
|
||||
* @param array $criteria
|
||||
* @param array|null $orderBy
|
||||
* @param int|null $limit
|
||||
* @param int|null $offset
|
||||
*
|
||||
* @return array The objects.
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
{
|
||||
// TODO: Implement findBy() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a single object by a set of criteria.
|
||||
*
|
||||
* @param array $criteria The criteria.
|
||||
*
|
||||
* @return object The object.
|
||||
*/
|
||||
public function findOneBy(array $criteria)
|
||||
{
|
||||
$papier = array();
|
||||
$papier['bdm135'] = new Paper();
|
||||
$papier['bdm135']->setArtNr('bdm135');
|
||||
$papier['bdm135']->setDescription1('Bilderdruck matt 135 gr');
|
||||
|
||||
$papier['bdg135'] = new Paper();
|
||||
$papier['bdg135']->setArtNr('bdg135');
|
||||
$papier['bdg135']->setDescription1('Bilderdruck glänzend 135 gr');
|
||||
|
||||
$papier['bdm170'] = new Paper();
|
||||
$papier['bdm170']->setArtNr('bdm170');
|
||||
$papier['bdm170']->setDescription1('Bilderdruck matt 170 gr');
|
||||
|
||||
$papier['bdg170'] = new Paper();
|
||||
$papier['bdg170']->setArtNr('bdg170');
|
||||
$papier['bdg170']->setDescription1('Bilderdruck glänzend 170 gr');
|
||||
|
||||
$papier['bdm250'] = new Paper();
|
||||
$papier['bdm250']->setArtNr('bdm250');
|
||||
$papier['bdm250']->setDescription1('Bilderdruck matt 250 gr');
|
||||
|
||||
$papier['bdg250'] = new Paper();
|
||||
$papier['bdg250']->setArtNr('bdg250');
|
||||
$papier['bdg250']->setDescription1('Bilderdruck glänzend 250 gr');
|
||||
|
||||
$papier['bdm300'] = new Paper();
|
||||
$papier['bdm300']->setArtNr('bdm300');
|
||||
$papier['bdm300']->setDescription1('Bilderdruck matt 300 gr');
|
||||
|
||||
$papier['bdg300'] = new Paper();
|
||||
$papier['bdg300']->setArtNr('bdg300');
|
||||
$papier['bdg300']->setDescription1('Bilderdruck glänzend 300 gr');
|
||||
|
||||
return $papier[$criteria['artNr']];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class name of the object managed by the repository.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getClassName()
|
||||
{
|
||||
// TODO: Implement getClassName() method.
|
||||
}
|
||||
}
|
||||
@ -3,29 +3,36 @@ namespace PSC\Library\Calc\Tests\Option\Type;
|
||||
|
||||
use PSC\Library\Calc\Option\Parser;
|
||||
use PSC\Library\Calc\Option\Type\Input;
|
||||
use PSC\Library\Calc\PaperContainer\Container;
|
||||
|
||||
class InputTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testIfCorrectType()
|
||||
{
|
||||
$parser = new Parser();
|
||||
/** @var Input $obj */
|
||||
$obj = $parser->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/input.xml')));
|
||||
/** @var Parser\Input $obj */
|
||||
$obj = $parser->getOptByType(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/input.xml')));
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Input', $obj);
|
||||
/** @var Input $element */
|
||||
$element = $obj->parse();
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Input', $element);
|
||||
}
|
||||
|
||||
public function testIfCorrectAttributes()
|
||||
{
|
||||
$parser = new Parser();
|
||||
/** @var Input $obj */
|
||||
$obj = $parser->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/input.xml')));
|
||||
/** @var Parser\Input $obj */
|
||||
$obj = $parser->getOptByType(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/input.xml')));
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Input', $obj);
|
||||
$this->assertTrue($obj->isRequire());
|
||||
$this->assertEquals(5, $obj->getDefault());
|
||||
$this->assertEquals('auflage', $obj->getId());
|
||||
$this->assertEquals('Auflage', $obj->getName());
|
||||
/** @var Input $element */
|
||||
$element = $obj->parse();
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Input', $element);
|
||||
$this->assertTrue($element->isRequire());
|
||||
$this->assertEquals(5, $element->getDefault());
|
||||
$this->assertEquals('auflage', $element->getId());
|
||||
$this->assertEquals('Auflage', $element->getName());
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,29 +3,83 @@ namespace PSC\Library\Calc\Tests\Option\Type;
|
||||
|
||||
use PSC\Library\Calc\Option\Parser;
|
||||
use PSC\Library\Calc\Option\Type\Select;
|
||||
use PSC\Library\Calc\PaperContainer;
|
||||
use PSC\Library\Calc\PaperContainer\Container;
|
||||
use PSC\Library\Calc\Tests\Mock\PaperRepostory;
|
||||
|
||||
class SelectTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testIfCorrectType()
|
||||
{
|
||||
$parser = new Parser();
|
||||
/** @var Select $obj */
|
||||
$obj = $parser->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/select.xml')));
|
||||
/** @var Parser\Select $obj */
|
||||
$obj = $parser->getOptByType(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/select.xml')));
|
||||
$obj->setPaperContainer(new PaperContainer());
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Select', $obj);
|
||||
/** @var Select $element */
|
||||
$element = $obj->parse();
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Select', $element);
|
||||
}
|
||||
|
||||
public function testIfCorrectAttributes()
|
||||
{
|
||||
$parser = new Parser();
|
||||
/** @var Select $obj */
|
||||
$obj = $parser->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/select.xml')));
|
||||
$obj = $parser->getOptByType(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/select.xml')));
|
||||
$obj->setPaperContainer(new PaperContainer());
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Select', $obj);
|
||||
$this->assertTrue($obj->isRequire());
|
||||
$this->assertEquals('a4h', $obj->getDefault());
|
||||
$this->assertEquals('size', $obj->getId());
|
||||
$this->assertEquals('Wählen Sie eine Größe', $obj->getName());
|
||||
/** @var Select $element */
|
||||
$element = $obj->parse();
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Select', $element);
|
||||
$this->assertTrue($element->isRequire());
|
||||
$this->assertEquals('a4h', $element->getDefault());
|
||||
$this->assertEquals('size', $element->getId());
|
||||
$this->assertEquals('Wählen Sie eine Größe', $element->getName());
|
||||
}
|
||||
|
||||
public function testIfPaperContainerReturnsCorrectItems()
|
||||
{
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/Select/papierContainer.xml')));
|
||||
|
||||
$this->assertEquals(2, $paperContainer->getContainer()->count());
|
||||
|
||||
/** @var PaperContainer\Container $container */
|
||||
$container = $paperContainer->getContainerById('test1');
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\PaperContainer\Container', $container);
|
||||
|
||||
$this->assertEquals(5, $container->getItems()->count());
|
||||
|
||||
$container = $paperContainer->getContainerById('test2');
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\PaperContainer\Container', $container);
|
||||
|
||||
$this->assertEquals(8, $container->getItems()->count());
|
||||
}
|
||||
|
||||
public function testIfSelectWithPaperContainerModeReturnsCorrectOpt()
|
||||
{
|
||||
|
||||
$repository = new PaperRepostory();
|
||||
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/Select/papierContainer.xml')));
|
||||
|
||||
$parser = new Parser();
|
||||
/** @var Parser\Select $obj */
|
||||
$obj = $parser->getOptByType(simplexml_load_string(file_get_contents(__DIR__ .'/../../TestFiles/Option/Select/selectPaperDB.xml')));
|
||||
$obj->setPaperContainer($paperContainer);
|
||||
$obj->setPaperRepository($repository);
|
||||
|
||||
/** @var Select $element */
|
||||
$element = $obj->parse();
|
||||
|
||||
$this->assertInstanceOf('PSC\Library\Calc\Option\Type\Select', $element);
|
||||
|
||||
$this->assertEquals(5, $element->getOptions()->count());
|
||||
}
|
||||
|
||||
}
|
||||
@ -46,7 +46,7 @@
|
||||
</auflage>
|
||||
</opt>
|
||||
</option>
|
||||
<option id="papier" name="Material" type="Select" mode="papierdb" container="fk" default="bdm250" help="Aus welchem Material soll Ihr Produkt bestehen?">
|
||||
<option id="papier" name="Material" type="Select" mode="papierdb" container="test1" default="bdm250" help="Aus welchem Material soll Ihr Produkt bestehen?">
|
||||
<auflage>
|
||||
<grenze formel="(0)">1-</grenze>
|
||||
</auflage>
|
||||
|
||||
20
tests/TestFiles/Option/Select/papierContainer.xml
Normal file
20
tests/TestFiles/Option/Select/papierContainer.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<container>
|
||||
<papiercontainer id="test1">
|
||||
<papier id="bdm135"/>
|
||||
<papier id="bdg135"/>
|
||||
<papier id="bdm170"/>
|
||||
<papier id="bdg170"/>
|
||||
<papier id="bdm250"/>
|
||||
</papiercontainer>
|
||||
<papiercontainer id="test2">
|
||||
<papier id="bdm135"/>
|
||||
<papier id="bdg135"/>
|
||||
<papier id="bdm170"/>
|
||||
<papier id="bdg170"/>
|
||||
<papier id="bdm250"/>
|
||||
<papier id="bdg250"/>
|
||||
<papier id="bdm300"/>
|
||||
<papier id="bdg300"/>
|
||||
</papiercontainer>
|
||||
</container>
|
||||
6
tests/TestFiles/Option/Select/selectPaperDB.xml
Normal file
6
tests/TestFiles/Option/Select/selectPaperDB.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<option id="papier" name="Material" type="Select" mode="papierdb" container="test1" default="bdm250" help="Aus welchem Material soll Ihr Produkt bestehen?">
|
||||
<auflage>
|
||||
<grenze formel="(0)">1-</grenze>
|
||||
</auflage>
|
||||
</option>
|
||||
Loading…
Reference in New Issue
Block a user