Inital commit
This commit is contained in:
2
core/vendor/thelia/math-tools/.gitignore
vendored
Normal file
2
core/vendor/thelia/math-tools/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/.idea
|
||||
/vendor/
|
||||
18
core/vendor/thelia/math-tools/.travis.yml
vendored
Normal file
18
core/vendor/thelia/math-tools/.travis.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- hhvm
|
||||
- nightly
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
|
||||
before_script:
|
||||
- composer self-update
|
||||
- composer install --dev
|
||||
|
||||
script: phpunit
|
||||
166
core/vendor/thelia/math-tools/LICENSE
vendored
Normal file
166
core/vendor/thelia/math-tools/LICENSE
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
|
||||
32
core/vendor/thelia/math-tools/README.md
vendored
Normal file
32
core/vendor/thelia/math-tools/README.md
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
Maths tools
|
||||
===
|
||||
|
||||
This library includes some tools for math operations.
|
||||
|
||||
[](https://travis-ci.org/thelia/math-tools) [](https://packagist.org/packages/thelia/math-tools) [](https://scrutinizer-ci.com/g/thelia/math-tools/)
|
||||
|
||||
Number
|
||||
---
|
||||
|
||||
Here's an example of rounding problems solved by this lib:
|
||||
```php
|
||||
$price = new Number('3.99');
|
||||
|
||||
$price->divide('1.2');
|
||||
echo $price->getNumber(); // 3.33
|
||||
|
||||
$price->multiply('1.2');
|
||||
echo $price->getNumber(); // 3.99, where most of time libs returns 4.00
|
||||
```
|
||||
|
||||
GCD
|
||||
---
|
||||
|
||||
This tool computes the GCD of two numbers.
|
||||
|
||||
```php
|
||||
echo GCD::getGCD(10,5); // 5
|
||||
echo GCD::getGCD(10,10); // 10
|
||||
echo GCD::getGCD(20,10); // 10
|
||||
echo GCD::getGCD(11,10); // 1
|
||||
```
|
||||
25
core/vendor/thelia/math-tools/composer.json
vendored
Normal file
25
core/vendor/thelia/math-tools/composer.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "thelia/math-tools",
|
||||
"description": "Number management library",
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.1.*"
|
||||
},
|
||||
"license": "LGPL",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Benjamin Perche",
|
||||
"email": "bperche@openstudio.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"require": {},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Thelia\\Math\\":"src/"
|
||||
}
|
||||
}
|
||||
}
|
||||
708
core/vendor/thelia/math-tools/composer.lock
generated
vendored
Normal file
708
core/vendor/thelia/math-tools/composer.lock
generated
vendored
Normal file
@@ -0,0 +1,708 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "5402140de486c0c5236eba84a3589bff",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "2.0.11",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "53603b3c995f5aab6b59c8e08c3a663d2cc810b7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/53603b3c995f5aab6b59c8e08c3a663d2cc810b7",
|
||||
"reference": "53603b3c995f5aab6b59c8e08c3a663d2cc810b7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"phpunit/php-file-iterator": "~1.3",
|
||||
"phpunit/php-text-template": "~1.2",
|
||||
"phpunit/php-token-stream": "~1.3",
|
||||
"sebastian/environment": "~1.0",
|
||||
"sebastian/version": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-xdebug": ">=2.1.4",
|
||||
"phpunit/phpunit": "~4.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "*",
|
||||
"ext-xdebug": ">=2.2.1",
|
||||
"ext-xmlwriter": "*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sb@sebastian-bergmann.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
|
||||
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
|
||||
"keywords": [
|
||||
"coverage",
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2014-08-31 06:33:04"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
"version": "1.3.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
|
||||
"reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
|
||||
"reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"File/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sb@sebastian-bergmann.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
|
||||
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
|
||||
"keywords": [
|
||||
"filesystem",
|
||||
"iterator"
|
||||
],
|
||||
"time": "2013-10-10 15:34:57"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-text-template",
|
||||
"version": "1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-text-template.git",
|
||||
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
|
||||
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"Text/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sb@sebastian-bergmann.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Simple template engine.",
|
||||
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
|
||||
"keywords": [
|
||||
"template"
|
||||
],
|
||||
"time": "2014-01-30 17:20:04"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-timer",
|
||||
"version": "1.0.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-timer.git",
|
||||
"reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
|
||||
"reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"PHP/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sb@sebastian-bergmann.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Utility class for timing",
|
||||
"homepage": "https://github.com/sebastianbergmann/php-timer/",
|
||||
"keywords": [
|
||||
"timer"
|
||||
],
|
||||
"time": "2013-08-02 07:42:54"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-token-stream",
|
||||
"version": "1.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
||||
"reference": "f8d5d08c56de5cfd592b3340424a81733259a876"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876",
|
||||
"reference": "f8d5d08c56de5cfd592b3340424a81733259a876",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-tokenizer": "*",
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de"
|
||||
}
|
||||
],
|
||||
"description": "Wrapper around PHP's tokenizer extension.",
|
||||
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
|
||||
"keywords": [
|
||||
"tokenizer"
|
||||
],
|
||||
"time": "2014-08-31 06:12:13"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "4.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "241116219bb7e3b8111a36ffd8f37546888738d6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/241116219bb7e3b8111a36ffd8f37546888738d6",
|
||||
"reference": "241116219bb7e3b8111a36ffd8f37546888738d6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-dom": "*",
|
||||
"ext-json": "*",
|
||||
"ext-pcre": "*",
|
||||
"ext-reflection": "*",
|
||||
"ext-spl": "*",
|
||||
"php": ">=5.3.3",
|
||||
"phpunit/php-code-coverage": "~2.0",
|
||||
"phpunit/php-file-iterator": "~1.3.1",
|
||||
"phpunit/php-text-template": "~1.2",
|
||||
"phpunit/php-timer": "~1.0.2",
|
||||
"phpunit/phpunit-mock-objects": "2.1.5",
|
||||
"sebastian/comparator": "~1.0",
|
||||
"sebastian/diff": "~1.1",
|
||||
"sebastian/environment": "~1.0",
|
||||
"sebastian/exporter": "~1.0",
|
||||
"sebastian/version": "~1.0",
|
||||
"symfony/yaml": "~2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"phpunit/php-invoker": "~1.1"
|
||||
},
|
||||
"bin": [
|
||||
"phpunit"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
"",
|
||||
"../../symfony/yaml/"
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "The PHP Unit Testing framework.",
|
||||
"homepage": "http://www.phpunit.de/",
|
||||
"keywords": [
|
||||
"phpunit",
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2014-08-17 08:07:02"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
"version": "2.1.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
||||
"reference": "7878b9c41edb3afab92b85edf5f0981014a2713a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/7878b9c41edb3afab92b85edf5f0981014a2713a",
|
||||
"reference": "7878b9c41edb3afab92b85edf5f0981014a2713a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"phpunit/php-text-template": "~1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-soap": "*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sb@sebastian-bergmann.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Mock Object library for PHPUnit",
|
||||
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
|
||||
"keywords": [
|
||||
"mock",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2014-06-12 07:22:15"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/comparator",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/comparator.git",
|
||||
"reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e54a01c0da1b87db3c5a3c4c5277ddf331da4aef",
|
||||
"reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"sebastian/diff": "~1.1",
|
||||
"sebastian/exporter": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jeff Welch",
|
||||
"email": "whatthejeff@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Volker Dusch",
|
||||
"email": "github@wallbash.com"
|
||||
},
|
||||
{
|
||||
"name": "Bernhard Schussek",
|
||||
"email": "bschussek@2bepublished.at"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de"
|
||||
}
|
||||
],
|
||||
"description": "Provides the functionality to compare PHP values for equality",
|
||||
"homepage": "http://www.github.com/sebastianbergmann/comparator",
|
||||
"keywords": [
|
||||
"comparator",
|
||||
"compare",
|
||||
"equality"
|
||||
],
|
||||
"time": "2014-05-11 23:00:21"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/diff",
|
||||
"version": "1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/diff.git",
|
||||
"reference": "5843509fed39dee4b356a306401e9dd1a931fec7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7",
|
||||
"reference": "5843509fed39dee4b356a306401e9dd1a931fec7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Kore Nordmann",
|
||||
"email": "mail@kore-nordmann.de"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de"
|
||||
}
|
||||
],
|
||||
"description": "Diff implementation",
|
||||
"homepage": "http://www.github.com/sebastianbergmann/diff",
|
||||
"keywords": [
|
||||
"diff"
|
||||
],
|
||||
"time": "2014-08-15 10:29:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/environment",
|
||||
"version": "1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/environment.git",
|
||||
"reference": "0d9bf79554d2a999da194a60416c15cf461eb67d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0d9bf79554d2a999da194a60416c15cf461eb67d",
|
||||
"reference": "0d9bf79554d2a999da194a60416c15cf461eb67d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.3"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de"
|
||||
}
|
||||
],
|
||||
"description": "Provides functionality to handle HHVM/PHP environments",
|
||||
"homepage": "http://www.github.com/sebastianbergmann/environment",
|
||||
"keywords": [
|
||||
"Xdebug",
|
||||
"environment",
|
||||
"hhvm"
|
||||
],
|
||||
"time": "2014-10-22 06:38:05"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/exporter",
|
||||
"version": "1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/exporter.git",
|
||||
"reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0",
|
||||
"reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jeff Welch",
|
||||
"email": "whatthejeff@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Volker Dusch",
|
||||
"email": "github@wallbash.com"
|
||||
},
|
||||
{
|
||||
"name": "Bernhard Schussek",
|
||||
"email": "bschussek@2bepublished.at"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de"
|
||||
},
|
||||
{
|
||||
"name": "Adam Harvey",
|
||||
"email": "aharvey@php.net"
|
||||
}
|
||||
],
|
||||
"description": "Provides the functionality to export PHP variables for visualization",
|
||||
"homepage": "http://www.github.com/sebastianbergmann/exporter",
|
||||
"keywords": [
|
||||
"export",
|
||||
"exporter"
|
||||
],
|
||||
"time": "2014-09-10 00:51:36"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/version",
|
||||
"version": "1.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/version.git",
|
||||
"reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
|
||||
"reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
||||
"homepage": "https://github.com/sebastianbergmann/version",
|
||||
"time": "2014-03-07 15:35:33"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v2.5.6",
|
||||
"target-dir": "Symfony/Component/Yaml",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Yaml.git",
|
||||
"reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Yaml/zipball/2d9f527449cabfa8543dd7fa3a466d6ae83d6726",
|
||||
"reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\Yaml\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2014-10-01 05:50:18"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
}
|
||||
17
core/vendor/thelia/math-tools/phpunit.xml.dist
vendored
Normal file
17
core/vendor/thelia/math-tools/phpunit.xml.dist
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit bootstrap="./tests/bootstrap.php"
|
||||
colors="true">
|
||||
<testsuites>
|
||||
<testsuite>
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">src</directory>
|
||||
<exclude>
|
||||
<directory suffix="Interface.php">src/</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
54
core/vendor/thelia/math-tools/src/GCD.php
vendored
Normal file
54
core/vendor/thelia/math-tools/src/GCD.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Math;
|
||||
|
||||
/**
|
||||
* Class GCD
|
||||
* @package Thelia\Math
|
||||
* @author Benjamin Perche <bperche@openstudio.com>
|
||||
*/
|
||||
class GCD
|
||||
{
|
||||
public static function getGCD($numberA, $numberB)
|
||||
{
|
||||
if (! self::isInteger($numberA) | ! self::isInteger($numberB)) {
|
||||
throw new \InvalidArgumentException(
|
||||
"GCD number must be an integer"
|
||||
);
|
||||
}
|
||||
|
||||
if (function_exists("gmp_gcd")) {
|
||||
return gmp_intval(gmp_gcd($numberA, $numberB));
|
||||
}
|
||||
|
||||
if ($numberA == 0 || $numberB == 0) {
|
||||
return max(abs($numberA), abs($numberB));
|
||||
}
|
||||
|
||||
$r = $numberA % $numberB;
|
||||
|
||||
return ($r != 0) ? self::getGCD($numberB, $r) : abs($numberB);
|
||||
}
|
||||
|
||||
public static function isInteger($var)
|
||||
{
|
||||
if (is_int($var)) {
|
||||
// the most obvious test
|
||||
return true;
|
||||
} elseif (is_numeric($var)) {
|
||||
// cast to string first
|
||||
return ctype_digit((string)$var);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
219
core/vendor/thelia/math-tools/src/Number.php
vendored
Normal file
219
core/vendor/thelia/math-tools/src/Number.php
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Math;
|
||||
|
||||
/**
|
||||
* Class Number
|
||||
* @package Lovenunu\Math
|
||||
* @author Benjamin Perche <bperche@openstudio.com>
|
||||
*/
|
||||
class Number implements \Serializable, \JsonSerializable
|
||||
{
|
||||
// Regex to find correct numbers
|
||||
const NUMBER_PATTERN = "#^\d+(\.\d+)?$#";
|
||||
|
||||
// Internal variables
|
||||
protected $dividend;
|
||||
|
||||
protected $divisor;
|
||||
|
||||
// --- Object construction ------------
|
||||
public function __construct($number = null)
|
||||
{
|
||||
list($this->dividend, $this->divisor) = $this->retrieve($number);
|
||||
}
|
||||
|
||||
protected function initialize($dividend, $divisor)
|
||||
{
|
||||
$this->dividend = $dividend;
|
||||
|
||||
$this->divisor = $divisor;
|
||||
}
|
||||
|
||||
// --- Number processor ------------
|
||||
|
||||
protected function retrieve($number)
|
||||
{
|
||||
$dividend = 0;
|
||||
$divisor = 1;
|
||||
|
||||
if ($number !== null) {
|
||||
if (is_scalar($number) && preg_match(static::NUMBER_PATTERN, $number)) {
|
||||
$dividend = (int) str_replace(".", "", $number);
|
||||
|
||||
if (false !== $pos = strpos($number, ".")) {
|
||||
$divisor = pow(10, strlen($number) - $pos - 1);
|
||||
}
|
||||
} elseif ($number instanceof $this) {
|
||||
$dividend = $number->getDividend();
|
||||
$divisor = $number->getDivisor();
|
||||
} else {
|
||||
throw new \InvalidArgumentException(
|
||||
"The given price is not valid"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array($dividend, $divisor);
|
||||
}
|
||||
|
||||
protected function computeDividend($askedDividend, $askedDivisor, Number $number)
|
||||
{
|
||||
if ($number->divisor !== $askedDivisor) {
|
||||
$number->dividend *= $askedDivisor;
|
||||
$askedDividend *= $number->divisor;
|
||||
|
||||
$number->divisor *= $askedDivisor;
|
||||
}
|
||||
|
||||
return $askedDividend;
|
||||
}
|
||||
|
||||
protected function simplify()
|
||||
{
|
||||
if (1 < $gcd = GCD::getGCD($this->dividend, $this->divisor)) {
|
||||
$this->dividend /= $gcd;
|
||||
$this->divisor /= $gcd;
|
||||
}
|
||||
}
|
||||
|
||||
// --- Operations ------------
|
||||
|
||||
public function add($number)
|
||||
{
|
||||
list($askedDividend, $askedDivisor) = $this->retrieve($number);
|
||||
$returnNumber = clone $this;
|
||||
|
||||
$askedDividend = $this->computeDividend($askedDividend, $askedDivisor, $returnNumber);
|
||||
|
||||
/**
|
||||
* If divisors are different, just multiply them
|
||||
*/
|
||||
|
||||
$returnNumber->dividend += $askedDividend;
|
||||
$returnNumber->simplify();
|
||||
|
||||
return $returnNumber;
|
||||
}
|
||||
|
||||
public function sub($number)
|
||||
{
|
||||
list($askedDividend, $askedDivisor) = $this->retrieve($number);
|
||||
$returnNumber = clone $this;
|
||||
|
||||
$askedDividend = $this->computeDividend($askedDividend, $askedDivisor, $returnNumber);
|
||||
|
||||
/**
|
||||
* If divisors are different, just multiply them
|
||||
*/
|
||||
|
||||
$returnNumber->dividend -= $askedDividend;
|
||||
$returnNumber->simplify();
|
||||
|
||||
return $returnNumber;
|
||||
}
|
||||
|
||||
public function multiply($number)
|
||||
{
|
||||
list($askedDividend, $askedDivisor) = $this->retrieve($number);
|
||||
$returnNumber = clone $this;
|
||||
|
||||
$returnNumber->dividend *= $askedDividend;
|
||||
$returnNumber->divisor *= $askedDivisor;
|
||||
$returnNumber->simplify();
|
||||
|
||||
return $returnNumber;
|
||||
}
|
||||
|
||||
public function divide($number)
|
||||
{
|
||||
list($askedDividend, $askedDivisor) = $this->retrieve($number);
|
||||
$returnNumber = clone $this;
|
||||
|
||||
$returnNumber->dividend *= $askedDivisor;
|
||||
$returnNumber->divisor *= $askedDividend;
|
||||
$returnNumber->simplify();
|
||||
|
||||
return $returnNumber;
|
||||
}
|
||||
|
||||
// --- Results ------------
|
||||
|
||||
public function getNumber($roundPrecision = 2, $roundMode = PHP_ROUND_HALF_UP)
|
||||
{
|
||||
$value = $this->dividend / $this->divisor;
|
||||
|
||||
if ($roundPrecision >= 0) {
|
||||
$value = round($value, $roundPrecision, $roundMode);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
// --- Accessor ------------
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDividend()
|
||||
{
|
||||
return $this->dividend;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDivisor()
|
||||
{
|
||||
return $this->divisor;
|
||||
}
|
||||
|
||||
// --- Interfaces implementation ------------
|
||||
/**
|
||||
* (PHP 5 >= 5.1.0)<br/>
|
||||
* String representation of object
|
||||
* @link http://php.net/manual/en/serializable.serialize.php
|
||||
* @return string the string representation of the object or null
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
return json_encode(array($this->dividend, $this->divisor));
|
||||
}
|
||||
|
||||
/**
|
||||
* (PHP 5 >= 5.1.0)<br/>
|
||||
* Constructs the object
|
||||
* @link http://php.net/manual/en/serializable.unserialize.php
|
||||
* @param string $serialized <p>
|
||||
* The string representation of the object.
|
||||
* </p>
|
||||
* @return void
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
list($this->dividend, $this->divisor) = json_decode($serialized, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* (PHP 5 >= 5.4.0)<br/>
|
||||
* Specify data which should be serialized to JSON
|
||||
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
|
||||
* @return mixed data which can be serialized by <b>json_encode</b>,
|
||||
* which is a value of any type other than a resource.
|
||||
*/
|
||||
function jsonSerialize()
|
||||
{
|
||||
return $this->serialize();
|
||||
}
|
||||
|
||||
}
|
||||
61
core/vendor/thelia/math-tools/tests/Lovenunu/Math/NumberTest.php
vendored
Normal file
61
core/vendor/thelia/math-tools/tests/Lovenunu/Math/NumberTest.php
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
use Thelia\Math\Number;
|
||||
|
||||
/**
|
||||
* Class NumberTest
|
||||
* @author Benjamin Perche <bperche@openstudio.com>
|
||||
*/
|
||||
class NumberTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testMult()
|
||||
{
|
||||
$numberA = new Number('1');
|
||||
$numberB = $numberA->multiply('1.2393');
|
||||
|
||||
$this->assertEquals(1.2393, $numberB->getNumber(-1));
|
||||
}
|
||||
|
||||
public function testNumberAdd()
|
||||
{
|
||||
$numberA = new Number('1.99');
|
||||
$numberB = new Number('2.58');
|
||||
|
||||
$numberC = $numberA->add($numberB);
|
||||
|
||||
$this->assertEquals(4.57, $numberC->getNumber(-1));
|
||||
}
|
||||
|
||||
public function testNumberSub()
|
||||
{
|
||||
$price = new Number('1.99');
|
||||
|
||||
$subPrice = $price->sub('1.766');
|
||||
$this->assertEquals(0.22, $subPrice->getNumber());
|
||||
$this->assertEquals(1.99, $price->getNumber());
|
||||
$this->assertEquals(0.224, $subPrice->getNumber(3));
|
||||
$this->assertEquals(0.224, $subPrice->getNumber(-1));
|
||||
}
|
||||
|
||||
public function testNumberDivideThenMultiply()
|
||||
{
|
||||
$price = new Number('3.99');
|
||||
|
||||
$divPrice = $price->divide('1.2');
|
||||
$this->assertEquals(3.33, $divPrice->getNumber());
|
||||
|
||||
$mulPrice = $divPrice->multiply('1.2');
|
||||
$this->assertEquals(3.99, $mulPrice->getNumber());
|
||||
}
|
||||
}
|
||||
|
||||
3
core/vendor/thelia/math-tools/tests/bootstrap.php
vendored
Normal file
3
core/vendor/thelia/math-tools/tests/bootstrap.php
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php";
|
||||
Reference in New Issue
Block a user