Commit c2acf978 authored by webchick's avatar webchick

Issue #2400407 by DuaelFr: Ensure vendor sebastian/comparator is on latest stable release

parent 03da2949
......@@ -1632,16 +1632,16 @@
},
{
"name": "sebastian/comparator",
"version": "1.1.1",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "1dd8869519a225f7f2b9eb663e225298fade819e"
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e",
"reference": "1dd8869519a225f7f2b9eb663e225298fade819e",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
"shasum": ""
},
"require": {
......@@ -1655,7 +1655,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
"dev-master": "1.2.x-dev"
}
},
"autoload": {
......@@ -1692,7 +1692,7 @@
"compare",
"equality"
],
"time": "2015-01-29 16:28:08"
"time": "2015-07-26 15:48:44"
},
{
"name": "sebastian/diff",
......
......@@ -598,72 +598,6 @@
"diff"
]
},
{
"name": "sebastian/comparator",
"version": "1.1.1",
"version_normalized": "1.1.1.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "1dd8869519a225f7f2b9eb663e225298fade819e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e",
"reference": "1dd8869519a225f7f2b9eb663e225298fade819e",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/diff": "~1.2",
"sebastian/exporter": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"time": "2015-01-29 16:28:08",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"installation-source": "dist",
"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"
]
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "2.0.4",
......@@ -3484,5 +3418,71 @@
"mock",
"xunit"
]
},
{
"name": "sebastian/comparator",
"version": "1.2.0",
"version_normalized": "1.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/diff": "~1.2",
"sebastian/exporter": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"time": "2015-07-26 15:48:44",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"installation-source": "dist",
"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"
]
}
]
language: php
sudo: false
install:
- travis_retry composer install --no-interaction --prefer-source
......
......@@ -4,6 +4,18 @@
This component provides the functionality to compare PHP values for equality.
## Installation
To add Comparator as a local, per-project dependency to your project, simply add a dependency on `sebastian/comparator` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Comparator 1.2:
```JSON
{
"require": {
"sebastian/comparator": "~1.2"
}
}
```
## Usage
```php
......@@ -27,12 +39,3 @@ catch (ComparisonFailure $failure) {
}
```
## Installation
To add Comparator as a local, per-project dependency to your project, simply add a dependency on `sebastian/comparator` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Comparator 1.0:
{
"require": {
"sebastian/comparator": "1.0.*"
}
}
......@@ -37,7 +37,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
"dev-master": "1.2.x-dev"
}
}
}
......
......@@ -12,12 +12,6 @@
/**
* Compares arrays for equality.
*
* @package Comparator
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
class ArrayComparator extends Comparator
{
......@@ -25,8 +19,8 @@ class ArrayComparator extends Comparator
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
* @param mixed $actual The second value to compare
* @return bool
*/
public function accepts($expected, $actual)
{
......@@ -36,18 +30,18 @@ public function accepts($expected, $actual)
/**
* Asserts that two values are equal.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @param array $processed
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @param array $processed
* @throws ComparisonFailure Thrown when the comparison
* fails. Contains information about the
* specific errors that lead to the failure.
* fails. Contains information about the
* specific errors that lead to the failure.
*/
public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array())
{
......
......@@ -14,13 +14,6 @@
/**
* Abstract base class for comparators which compare values for equality.
*
* @package Comparator
* @subpackage Framework
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
abstract class Comparator
{
......@@ -51,25 +44,25 @@ public function setFactory(Factory $factory)
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
* @param mixed $actual The second value to compare
* @return bool
*/
abstract public function accepts($expected, $actual);
/**
* Asserts that two values are equal.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @throws ComparisonFailure Thrown when the comparison
* fails. Contains information about the
* specific errors that lead to the failure.
* fails. Contains information about the
* specific errors that lead to the failure.
*/
abstract public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false);
}
......@@ -14,13 +14,6 @@
/**
* Thrown when an assertion for string equality failed.
*
* @package Comparator
* @author Sebastian Bergmann <sebastian@phpunit.de>
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
class ComparisonFailure extends \RuntimeException
{
......@@ -49,7 +42,7 @@ class ComparisonFailure extends \RuntimeException
protected $actualAsString;
/**
* @var boolean
* @var bool
*/
protected $identical;
......@@ -63,13 +56,13 @@ class ComparisonFailure extends \RuntimeException
/**
* Initialises with the expected value and the actual value.
*
* @param mixed $expected Expected value retrieved.
* @param mixed $actual Actual value retrieved.
* @param mixed $expected Expected value retrieved.
* @param mixed $actual Actual value retrieved.
* @param string $expectedAsString
* @param string $actualAsString
* @param boolean $identical
* @param string $message A string which is prefixed on all returned lines
* in the difference output.
* @param bool $identical
* @param string $message A string which is prefixed on all returned lines
* in the difference output.
*/
public function __construct($expected, $actual, $expectedAsString, $actualAsString, $identical = false, $message = '')
{
......
......@@ -15,12 +15,6 @@
/**
* Compares DOMNode instances for equality.
*
* @package Comparator
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
class DOMNodeComparator extends ObjectComparator
{
......@@ -28,8 +22,8 @@ class DOMNodeComparator extends ObjectComparator
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
* @param mixed $actual The second value to compare
* @return bool
*/
public function accepts($expected, $actual)
{
......@@ -39,17 +33,17 @@ public function accepts($expected, $actual)
/**
* Asserts that two values are equal.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @throws ComparisonFailure Thrown when the comparison
* fails. Contains information about the
* specific errors that lead to the failure.
* fails. Contains information about the
* specific errors that lead to the failure.
*/
public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)
{
......@@ -79,8 +73,8 @@ public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = f
* representation of a DOMNode.
*
* @param DOMNode $node
* @param boolean $canonicalize
* @param boolean $ignoreCase
* @param bool $canonicalize
* @param bool $ignoreCase
* @return string
*/
private function nodeToText(DOMNode $node, $canonicalize, $ignoreCase)
......
......@@ -11,13 +11,7 @@
namespace SebastianBergmann\Comparator;
/**
* Compares DateTime instances for equality.
*
* @package Comparator
* @author Jeff Welch <whatthejeff@gmail.com>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
* Compares DateTimeInterface instances for equality.
*/
class DateTimeComparator extends ObjectComparator
{
......@@ -25,28 +19,29 @@ class DateTimeComparator extends ObjectComparator
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
* @param mixed $actual The second value to compare
* @return bool
*/
public function accepts($expected, $actual)
{
return $expected instanceof \DateTime && $actual instanceof \DateTime;
return ($expected instanceof \DateTime || $expected instanceof \DateTimeInterface) &&
($actual instanceof \DateTime || $actual instanceof \DateTimeInterface);
}
/**
* Asserts that two values are equal.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @throws ComparisonFailure Thrown when the comparison
* fails. Contains information about the
* specific errors that lead to the failure.
* fails. Contains information about the
* specific errors that lead to the failure.
*/
public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)
{
......@@ -70,16 +65,16 @@ public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = f
/**
* Returns an ISO 8601 formatted string representation of a datetime or
* 'Invalid DateTime object' if the provided DateTime was not properly
* 'Invalid DateTimeInterface object' if the provided DateTimeInterface was not properly
* initialized.
*
* @param \DateTime $datetime
* @param \DateTimeInterface $datetime
* @return string
*/
protected function dateTimeToString(\DateTime $datetime)
protected function dateTimeToString($datetime)
{
$string = $datetime->format(\DateTime::ISO8601);
return $string ? $string : 'Invalid DateTime object';
return $string ? $string : 'Invalid DateTimeInterface object';
}
}
......@@ -12,12 +12,6 @@
/**
* Compares doubles for equality.
*
* @package Comparator
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
class DoubleComparator extends NumericComparator
{
......@@ -32,8 +26,8 @@ class DoubleComparator extends NumericComparator
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
* @param mixed $actual The second value to compare
* @return bool
*/
public function accepts($expected, $actual)
{
......@@ -43,17 +37,17 @@ public function accepts($expected, $actual)
/**
* Asserts that two values are equal.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @throws ComparisonFailure Thrown when the comparison
* fails. Contains information about the
* specific errors that lead to the failure.
* fails. Contains information about the
* specific errors that lead to the failure.
*/
public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)
{
......
......@@ -12,12 +12,6 @@
/**
* Compares Exception instances for equality.
*
* @package Comparator
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
class ExceptionComparator extends ObjectComparator
{
......@@ -25,8 +19,8 @@ class ExceptionComparator extends ObjectComparator
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
* @param mixed $actual The second value to compare
* @return bool
*/
public function accepts($expected, $actual)
{
......
......@@ -12,12 +12,6 @@
/**
* Factory for comparators which compare values for equality.
*
* @package Comparator
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
class Factory
{
......@@ -56,7 +50,7 @@ public function __construct()
public static function getInstance()
{
if (self::$instance === null) {
self::$instance = new Factory;
self::$instance = new self;
}
return self::$instance;
......@@ -65,8 +59,8 @@ public static function getInstance()
/**
* Returns the correct comparator for comparing two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return Comparator
*/
public function getComparatorFor($expected, $actual)
......
......@@ -12,21 +12,15 @@
/**
* Compares PHPUnit_Framework_MockObject_MockObject instances for equality.
*
* @package Comparator
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
class MockObjectComparator extends ObjectComparator
{
/**
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return bool
*/
public function accepts($expected, $actual)
{
......
......@@ -12,13 +12,6 @@
/**
* Compares numerical values for equality.
*
* @package Comparator
* @author Bernhard Schussek <bschussek@2bepublished.at>
* @author Alexander <iam.asm89@gmail.com>
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @link http://www.github.com/sebastianbergmann/comparator
*/
class NumericComparator extends ScalarComparator
{
......@@ -26,8 +19,8 @@ class NumericComparator extends ScalarComparator
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
* @param mixed $actual The second value to compare
* @return bool
*/
public function accepts($expected, $actual)
{
......@@ -41,17 +34,17 @@ public function accepts($expected, $actual)
/**
* Asserts that two values are equal.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @throws ComparisonFailure Thrown when the comparison
* fails. Contains information about the
* specific errors that lead to the failure.
* fails. Contains information about the
* specific errors that lead to the failure.