+ */
+ function both(\Hamcrest\Matcher $matcher)
+ {
+ return \Hamcrest\Core\CombinableMatcher::both($matcher);
+ }
+}
+
+if (!function_exists('either')) { /**
+ * This is useful for fluently combining matchers where either may pass,
+ * for example:
+ *
+ */
+ function hasItem(/* args... */)
+ {
+ $args = func_get_args();
+ return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItem'), $args);
+ }
+}
+
+if (!function_exists('hasItems')) { /**
+ * Test if the value is an array containing elements that match all of these
+ * matchers.
+ *
+ * Example:
+ *
+ *
+ * @factory
+ */
+ public static function both(Matcher $matcher)
+ {
+ return new self($matcher);
+ }
+
+ /**
+ * This is useful for fluently combining matchers where either may pass,
+ * for example:
+ *
+ *
+ * @factory ...
+ */
+ public static function hasItem()
+ {
+ $args = func_get_args();
+ $firstArg = array_shift($args);
+
+ return new self(Util::wrapValueWithIsEqual($firstArg));
+ }
+
+ /**
+ * Test if the value is an array containing elements that match all of these
+ * matchers.
+ *
+ * Example:
+ *
+ */
+ public static function either(\Hamcrest\Matcher $matcher)
+ {
+ return \Hamcrest\Core\CombinableMatcher::either($matcher);
+ }
+
+ /**
+ * Wraps an existing matcher and overrides the description when it fails.
+ */
+ public static function describedAs(/* args... */)
+ {
+ $args = func_get_args();
+ return call_user_func_array(array('\Hamcrest\Core\DescribedAs', 'describedAs'), $args);
+ }
+
+ /**
+ * @param Matcher $itemMatcher
+ * A matcher to apply to every element in an array.
+ *
+ * @return \Hamcrest\Core\Every
+ * Evaluates to TRUE for a collection in which every item matches $itemMatcher
+ */
+ public static function everyItem(\Hamcrest\Matcher $itemMatcher)
+ {
+ return \Hamcrest\Core\Every::everyItem($itemMatcher);
+ }
+
+ /**
+ * Does array size satisfy a given matcher?
+ */
+ public static function hasToString($matcher)
+ {
+ return \Hamcrest\Core\HasToString::hasToString($matcher);
+ }
+
+ /**
+ * Decorates another Matcher, retaining the behavior but allowing tests
+ * to be slightly more expressive.
+ *
+ * For example: assertThat($cheese, equalTo($smelly))
+ * vs. assertThat($cheese, is(equalTo($smelly)))
+ */
+ public static function is($value)
+ {
+ return \Hamcrest\Core\Is::is($value);
+ }
+
+ /**
+ * This matcher always evaluates to true.
+ *
+ * @param string $description A meaningful string used when describing itself.
+ *
+ * @return \Hamcrest\Core\IsAnything
+ */
+ public static function anything($description = 'ANYTHING')
+ {
+ return \Hamcrest\Core\IsAnything::anything($description);
+ }
+
+ /**
+ * Test if the value is an array containing this matcher.
+ *
+ * Example:
+ *
+ */
+ public static function hasItem(/* args... */)
+ {
+ $args = func_get_args();
+ return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItem'), $args);
+ }
+
+ /**
+ * Test if the value is an array containing elements that match all of these
+ * matchers.
+ *
+ * Example:
+ *
+ */
+ public static function hasItems(/* args... */)
+ {
+ $args = func_get_args();
+ return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItems'), $args);
+ }
+
+ /**
+ * Is the value equal to another value, as tested by the use of the "=="
+ * comparison operator?
+ */
+ public static function equalTo($item)
+ {
+ return \Hamcrest\Core\IsEqual::equalTo($item);
+ }
+
+ /**
+ * Tests of the value is identical to $value as tested by the "===" operator.
+ */
+ public static function identicalTo($value)
+ {
+ return \Hamcrest\Core\IsIdentical::identicalTo($value);
+ }
+
+ /**
+ * Is the value an instance of a particular type?
+ * This version assumes no relationship between the required type and
+ * the signature of the method that sets it up, for example in
+ * assertThat($anObject, anInstanceOf('Thing'));
+ */
+ public static function anInstanceOf($theClass)
+ {
+ return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass);
+ }
+
+ /**
+ * Is the value an instance of a particular type?
+ * This version assumes no relationship between the required type and
+ * the signature of the method that sets it up, for example in
+ * assertThat($anObject, anInstanceOf('Thing'));
+ */
+ public static function any($theClass)
+ {
+ return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass);
+ }
+
+ /**
+ * Matches if value does not match $value.
+ */
+ public static function not($value)
+ {
+ return \Hamcrest\Core\IsNot::not($value);
+ }
+
+ /**
+ * Matches if value is null.
+ */
+ public static function nullValue()
+ {
+ return \Hamcrest\Core\IsNull::nullValue();
+ }
+
+ /**
+ * Matches if value is not null.
+ */
+ public static function notNullValue()
+ {
+ return \Hamcrest\Core\IsNull::notNullValue();
+ }
+
+ /**
+ * Creates a new instance of IsSame.
+ *
+ * @param mixed $object
+ * The predicate evaluates to true only when the argument is
+ * this object.
+ *
+ * @return \Hamcrest\Core\IsSame
+ */
+ public static function sameInstance($object)
+ {
+ return \Hamcrest\Core\IsSame::sameInstance($object);
+ }
+
+ /**
+ * Is the value a particular built-in type?
+ */
+ public static function typeOf($theType)
+ {
+ return \Hamcrest\Core\IsTypeOf::typeOf($theType);
+ }
+
+ /**
+ * Matches if value (class, object, or array) has named $property.
+ */
+ public static function set($property)
+ {
+ return \Hamcrest\Core\Set::set($property);
+ }
+
+ /**
+ * Matches if value (class, object, or array) does not have named $property.
+ */
+ public static function notSet($property)
+ {
+ return \Hamcrest\Core\Set::notSet($property);
+ }
+
+ /**
+ * Matches if value is a number equal to $value within some range of
+ * acceptable error $delta.
+ */
+ public static function closeTo($value, $delta)
+ {
+ return \Hamcrest\Number\IsCloseTo::closeTo($value, $delta);
+ }
+
+ /**
+ * The value is not > $value, nor < $value.
+ */
+ public static function comparesEqualTo($value)
+ {
+ return \Hamcrest\Number\OrderingComparison::comparesEqualTo($value);
+ }
+
+ /**
+ * The value is > $value.
+ */
+ public static function greaterThan($value)
+ {
+ return \Hamcrest\Number\OrderingComparison::greaterThan($value);
+ }
+
+ /**
+ * The value is >= $value.
+ */
+ public static function greaterThanOrEqualTo($value)
+ {
+ return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value);
+ }
+
+ /**
+ * The value is >= $value.
+ */
+ public static function atLeast($value)
+ {
+ return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value);
+ }
+
+ /**
+ * The value is < $value.
+ */
+ public static function lessThan($value)
+ {
+ return \Hamcrest\Number\OrderingComparison::lessThan($value);
+ }
+
+ /**
+ * The value is <= $value.
+ */
+ public static function lessThanOrEqualTo($value)
+ {
+ return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value);
+ }
+
+ /**
+ * The value is <= $value.
+ */
+ public static function atMost($value)
+ {
+ return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value);
+ }
+
+ /**
+ * Matches if value is a zero-length string.
+ */
+ public static function isEmptyString()
+ {
+ return \Hamcrest\Text\IsEmptyString::isEmptyString();
+ }
+
+ /**
+ * Matches if value is a zero-length string.
+ */
+ public static function emptyString()
+ {
+ return \Hamcrest\Text\IsEmptyString::isEmptyString();
+ }
+
+ /**
+ * Matches if value is null or a zero-length string.
+ */
+ public static function isEmptyOrNullString()
+ {
+ return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString();
+ }
+
+ /**
+ * Matches if value is null or a zero-length string.
+ */
+ public static function nullOrEmptyString()
+ {
+ return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString();
+ }
+
+ /**
+ * Matches if value is a non-zero-length string.
+ */
+ public static function isNonEmptyString()
+ {
+ return \Hamcrest\Text\IsEmptyString::isNonEmptyString();
+ }
+
+ /**
+ * Matches if value is a non-zero-length string.
+ */
+ public static function nonEmptyString()
+ {
+ return \Hamcrest\Text\IsEmptyString::isNonEmptyString();
+ }
+
+ /**
+ * Matches if value is a string equal to $string, regardless of the case.
+ */
+ public static function equalToIgnoringCase($string)
+ {
+ return \Hamcrest\Text\IsEqualIgnoringCase::equalToIgnoringCase($string);
+ }
+
+ /**
+ * Matches if value is a string equal to $string, regardless of whitespace.
+ */
+ public static function equalToIgnoringWhiteSpace($string)
+ {
+ return \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace($string);
+ }
+
+ /**
+ * Matches if value is a string that matches regular expression $pattern.
+ */
+ public static function matchesPattern($pattern)
+ {
+ return \Hamcrest\Text\MatchesPattern::matchesPattern($pattern);
+ }
+
+ /**
+ * Matches if value is a string that contains $substring.
+ */
+ public static function containsString($substring)
+ {
+ return \Hamcrest\Text\StringContains::containsString($substring);
+ }
+
+ /**
+ * Matches if value is a string that contains $substring regardless of the case.
+ */
+ public static function containsStringIgnoringCase($substring)
+ {
+ return \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase($substring);
+ }
+
+ /**
+ * Matches if value contains $substrings in a constrained order.
+ */
+ public static function stringContainsInOrder(/* args... */)
+ {
+ $args = func_get_args();
+ return call_user_func_array(array('\Hamcrest\Text\StringContainsInOrder', 'stringContainsInOrder'), $args);
+ }
+
+ /**
+ * Matches if value is a string that ends with $substring.
+ */
+ public static function endsWith($substring)
+ {
+ return \Hamcrest\Text\StringEndsWith::endsWith($substring);
+ }
+
+ /**
+ * Matches if value is a string that starts with $substring.
+ */
+ public static function startsWith($substring)
+ {
+ return \Hamcrest\Text\StringStartsWith::startsWith($substring);
+ }
+
+ /**
+ * Is the value an array?
+ */
+ public static function arrayValue()
+ {
+ return \Hamcrest\Type\IsArray::arrayValue();
+ }
+
+ /**
+ * Is the value a boolean?
+ */
+ public static function booleanValue()
+ {
+ return \Hamcrest\Type\IsBoolean::booleanValue();
+ }
+
+ /**
+ * Is the value a boolean?
+ */
+ public static function boolValue()
+ {
+ return \Hamcrest\Type\IsBoolean::booleanValue();
+ }
+
+ /**
+ * Is the value callable?
+ */
+ public static function callableValue()
+ {
+ return \Hamcrest\Type\IsCallable::callableValue();
+ }
+
+ /**
+ * Is the value a float/double?
+ */
+ public static function doubleValue()
+ {
+ return \Hamcrest\Type\IsDouble::doubleValue();
+ }
+
+ /**
+ * Is the value a float/double?
+ */
+ public static function floatValue()
+ {
+ return \Hamcrest\Type\IsDouble::doubleValue();
+ }
+
+ /**
+ * Is the value an integer?
+ */
+ public static function integerValue()
+ {
+ return \Hamcrest\Type\IsInteger::integerValue();
+ }
+
+ /**
+ * Is the value an integer?
+ */
+ public static function intValue()
+ {
+ return \Hamcrest\Type\IsInteger::integerValue();
+ }
+
+ /**
+ * Is the value a numeric?
+ */
+ public static function numericValue()
+ {
+ return \Hamcrest\Type\IsNumeric::numericValue();
+ }
+
+ /**
+ * Is the value an object?
+ */
+ public static function objectValue()
+ {
+ return \Hamcrest\Type\IsObject::objectValue();
+ }
+
+ /**
+ * Is the value an object?
+ */
+ public static function anObject()
+ {
+ return \Hamcrest\Type\IsObject::objectValue();
+ }
+
+ /**
+ * Is the value a resource?
+ */
+ public static function resourceValue()
+ {
+ return \Hamcrest\Type\IsResource::resourceValue();
+ }
+
+ /**
+ * Is the value a scalar (boolean, integer, double, or string)?
+ */
+ public static function scalarValue()
+ {
+ return \Hamcrest\Type\IsScalar::scalarValue();
+ }
+
+ /**
+ * Is the value a string?
+ */
+ public static function stringValue()
+ {
+ return \Hamcrest\Type\IsString::stringValue();
+ }
+
+ /**
+ * Wraps $matcher with {@link Hamcrest\Core\IsEqual)
+ * if it's not a matcher and the XPath in count()
+ * if it's an integer.
+ */
+ public static function hasXPath($xpath, $matcher = null)
+ {
+ return \Hamcrest\Xml\HasXPath::hasXPath($xpath, $matcher);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php
new file mode 100644
index 000000000..aae8e4616
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php
@@ -0,0 +1,43 @@
+_value = $value;
+ $this->_delta = $delta;
+ }
+
+ protected function matchesSafely($item)
+ {
+ return $this->_actualDelta($item) <= 0.0;
+ }
+
+ protected function describeMismatchSafely($item, Description $mismatchDescription)
+ {
+ $mismatchDescription->appendValue($item)
+ ->appendText(' differed by ')
+ ->appendValue($this->_actualDelta($item))
+ ;
+ }
+
+ public function describeTo(Description $description)
+ {
+ $description->appendText('a numeric value within ')
+ ->appendValue($this->_delta)
+ ->appendText(' of ')
+ ->appendValue($this->_value)
+ ;
+ }
+
+ /**
+ * Matches if value is a number equal to $value within some range of
+ * acceptable error $delta.
+ *
+ * @factory
+ */
+ public static function closeTo($value, $delta)
+ {
+ return new self($value, $delta);
+ }
+
+ // -- Private Methods
+
+ private function _actualDelta($item)
+ {
+ return (abs(($item - $this->_value)) - $this->_delta);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php
new file mode 100644
index 000000000..369d0cfa5
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php
@@ -0,0 +1,132 @@
+_value = $value;
+ $this->_minCompare = $minCompare;
+ $this->_maxCompare = $maxCompare;
+ }
+
+ protected function matchesSafely($other)
+ {
+ $compare = $this->_compare($this->_value, $other);
+
+ return ($this->_minCompare <= $compare) && ($compare <= $this->_maxCompare);
+ }
+
+ protected function describeMismatchSafely($item, Description $mismatchDescription)
+ {
+ $mismatchDescription
+ ->appendValue($item)->appendText(' was ')
+ ->appendText($this->_comparison($this->_compare($this->_value, $item)))
+ ->appendText(' ')->appendValue($this->_value)
+ ;
+ }
+
+ public function describeTo(Description $description)
+ {
+ $description->appendText('a value ')
+ ->appendText($this->_comparison($this->_minCompare))
+ ;
+ if ($this->_minCompare != $this->_maxCompare) {
+ $description->appendText(' or ')
+ ->appendText($this->_comparison($this->_maxCompare))
+ ;
+ }
+ $description->appendText(' ')->appendValue($this->_value);
+ }
+
+ /**
+ * The value is not > $value, nor < $value.
+ *
+ * @factory
+ */
+ public static function comparesEqualTo($value)
+ {
+ return new self($value, 0, 0);
+ }
+
+ /**
+ * The value is > $value.
+ *
+ * @factory
+ */
+ public static function greaterThan($value)
+ {
+ return new self($value, -1, -1);
+ }
+
+ /**
+ * The value is >= $value.
+ *
+ * @factory atLeast
+ */
+ public static function greaterThanOrEqualTo($value)
+ {
+ return new self($value, -1, 0);
+ }
+
+ /**
+ * The value is < $value.
+ *
+ * @factory
+ */
+ public static function lessThan($value)
+ {
+ return new self($value, 1, 1);
+ }
+
+ /**
+ * The value is <= $value.
+ *
+ * @factory atMost
+ */
+ public static function lessThanOrEqualTo($value)
+ {
+ return new self($value, 0, 1);
+ }
+
+ // -- Private Methods
+
+ private function _compare($left, $right)
+ {
+ $a = $left;
+ $b = $right;
+
+ if ($a < $b) {
+ return -1;
+ } elseif ($a == $b) {
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+
+ private function _comparison($compare)
+ {
+ if ($compare > 0) {
+ return 'less than';
+ } elseif ($compare == 0) {
+ return 'equal to';
+ } else {
+ return 'greater than';
+ }
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php
new file mode 100644
index 000000000..872fdf9c5
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php
@@ -0,0 +1,23 @@
+_out = (string) $out;
+ }
+
+ public function __toString()
+ {
+ return $this->_out;
+ }
+
+ /**
+ * Return the description of a {@link Hamcrest\SelfDescribing} object as a
+ * String.
+ *
+ * @param \Hamcrest\SelfDescribing $selfDescribing
+ * The object to be described.
+ *
+ * @return string
+ * The description of the object.
+ */
+ public static function toString(SelfDescribing $selfDescribing)
+ {
+ $self = new self();
+
+ return (string) $self->appendDescriptionOf($selfDescribing);
+ }
+
+ /**
+ * Alias for {@link toString()}.
+ */
+ public static function asString(SelfDescribing $selfDescribing)
+ {
+ return self::toString($selfDescribing);
+ }
+
+ // -- Protected Methods
+
+ protected function append($str)
+ {
+ $this->_out .= $str;
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php
new file mode 100644
index 000000000..2ae61b96c
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php
@@ -0,0 +1,85 @@
+_empty = $empty;
+ }
+
+ public function matches($item)
+ {
+ return $this->_empty
+ ? ($item === '')
+ : is_string($item) && $item !== '';
+ }
+
+ public function describeTo(Description $description)
+ {
+ $description->appendText($this->_empty ? 'an empty string' : 'a non-empty string');
+ }
+
+ /**
+ * Matches if value is a zero-length string.
+ *
+ * @factory emptyString
+ */
+ public static function isEmptyString()
+ {
+ if (!self::$_INSTANCE) {
+ self::$_INSTANCE = new self(true);
+ }
+
+ return self::$_INSTANCE;
+ }
+
+ /**
+ * Matches if value is null or a zero-length string.
+ *
+ * @factory nullOrEmptyString
+ */
+ public static function isEmptyOrNullString()
+ {
+ if (!self::$_NULL_OR_EMPTY_INSTANCE) {
+ self::$_NULL_OR_EMPTY_INSTANCE = AnyOf::anyOf(
+ IsNull::nullvalue(),
+ self::isEmptyString()
+ );
+ }
+
+ return self::$_NULL_OR_EMPTY_INSTANCE;
+ }
+
+ /**
+ * Matches if value is a non-zero-length string.
+ *
+ * @factory nonEmptyString
+ */
+ public static function isNonEmptyString()
+ {
+ if (!self::$_NOT_INSTANCE) {
+ self::$_NOT_INSTANCE = new self(false);
+ }
+
+ return self::$_NOT_INSTANCE;
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php
new file mode 100644
index 000000000..3836a8c37
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php
@@ -0,0 +1,52 @@
+_string = $string;
+ }
+
+ protected function matchesSafely($item)
+ {
+ return strtolower($this->_string) === strtolower($item);
+ }
+
+ protected function describeMismatchSafely($item, Description $mismatchDescription)
+ {
+ $mismatchDescription->appendText('was ')->appendText($item);
+ }
+
+ public function describeTo(Description $description)
+ {
+ $description->appendText('equalToIgnoringCase(')
+ ->appendValue($this->_string)
+ ->appendText(')')
+ ;
+ }
+
+ /**
+ * Matches if value is a string equal to $string, regardless of the case.
+ *
+ * @factory
+ */
+ public static function equalToIgnoringCase($string)
+ {
+ return new self($string);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php
new file mode 100644
index 000000000..853692b03
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php
@@ -0,0 +1,66 @@
+_string = $string;
+ }
+
+ protected function matchesSafely($item)
+ {
+ return (strtolower($this->_stripSpace($item))
+ === strtolower($this->_stripSpace($this->_string)));
+ }
+
+ protected function describeMismatchSafely($item, Description $mismatchDescription)
+ {
+ $mismatchDescription->appendText('was ')->appendText($item);
+ }
+
+ public function describeTo(Description $description)
+ {
+ $description->appendText('equalToIgnoringWhiteSpace(')
+ ->appendValue($this->_string)
+ ->appendText(')')
+ ;
+ }
+
+ /**
+ * Matches if value is a string equal to $string, regardless of whitespace.
+ *
+ * @factory
+ */
+ public static function equalToIgnoringWhiteSpace($string)
+ {
+ return new self($string);
+ }
+
+ // -- Private Methods
+
+ private function _stripSpace($string)
+ {
+ $parts = preg_split("/[\r\n\t ]+/", $string);
+ foreach ($parts as $i => $part) {
+ $parts[$i] = trim($part, " \r\n\t");
+ }
+
+ return trim(implode(' ', $parts), " \r\n\t");
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php
new file mode 100644
index 000000000..fa0d68eea
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php
@@ -0,0 +1,40 @@
+_substring, (string) $item) >= 1;
+ }
+
+ protected function relationship()
+ {
+ return 'matching';
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php
new file mode 100644
index 000000000..b92786b60
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php
@@ -0,0 +1,45 @@
+_substring);
+ }
+
+ /**
+ * Matches if value is a string that contains $substring.
+ *
+ * @factory
+ */
+ public static function containsString($substring)
+ {
+ return new self($substring);
+ }
+
+ // -- Protected Methods
+
+ protected function evalSubstringOf($item)
+ {
+ return (false !== strpos((string) $item, $this->_substring));
+ }
+
+ protected function relationship()
+ {
+ return 'containing';
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php
new file mode 100644
index 000000000..69f37c258
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php
@@ -0,0 +1,40 @@
+_substring));
+ }
+
+ protected function relationship()
+ {
+ return 'containing in any case';
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php
new file mode 100644
index 000000000..e75de65d2
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php
@@ -0,0 +1,66 @@
+_substrings = $substrings;
+ }
+
+ protected function matchesSafely($item)
+ {
+ $fromIndex = 0;
+
+ foreach ($this->_substrings as $substring) {
+ if (false === $fromIndex = strpos($item, $substring, $fromIndex)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ protected function describeMismatchSafely($item, Description $mismatchDescription)
+ {
+ $mismatchDescription->appendText('was ')->appendText($item);
+ }
+
+ public function describeTo(Description $description)
+ {
+ $description->appendText('a string containing ')
+ ->appendValueList('', ', ', '', $this->_substrings)
+ ->appendText(' in order')
+ ;
+ }
+
+ /**
+ * Matches if value contains $substrings in a constrained order.
+ *
+ * @factory ...
+ */
+ public static function stringContainsInOrder(/* args... */)
+ {
+ $args = func_get_args();
+
+ if (isset($args[0]) && is_array($args[0])) {
+ $args = $args[0];
+ }
+
+ return new self($args);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php
new file mode 100644
index 000000000..f802ee4d1
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php
@@ -0,0 +1,40 @@
+_substring))) === $this->_substring);
+ }
+
+ protected function relationship()
+ {
+ return 'ending with';
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php
new file mode 100644
index 000000000..79c95656a
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php
@@ -0,0 +1,40 @@
+_substring)) === $this->_substring);
+ }
+
+ protected function relationship()
+ {
+ return 'starting with';
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php
new file mode 100644
index 000000000..e560ad627
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php
@@ -0,0 +1,45 @@
+_substring = $substring;
+ }
+
+ protected function matchesSafely($item)
+ {
+ return $this->evalSubstringOf($item);
+ }
+
+ protected function describeMismatchSafely($item, Description $mismatchDescription)
+ {
+ $mismatchDescription->appendText('was "')->appendText($item)->appendText('"');
+ }
+
+ public function describeTo(Description $description)
+ {
+ $description->appendText('a string ')
+ ->appendText($this->relationship())
+ ->appendText(' ')
+ ->appendValue($this->_substring)
+ ;
+ }
+
+ abstract protected function evalSubstringOf($string);
+
+ abstract protected function relationship();
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php
new file mode 100644
index 000000000..9179102ff
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php
@@ -0,0 +1,32 @@
+isHexadecimal($item)) {
+ return true;
+ }
+
+ return is_numeric($item);
+ }
+
+ /**
+ * Return if the string passed is a valid hexadecimal number.
+ * This check is necessary because PHP 7 doesn't recognize hexadecimal string as numeric anymore.
+ *
+ * @param mixed $item
+ * @return boolean
+ */
+ private function isHexadecimal($item)
+ {
+ if (is_string($item) && preg_match('/^0x(.*)$/', $item, $matches)) {
+ return ctype_xdigit($matches[1]);
+ }
+
+ return false;
+ }
+
+ /**
+ * Is the value a numeric?
+ *
+ * @factory
+ */
+ public static function numericValue()
+ {
+ return new self;
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php
new file mode 100644
index 000000000..65918fcf3
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php
@@ -0,0 +1,32 @@
+matchesSafelyWithDiagnosticDescription($item, new NullDescription());
+ }
+
+ final public function describeMismatchSafely($item, Description $mismatchDescription)
+ {
+ $this->matchesSafelyWithDiagnosticDescription($item, $mismatchDescription);
+ }
+
+ // -- Protected Methods
+
+ /**
+ * Subclasses should implement these. The item will already have been checked for
+ * the specific type.
+ */
+ abstract protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription);
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php
new file mode 100644
index 000000000..56e299a9a
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php
@@ -0,0 +1,107 @@
+_expectedType = $expectedType;
+ $this->_expectedSubtype = $expectedSubtype;
+ }
+
+ final public function matches($item)
+ {
+ return $this->_isSafeType($item) && $this->matchesSafely($item);
+ }
+
+ final public function describeMismatch($item, Description $mismatchDescription)
+ {
+ if (!$this->_isSafeType($item)) {
+ parent::describeMismatch($item, $mismatchDescription);
+ } else {
+ $this->describeMismatchSafely($item, $mismatchDescription);
+ }
+ }
+
+ // -- Protected Methods
+
+ /**
+ * The item will already have been checked for the specific type and subtype.
+ */
+ abstract protected function matchesSafely($item);
+
+ /**
+ * The item will already have been checked for the specific type and subtype.
+ */
+ abstract protected function describeMismatchSafely($item, Description $mismatchDescription);
+
+ // -- Private Methods
+
+ private function _isSafeType($value)
+ {
+ switch ($this->_expectedType) {
+
+ case self::TYPE_ANY:
+ return true;
+
+ case self::TYPE_STRING:
+ return is_string($value) || is_numeric($value);
+
+ case self::TYPE_NUMERIC:
+ return is_numeric($value) || is_string($value);
+
+ case self::TYPE_ARRAY:
+ return is_array($value);
+
+ case self::TYPE_OBJECT:
+ return is_object($value)
+ && ($this->_expectedSubtype === null
+ || $value instanceof $this->_expectedSubtype);
+
+ case self::TYPE_RESOURCE:
+ return is_resource($value)
+ && ($this->_expectedSubtype === null
+ || get_resource_type($value) == $this->_expectedSubtype);
+
+ case self::TYPE_BOOLEAN:
+ return true;
+
+ default:
+ return true;
+
+ }
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php
new file mode 100644
index 000000000..169b03663
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php
@@ -0,0 +1,76 @@
+ all items are
+ */
+ public static function createMatcherArray(array $items)
+ {
+ //Extract single array item
+ if (count($items) == 1 && is_array($items[0])) {
+ $items = $items[0];
+ }
+
+ //Replace non-matchers
+ foreach ($items as &$item) {
+ if (!($item instanceof Matcher)) {
+ $item = Core\IsEqual::equalTo($item);
+ }
+ }
+
+ return $items;
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php
new file mode 100644
index 000000000..d9764e45f
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php
@@ -0,0 +1,195 @@
+_xpath = $xpath;
+ $this->_matcher = $matcher;
+ }
+
+ /**
+ * Matches if the XPath matches against the DOM node and the matcher.
+ *
+ * @param string|\DOMNode $actual
+ * @param Description $mismatchDescription
+ * @return bool
+ */
+ protected function matchesWithDiagnosticDescription($actual, Description $mismatchDescription)
+ {
+ if (is_string($actual)) {
+ $actual = $this->createDocument($actual);
+ } elseif (!$actual instanceof \DOMNode) {
+ $mismatchDescription->appendText('was ')->appendValue($actual);
+
+ return false;
+ }
+ $result = $this->evaluate($actual);
+ if ($result instanceof \DOMNodeList) {
+ return $this->matchesContent($result, $mismatchDescription);
+ } else {
+ return $this->matchesExpression($result, $mismatchDescription);
+ }
+ }
+
+ /**
+ * Creates and returns a DOMDocument from the given
+ * XML or HTML string.
+ *
+ * @param string $text
+ * @return \DOMDocument built from $text
+ * @throws \InvalidArgumentException if the document is not valid
+ */
+ protected function createDocument($text)
+ {
+ $document = new \DOMDocument();
+ if (preg_match('/^\s*<\?xml/', $text)) {
+ if (!@$document->loadXML($text)) {
+ throw new \InvalidArgumentException('Must pass a valid XML document');
+ }
+ } else {
+ if (!@$document->loadHTML($text)) {
+ throw new \InvalidArgumentException('Must pass a valid HTML or XHTML document');
+ }
+ }
+
+ return $document;
+ }
+
+ /**
+ * Applies the configured XPath to the DOM node and returns either
+ * the result if it's an expression or the node list if it's a query.
+ *
+ * @param \DOMNode $node context from which to issue query
+ * @return mixed result of expression or DOMNodeList from query
+ */
+ protected function evaluate(\DOMNode $node)
+ {
+ if ($node instanceof \DOMDocument) {
+ $xpathDocument = new \DOMXPath($node);
+
+ return $xpathDocument->evaluate($this->_xpath);
+ } else {
+ $xpathDocument = new \DOMXPath($node->ownerDocument);
+
+ return $xpathDocument->evaluate($this->_xpath, $node);
+ }
+ }
+
+ /**
+ * Matches if the list of nodes is not empty and the content of at least
+ * one node matches the configured matcher, if supplied.
+ *
+ * @param \DOMNodeList $nodes selected by the XPath query
+ * @param Description $mismatchDescription
+ * @return bool
+ */
+ protected function matchesContent(\DOMNodeList $nodes, Description $mismatchDescription)
+ {
+ if ($nodes->length == 0) {
+ $mismatchDescription->appendText('XPath returned no results');
+ } elseif ($this->_matcher === null) {
+ return true;
+ } else {
+ foreach ($nodes as $node) {
+ if ($this->_matcher->matches($node->textContent)) {
+ return true;
+ }
+ }
+ $content = array();
+ foreach ($nodes as $node) {
+ $content[] = $node->textContent;
+ }
+ $mismatchDescription->appendText('XPath returned ')
+ ->appendValue($content);
+ }
+
+ return false;
+ }
+
+ /**
+ * Matches if the result of the XPath expression matches the configured
+ * matcher or evaluates to true if there is none.
+ *
+ * @param mixed $result result of the XPath expression
+ * @param Description $mismatchDescription
+ * @return bool
+ */
+ protected function matchesExpression($result, Description $mismatchDescription)
+ {
+ if ($this->_matcher === null) {
+ if ($result) {
+ return true;
+ }
+ $mismatchDescription->appendText('XPath expression result was ')
+ ->appendValue($result);
+ } else {
+ if ($this->_matcher->matches($result)) {
+ return true;
+ }
+ $mismatchDescription->appendText('XPath expression result ');
+ $this->_matcher->describeMismatch($result, $mismatchDescription);
+ }
+
+ return false;
+ }
+
+ public function describeTo(Description $description)
+ {
+ $description->appendText('XML or HTML document with XPath "')
+ ->appendText($this->_xpath)
+ ->appendText('"');
+ if ($this->_matcher !== null) {
+ $description->appendText(' ');
+ $this->_matcher->describeTo($description);
+ }
+ }
+
+ /**
+ * Wraps $matcher with {@link Hamcrest\Core\IsEqual)
+ * if it's not a matcher and the XPath in count()
+ * if it's an integer.
+ *
+ * @factory
+ */
+ public static function hasXPath($xpath, $matcher = null)
+ {
+ if ($matcher === null || $matcher instanceof Matcher) {
+ return new self($xpath, $matcher);
+ } elseif (is_int($matcher) && strpos($xpath, 'count(') !== 0) {
+ $xpath = 'count(' . $xpath . ')';
+ }
+
+ return new self($xpath, IsEqual::equalTo($matcher));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php
new file mode 100644
index 000000000..6c52c0e5d
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php
@@ -0,0 +1,66 @@
+assertTrue($matcher->matches($arg), $message);
+ }
+
+ public function assertDoesNotMatch(\Hamcrest\Matcher $matcher, $arg, $message)
+ {
+ $this->assertFalse($matcher->matches($arg), $message);
+ }
+
+ public function assertDescription($expected, \Hamcrest\Matcher $matcher)
+ {
+ $description = new \Hamcrest\StringDescription();
+ $description->appendDescriptionOf($matcher);
+ $this->assertEquals($expected, (string) $description, 'Expected description');
+ }
+
+ public function assertMismatchDescription($expected, \Hamcrest\Matcher $matcher, $arg)
+ {
+ $description = new \Hamcrest\StringDescription();
+ $this->assertFalse(
+ $matcher->matches($arg),
+ 'Precondtion: Matcher should not match item'
+ );
+ $matcher->describeMismatch($arg, $description);
+ $this->assertEquals(
+ $expected,
+ (string) $description,
+ 'Expected mismatch description'
+ );
+ }
+
+ public function testIsNullSafe()
+ {
+ //Should not generate any notices
+ $this->createMatcher()->matches(null);
+ $this->createMatcher()->describeMismatch(
+ null,
+ new \Hamcrest\NullDescription()
+ );
+ }
+
+ public function testCopesWithUnknownTypes()
+ {
+ //Should not generate any notices
+ $this->createMatcher()->matches(new UnknownType());
+ $this->createMatcher()->describeMismatch(
+ new UnknownType(),
+ new NullDescription()
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php
new file mode 100644
index 000000000..45d9f138a
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php
@@ -0,0 +1,54 @@
+assertDescription('[<1>, <2>] in any order', containsInAnyOrder(array(1, 2)));
+ }
+
+ public function testMatchesItemsInAnyOrder()
+ {
+ $this->assertMatches(containsInAnyOrder(array(1, 2, 3)), array(1, 2, 3), 'in order');
+ $this->assertMatches(containsInAnyOrder(array(1, 2, 3)), array(3, 2, 1), 'out of order');
+ $this->assertMatches(containsInAnyOrder(array(1)), array(1), 'single');
+ }
+
+ public function testAppliesMatchersInAnyOrder()
+ {
+ $this->assertMatches(
+ containsInAnyOrder(array(1, 2, 3)),
+ array(1, 2, 3),
+ 'in order'
+ );
+ $this->assertMatches(
+ containsInAnyOrder(array(1, 2, 3)),
+ array(3, 2, 1),
+ 'out of order'
+ );
+ $this->assertMatches(
+ containsInAnyOrder(array(1)),
+ array(1),
+ 'single'
+ );
+ }
+
+ public function testMismatchesItemsInAnyOrder()
+ {
+ $matcher = containsInAnyOrder(array(1, 2, 3));
+
+ $this->assertMismatchDescription('was null', $matcher, null);
+ $this->assertMismatchDescription('No item matches: <1>, <2>, <3> in []', $matcher, array());
+ $this->assertMismatchDescription('No item matches: <2>, <3> in [<1>]', $matcher, array(1));
+ $this->assertMismatchDescription('Not matched: <4>', $matcher, array(4, 3, 2, 1));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php
new file mode 100644
index 000000000..1868343fa
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php
@@ -0,0 +1,44 @@
+assertDescription('[<1>, <2>]', arrayContaining(array(1, 2)));
+ }
+
+ public function testMatchesItemsInOrder()
+ {
+ $this->assertMatches(arrayContaining(array(1, 2, 3)), array(1, 2, 3), 'in order');
+ $this->assertMatches(arrayContaining(array(1)), array(1), 'single');
+ }
+
+ public function testAppliesMatchersInOrder()
+ {
+ $this->assertMatches(
+ arrayContaining(array(1, 2, 3)),
+ array(1, 2, 3),
+ 'in order'
+ );
+ $this->assertMatches(arrayContaining(array(1)), array(1), 'single');
+ }
+
+ public function testMismatchesItemsInAnyOrder()
+ {
+ $matcher = arrayContaining(array(1, 2, 3));
+ $this->assertMismatchDescription('was null', $matcher, null);
+ $this->assertMismatchDescription('No item matched: <1>', $matcher, array());
+ $this->assertMismatchDescription('No item matched: <2>', $matcher, array(1));
+ $this->assertMismatchDescription('item with key 0: was <4>', $matcher, array(4, 3, 2, 1));
+ $this->assertMismatchDescription('item with key 2: was <4>', $matcher, array(1, 2, 4));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php
new file mode 100644
index 000000000..31770d8dd
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php
@@ -0,0 +1,62 @@
+1);
+
+ $this->assertMatches(hasKey('a'), $array, 'Matches single key');
+ }
+
+ public function testMatchesArrayContainingKey()
+ {
+ $array = array('a'=>1, 'b'=>2, 'c'=>3);
+
+ $this->assertMatches(hasKey('a'), $array, 'Matches a');
+ $this->assertMatches(hasKey('c'), $array, 'Matches c');
+ }
+
+ public function testMatchesArrayContainingKeyWithIntegerKeys()
+ {
+ $array = array(1=>'A', 2=>'B');
+
+ assertThat($array, hasKey(1));
+ }
+
+ public function testMatchesArrayContainingKeyWithNumberKeys()
+ {
+ $array = array(1=>'A', 2=>'B');
+
+ assertThat($array, hasKey(1));
+
+ // very ugly version!
+ assertThat($array, IsArrayContainingKey::hasKeyInArray(2));
+ }
+
+ public function testHasReadableDescription()
+ {
+ $this->assertDescription('array with key "a"', hasKey('a'));
+ }
+
+ public function testDoesNotMatchEmptyArray()
+ {
+ $this->assertMismatchDescription('array was []', hasKey('Foo'), array());
+ }
+
+ public function testDoesNotMatchArrayMissingKey()
+ {
+ $array = array('a'=>1, 'b'=>2, 'c'=>3);
+
+ $this->assertMismatchDescription('array was ["a" => <1>, "b" => <2>, "c" => <3>]', hasKey('d'), $array);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php
new file mode 100644
index 000000000..a415f9f7a
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php
@@ -0,0 +1,36 @@
+1, 'b'=>2);
+
+ $this->assertMatches(hasKeyValuePair(equalTo('a'), equalTo(1)), $array, 'matcherA');
+ $this->assertMatches(hasKeyValuePair(equalTo('b'), equalTo(2)), $array, 'matcherB');
+ $this->assertMismatchDescription(
+ 'array was ["a" => <1>, "b" => <2>]',
+ hasKeyValuePair(equalTo('c'), equalTo(3)),
+ $array
+ );
+ }
+
+ public function testDoesNotMatchNull()
+ {
+ $this->assertMismatchDescription('was null', hasKeyValuePair(anything(), anything()), null);
+ }
+
+ public function testHasReadableDescription()
+ {
+ $this->assertDescription('array containing ["a" => <2>]', hasKeyValuePair(equalTo('a'), equalTo(2)));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php
new file mode 100644
index 000000000..8d5bd8109
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php
@@ -0,0 +1,50 @@
+assertMatches(
+ hasItemInArray('a'),
+ array('a', 'b', 'c'),
+ "should matches array that contains 'a'"
+ );
+ }
+
+ public function testDoesNotMatchAnArrayThatDoesntContainAnElementMatchingTheGivenMatcher()
+ {
+ $this->assertDoesNotMatch(
+ hasItemInArray('a'),
+ array('b', 'c'),
+ "should not matches array that doesn't contain 'a'"
+ );
+ $this->assertDoesNotMatch(
+ hasItemInArray('a'),
+ array(),
+ 'should not match empty array'
+ );
+ }
+
+ public function testDoesNotMatchNull()
+ {
+ $this->assertDoesNotMatch(
+ hasItemInArray('a'),
+ null,
+ 'should not match null'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription('an array containing "a"', hasItemInArray('a'));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php
new file mode 100644
index 000000000..e4db53e79
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php
@@ -0,0 +1,89 @@
+assertMatches(
+ anArray(array(equalTo('a'), equalTo('b'), equalTo('c'))),
+ array('a', 'b', 'c'),
+ 'should match array with matching elements'
+ );
+ }
+
+ public function testDoesNotMatchAnArrayWhenElementsDoNotMatch()
+ {
+ $this->assertDoesNotMatch(
+ anArray(array(equalTo('a'), equalTo('b'))),
+ array('b', 'c'),
+ 'should not match array with different elements'
+ );
+ }
+
+ public function testDoesNotMatchAnArrayOfDifferentSize()
+ {
+ $this->assertDoesNotMatch(
+ anArray(array(equalTo('a'), equalTo('b'))),
+ array('a', 'b', 'c'),
+ 'should not match larger array'
+ );
+ $this->assertDoesNotMatch(
+ anArray(array(equalTo('a'), equalTo('b'))),
+ array('a'),
+ 'should not match smaller array'
+ );
+ }
+
+ public function testDoesNotMatchNull()
+ {
+ $this->assertDoesNotMatch(
+ anArray(array(equalTo('a'))),
+ null,
+ 'should not match null'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription(
+ '["a", "b"]',
+ anArray(array(equalTo('a'), equalTo('b')))
+ );
+ }
+
+ public function testHasAReadableMismatchDescriptionWhenKeysDontMatch()
+ {
+ $this->assertMismatchDescription(
+ 'array keys were [<1>, <2>]',
+ anArray(array(equalTo('a'), equalTo('b'))),
+ array(1 => 'a', 2 => 'b')
+ );
+ }
+
+ public function testSupportsMatchesAssociativeArrays()
+ {
+ $this->assertMatches(
+ anArray(array('x'=>equalTo('a'), 'y'=>equalTo('b'), 'z'=>equalTo('c'))),
+ array('x'=>'a', 'y'=>'b', 'z'=>'c'),
+ 'should match associative array with matching elements'
+ );
+ }
+
+ public function testDoesNotMatchAnAssociativeArrayWhenKeysDoNotMatch()
+ {
+ $this->assertDoesNotMatch(
+ anArray(array('x'=>equalTo('a'), 'y'=>equalTo('b'))),
+ array('x'=>'b', 'z'=>'c'),
+ 'should not match array with different keys'
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php
new file mode 100644
index 000000000..8413c896d
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php
@@ -0,0 +1,37 @@
+assertMatches(arrayWithSize(equalTo(3)), array(1, 2, 3), 'correct size');
+ $this->assertDoesNotMatch(arrayWithSize(equalTo(2)), array(1, 2, 3), 'incorrect size');
+ }
+
+ public function testProvidesConvenientShortcutForArrayWithSizeEqualTo()
+ {
+ $this->assertMatches(arrayWithSize(3), array(1, 2, 3), 'correct size');
+ $this->assertDoesNotMatch(arrayWithSize(2), array(1, 2, 3), 'incorrect size');
+ }
+
+ public function testEmptyArray()
+ {
+ $this->assertMatches(emptyArray(), array(), 'correct size');
+ $this->assertDoesNotMatch(emptyArray(), array(1), 'incorrect size');
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription('an array with size <3>', arrayWithSize(equalTo(3)));
+ $this->assertDescription('an empty array', emptyArray());
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php
new file mode 100644
index 000000000..833e2c3ec
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php
@@ -0,0 +1,23 @@
+appendText('SOME DESCRIPTION');
+ }
+
+ public function testDescribesItselfWithToStringMethod()
+ {
+ $someMatcher = new \Hamcrest\SomeMatcher();
+ $this->assertEquals('SOME DESCRIPTION', (string) $someMatcher);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php
new file mode 100644
index 000000000..2f15fb499
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php
@@ -0,0 +1,77 @@
+assertMatches(
+ emptyTraversable(),
+ new \ArrayObject(array()),
+ 'an empty traversable'
+ );
+ }
+
+ public function testEmptyMatcherDoesNotMatchWhenNotEmpty()
+ {
+ $this->assertDoesNotMatch(
+ emptyTraversable(),
+ new \ArrayObject(array(1, 2, 3)),
+ 'a non-empty traversable'
+ );
+ }
+
+ public function testEmptyMatcherDoesNotMatchNull()
+ {
+ $this->assertDoesNotMatch(
+ emptyTraversable(),
+ null,
+ 'should not match null'
+ );
+ }
+
+ public function testEmptyMatcherHasAReadableDescription()
+ {
+ $this->assertDescription('an empty traversable', emptyTraversable());
+ }
+
+ public function testNonEmptyDoesNotMatchNull()
+ {
+ $this->assertDoesNotMatch(
+ nonEmptyTraversable(),
+ null,
+ 'should not match null'
+ );
+ }
+
+ public function testNonEmptyDoesNotMatchWhenEmpty()
+ {
+ $this->assertDoesNotMatch(
+ nonEmptyTraversable(),
+ new \ArrayObject(array()),
+ 'an empty traversable'
+ );
+ }
+
+ public function testNonEmptyMatchesWhenNotEmpty()
+ {
+ $this->assertMatches(
+ nonEmptyTraversable(),
+ new \ArrayObject(array(1, 2, 3)),
+ 'a non-empty traversable'
+ );
+ }
+
+ public function testNonEmptyNonEmptyMatcherHasAReadableDescription()
+ {
+ $this->assertDescription('a non-empty traversable', nonEmptyTraversable());
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php
new file mode 100644
index 000000000..c1c67a7a4
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php
@@ -0,0 +1,57 @@
+assertMatches(
+ traversableWithSize(equalTo(3)),
+ new \ArrayObject(array(1, 2, 3)),
+ 'correct size'
+ );
+ }
+
+ public function testDoesNotMatchWhenSizeIsIncorrect()
+ {
+ $this->assertDoesNotMatch(
+ traversableWithSize(equalTo(2)),
+ new \ArrayObject(array(1, 2, 3)),
+ 'incorrect size'
+ );
+ }
+
+ public function testDoesNotMatchNull()
+ {
+ $this->assertDoesNotMatch(
+ traversableWithSize(3),
+ null,
+ 'should not match null'
+ );
+ }
+
+ public function testProvidesConvenientShortcutForTraversableWithSizeEqualTo()
+ {
+ $this->assertMatches(
+ traversableWithSize(3),
+ new \ArrayObject(array(1, 2, 3)),
+ 'correct size'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription(
+ 'a traversable with size <3>',
+ traversableWithSize(equalTo(3))
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php
new file mode 100644
index 000000000..86b8c277f
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php
@@ -0,0 +1,56 @@
+assertDescription(
+ '("good" and "bad" and "ugly")',
+ allOf('good', 'bad', 'ugly')
+ );
+ }
+
+ public function testMismatchDescriptionDescribesFirstFailingMatch()
+ {
+ $this->assertMismatchDescription(
+ '"good" was "bad"',
+ allOf('bad', 'good'),
+ 'bad'
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php
new file mode 100644
index 000000000..3d62b9350
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php
@@ -0,0 +1,79 @@
+assertDescription(
+ '("good" or "bad" or "ugly")',
+ anyOf('good', 'bad', 'ugly')
+ );
+ }
+
+ public function testNoneOfEvaluatesToTheLogicalDisjunctionOfTwoOtherMatchers()
+ {
+ assertThat('good', not(noneOf('bad', 'good')));
+ assertThat('good', not(noneOf('good', 'good')));
+ assertThat('good', not(noneOf('good', 'bad')));
+
+ assertThat('good', noneOf('bad', startsWith('b')));
+ }
+
+ public function testNoneOfEvaluatesToTheLogicalDisjunctionOfManyOtherMatchers()
+ {
+ assertThat('good', not(noneOf('bad', 'good', 'bad', 'bad', 'bad')));
+ assertThat('good', noneOf('bad', 'bad', 'bad', 'bad', 'bad'));
+ }
+
+ public function testNoneOfSupportsMixedTypes()
+ {
+ $combined = noneOf(
+ equalTo(new \Hamcrest\Core\SampleBaseClass('good')),
+ equalTo(new \Hamcrest\Core\SampleBaseClass('ugly')),
+ equalTo(new \Hamcrest\Core\SampleSubClass('good'))
+ );
+
+ assertThat(new \Hamcrest\Core\SampleSubClass('bad'), $combined);
+ }
+
+ public function testNoneOfHasAReadableDescription()
+ {
+ $this->assertDescription(
+ 'not ("good" or "bad" or "ugly")',
+ noneOf('good', 'bad', 'ugly')
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php
new file mode 100644
index 000000000..4c2261499
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php
@@ -0,0 +1,59 @@
+_either_3_or_4 = \Hamcrest\Core\CombinableMatcher::either(equalTo(3))->orElse(equalTo(4));
+ $this->_not_3_and_not_4 = \Hamcrest\Core\CombinableMatcher::both(not(equalTo(3)))->andAlso(not(equalTo(4)));
+ }
+
+ protected function createMatcher()
+ {
+ return \Hamcrest\Core\CombinableMatcher::either(equalTo('irrelevant'))->orElse(equalTo('ignored'));
+ }
+
+ public function testBothAcceptsAndRejects()
+ {
+ assertThat(2, $this->_not_3_and_not_4);
+ assertThat(3, not($this->_not_3_and_not_4));
+ }
+
+ public function testAcceptsAndRejectsThreeAnds()
+ {
+ $tripleAnd = $this->_not_3_and_not_4->andAlso(equalTo(2));
+ assertThat(2, $tripleAnd);
+ assertThat(3, not($tripleAnd));
+ }
+
+ public function testBothDescribesItself()
+ {
+ $this->assertEquals('(not <3> and not <4>)', (string) $this->_not_3_and_not_4);
+ $this->assertMismatchDescription('was <3>', $this->_not_3_and_not_4, 3);
+ }
+
+ public function testEitherAcceptsAndRejects()
+ {
+ assertThat(3, $this->_either_3_or_4);
+ assertThat(6, not($this->_either_3_or_4));
+ }
+
+ public function testAcceptsAndRejectsThreeOrs()
+ {
+ $orTriple = $this->_either_3_or_4->orElse(greaterThan(10));
+
+ assertThat(11, $orTriple);
+ assertThat(9, not($orTriple));
+ }
+
+ public function testEitherDescribesItself()
+ {
+ $this->assertEquals('(<3> or <4>)', (string) $this->_either_3_or_4);
+ $this->assertMismatchDescription('was <6>', $this->_either_3_or_4, 6);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php
new file mode 100644
index 000000000..673ab41e1
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php
@@ -0,0 +1,36 @@
+assertDescription('m1 description', $m1);
+ $this->assertDescription('m2 description', $m2);
+ }
+
+ public function testAppendsValuesToDescription()
+ {
+ $m = describedAs('value 1 = %0, value 2 = %1', anything(), 33, 97);
+
+ $this->assertDescription('value 1 = <33>, value 2 = <97>', $m);
+ }
+
+ public function testDelegatesMatchingToAnotherMatcher()
+ {
+ $m1 = describedAs('irrelevant', anything());
+ $m2 = describedAs('irrelevant', not(anything()));
+
+ $this->assertTrue($m1->matches(new \stdClass()));
+ $this->assertFalse($m2->matches('hi'));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php
new file mode 100644
index 000000000..5eb153c5e
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php
@@ -0,0 +1,30 @@
+assertEquals('every item is a string containing "a"', (string) $each);
+
+ $this->assertMismatchDescription('an item was "BbB"', $each, array('BbB'));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php
new file mode 100644
index 000000000..e2e136dcd
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php
@@ -0,0 +1,108 @@
+assertMatches(
+ hasToString(equalTo('php')),
+ new \Hamcrest\Core\PhpForm(),
+ 'correct __toString'
+ );
+ $this->assertMatches(
+ hasToString(equalTo('java')),
+ new \Hamcrest\Core\JavaForm(),
+ 'correct toString'
+ );
+ }
+
+ public function testPicksJavaOverPhpToString()
+ {
+ $this->assertMatches(
+ hasToString(equalTo('java')),
+ new \Hamcrest\Core\BothForms(),
+ 'correct toString'
+ );
+ }
+
+ public function testDoesNotMatchWhenToStringDoesNotMatch()
+ {
+ $this->assertDoesNotMatch(
+ hasToString(equalTo('mismatch')),
+ new \Hamcrest\Core\PhpForm(),
+ 'incorrect __toString'
+ );
+ $this->assertDoesNotMatch(
+ hasToString(equalTo('mismatch')),
+ new \Hamcrest\Core\JavaForm(),
+ 'incorrect toString'
+ );
+ $this->assertDoesNotMatch(
+ hasToString(equalTo('mismatch')),
+ new \Hamcrest\Core\BothForms(),
+ 'incorrect __toString'
+ );
+ }
+
+ public function testDoesNotMatchNull()
+ {
+ $this->assertDoesNotMatch(
+ hasToString(equalTo('a')),
+ null,
+ 'should not match null'
+ );
+ }
+
+ public function testProvidesConvenientShortcutForTraversableWithSizeEqualTo()
+ {
+ $this->assertMatches(
+ hasToString(equalTo('php')),
+ new \Hamcrest\Core\PhpForm(),
+ 'correct __toString'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription(
+ 'an object with toString() "php"',
+ hasToString(equalTo('php'))
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php
new file mode 100644
index 000000000..f68032e53
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php
@@ -0,0 +1,29 @@
+assertDescription('ANYTHING', anything());
+ }
+
+ public function testCanOverrideDescription()
+ {
+ $description = 'description';
+ $this->assertDescription($description, anything($description));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php
new file mode 100644
index 000000000..a3929b543
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php
@@ -0,0 +1,91 @@
+assertMatches(
+ $itemMatcher,
+ array('a', 'b', 'c'),
+ "should match list that contains 'a'"
+ );
+ }
+
+ public function testDoesNotMatchCollectionThatDoesntContainAnElementMatchingTheGivenMatcher()
+ {
+ $matcher1 = hasItem(equalTo('a'));
+ $this->assertDoesNotMatch(
+ $matcher1,
+ array('b', 'c'),
+ "should not match list that doesn't contain 'a'"
+ );
+
+ $matcher2 = hasItem(equalTo('a'));
+ $this->assertDoesNotMatch(
+ $matcher2,
+ array(),
+ 'should not match the empty list'
+ );
+ }
+
+ public function testDoesNotMatchNull()
+ {
+ $this->assertDoesNotMatch(
+ hasItem(equalTo('a')),
+ null,
+ 'should not match null'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription('a collection containing "a"', hasItem(equalTo('a')));
+ }
+
+ public function testMatchesAllItemsInCollection()
+ {
+ $matcher1 = hasItems(equalTo('a'), equalTo('b'), equalTo('c'));
+ $this->assertMatches(
+ $matcher1,
+ array('a', 'b', 'c'),
+ 'should match list containing all items'
+ );
+
+ $matcher2 = hasItems('a', 'b', 'c');
+ $this->assertMatches(
+ $matcher2,
+ array('a', 'b', 'c'),
+ 'should match list containing all items (without matchers)'
+ );
+
+ $matcher3 = hasItems(equalTo('a'), equalTo('b'), equalTo('c'));
+ $this->assertMatches(
+ $matcher3,
+ array('c', 'b', 'a'),
+ 'should match list containing all items in any order'
+ );
+
+ $matcher4 = hasItems(equalTo('a'), equalTo('b'), equalTo('c'));
+ $this->assertMatches(
+ $matcher4,
+ array('e', 'c', 'b', 'a', 'd'),
+ 'should match list containing all items plus others'
+ );
+
+ $matcher5 = hasItems(equalTo('a'), equalTo('b'), equalTo('c'));
+ $this->assertDoesNotMatch(
+ $matcher5,
+ array('e', 'c', 'b', 'd'), // 'a' missing
+ 'should not match list unless it contains all items'
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php
new file mode 100644
index 000000000..73e3ff07e
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php
@@ -0,0 +1,102 @@
+_arg = $arg;
+ }
+
+ public function __toString()
+ {
+ return $this->_arg;
+ }
+}
+
+class IsEqualTest extends \Hamcrest\AbstractMatcherTest
+{
+
+ protected function createMatcher()
+ {
+ return \Hamcrest\Core\IsEqual::equalTo('irrelevant');
+ }
+
+ public function testComparesObjectsUsingEqualityOperator()
+ {
+ assertThat("hi", equalTo("hi"));
+ assertThat("bye", not(equalTo("hi")));
+
+ assertThat(1, equalTo(1));
+ assertThat(1, not(equalTo(2)));
+
+ assertThat("2", equalTo(2));
+ }
+
+ public function testCanCompareNullValues()
+ {
+ assertThat(null, equalTo(null));
+
+ assertThat(null, not(equalTo('hi')));
+ assertThat('hi', not(equalTo(null)));
+ }
+
+ public function testComparesTheElementsOfAnArray()
+ {
+ $s1 = array('a', 'b');
+ $s2 = array('a', 'b');
+ $s3 = array('c', 'd');
+ $s4 = array('a', 'b', 'c', 'd');
+
+ assertThat($s1, equalTo($s1));
+ assertThat($s2, equalTo($s1));
+ assertThat($s3, not(equalTo($s1)));
+ assertThat($s4, not(equalTo($s1)));
+ }
+
+ public function testComparesTheElementsOfAnArrayOfPrimitiveTypes()
+ {
+ $i1 = array(1, 2);
+ $i2 = array(1, 2);
+ $i3 = array(3, 4);
+ $i4 = array(1, 2, 3, 4);
+
+ assertThat($i1, equalTo($i1));
+ assertThat($i2, equalTo($i1));
+ assertThat($i3, not(equalTo($i1)));
+ assertThat($i4, not(equalTo($i1)));
+ }
+
+ public function testRecursivelyTestsElementsOfArrays()
+ {
+ $i1 = array(array(1, 2), array(3, 4));
+ $i2 = array(array(1, 2), array(3, 4));
+ $i3 = array(array(5, 6), array(7, 8));
+ $i4 = array(array(1, 2, 3, 4), array(3, 4));
+
+ assertThat($i1, equalTo($i1));
+ assertThat($i2, equalTo($i1));
+ assertThat($i3, not(equalTo($i1)));
+ assertThat($i4, not(equalTo($i1)));
+ }
+
+ public function testIncludesTheResultOfCallingToStringOnItsArgumentInTheDescription()
+ {
+ $argumentDescription = 'ARGUMENT DESCRIPTION';
+ $argument = new \Hamcrest\Core\DummyToStringClass($argumentDescription);
+ $this->assertDescription('<' . $argumentDescription . '>', equalTo($argument));
+ }
+
+ public function testReturnsAnObviousDescriptionIfCreatedWithANestedMatcherByMistake()
+ {
+ $innerMatcher = equalTo('NestedMatcher');
+ $this->assertDescription('<' . (string) $innerMatcher . '>', equalTo($innerMatcher));
+ }
+
+ public function testReturnsGoodDescriptionIfCreatedWithNullReference()
+ {
+ $this->assertDescription('null', equalTo(null));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php
new file mode 100644
index 000000000..9cc27946c
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php
@@ -0,0 +1,30 @@
+assertDescription('"ARG"', identicalTo('ARG'));
+ }
+
+ public function testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull()
+ {
+ $this->assertDescription('null', identicalTo(null));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php
new file mode 100644
index 000000000..7a5f095a2
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php
@@ -0,0 +1,51 @@
+_baseClassInstance = new \Hamcrest\Core\SampleBaseClass('good');
+ $this->_subClassInstance = new \Hamcrest\Core\SampleSubClass('good');
+ }
+
+ protected function createMatcher()
+ {
+ return \Hamcrest\Core\IsInstanceOf::anInstanceOf('stdClass');
+ }
+
+ public function testEvaluatesToTrueIfArgumentIsInstanceOfASpecificClass()
+ {
+ assertThat($this->_baseClassInstance, anInstanceOf('Hamcrest\Core\SampleBaseClass'));
+ assertThat($this->_subClassInstance, anInstanceOf('Hamcrest\Core\SampleSubClass'));
+ assertThat(null, not(anInstanceOf('Hamcrest\Core\SampleBaseClass')));
+ assertThat(new \stdClass(), not(anInstanceOf('Hamcrest\Core\SampleBaseClass')));
+ }
+
+ public function testEvaluatesToFalseIfArgumentIsNotAnObject()
+ {
+ assertThat(null, not(anInstanceOf('Hamcrest\Core\SampleBaseClass')));
+ assertThat(false, not(anInstanceOf('Hamcrest\Core\SampleBaseClass')));
+ assertThat(5, not(anInstanceOf('Hamcrest\Core\SampleBaseClass')));
+ assertThat('foo', not(anInstanceOf('Hamcrest\Core\SampleBaseClass')));
+ assertThat(array(1, 2, 3), not(anInstanceOf('Hamcrest\Core\SampleBaseClass')));
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription('an instance of stdClass', anInstanceOf('stdClass'));
+ }
+
+ public function testDecribesActualClassInMismatchMessage()
+ {
+ $this->assertMismatchDescription(
+ '[Hamcrest\Core\SampleBaseClass] ',
+ anInstanceOf('Hamcrest\Core\SampleSubClass'),
+ $this->_baseClassInstance
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php
new file mode 100644
index 000000000..09d4a652a
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php
@@ -0,0 +1,31 @@
+assertMatches(not(equalTo('A')), 'B', 'should match');
+ $this->assertDoesNotMatch(not(equalTo('B')), 'B', 'should not match');
+ }
+
+ public function testProvidesConvenientShortcutForNotEqualTo()
+ {
+ $this->assertMatches(not('A'), 'B', 'should match');
+ $this->assertMatches(not('B'), 'A', 'should match');
+ $this->assertDoesNotMatch(not('A'), 'A', 'should not match');
+ $this->assertDoesNotMatch(not('B'), 'B', 'should not match');
+ }
+
+ public function testUsesDescriptionOfNegatedMatcherWithPrefix()
+ {
+ $this->assertDescription('not a value greater than <2>', not(greaterThan(2)));
+ $this->assertDescription('not "A"', not('A'));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php
new file mode 100644
index 000000000..bfa42554d
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php
@@ -0,0 +1,20 @@
+assertDescription('sameInstance("ARG")', sameInstance('ARG'));
+ }
+
+ public function testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull()
+ {
+ $this->assertDescription('sameInstance(null)', sameInstance(null));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php
new file mode 100644
index 000000000..bbd848b9f
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php
@@ -0,0 +1,33 @@
+assertMatches(is(equalTo(true)), true, 'should match');
+ $this->assertMatches(is(equalTo(false)), false, 'should match');
+ $this->assertDoesNotMatch(is(equalTo(true)), false, 'should not match');
+ $this->assertDoesNotMatch(is(equalTo(false)), true, 'should not match');
+ }
+
+ public function testGeneratesIsPrefixInDescription()
+ {
+ $this->assertDescription('is ', is(equalTo(true)));
+ }
+
+ public function testProvidesConvenientShortcutForIsEqualTo()
+ {
+ $this->assertMatches(is('A'), 'A', 'should match');
+ $this->assertMatches(is('B'), 'B', 'should match');
+ $this->assertDoesNotMatch(is('A'), 'B', 'should not match');
+ $this->assertDoesNotMatch(is('B'), 'A', 'should not match');
+ $this->assertDescription('is "A"', is('A'));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php
new file mode 100644
index 000000000..3f48dea70
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php
@@ -0,0 +1,45 @@
+assertDescription('a double', typeOf('double'));
+ $this->assertDescription('an integer', typeOf('integer'));
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', typeOf('boolean'), null);
+ $this->assertMismatchDescription('was an integer <5>', typeOf('float'), 5);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php
new file mode 100644
index 000000000..c953e7cd7
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php
@@ -0,0 +1,18 @@
+_arg = $arg;
+ }
+
+ public function __toString()
+ {
+ return $this->_arg;
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php
new file mode 100644
index 000000000..822f1b641
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php
@@ -0,0 +1,6 @@
+_instanceProperty);
+ }
+
+ protected function createMatcher()
+ {
+ return \Hamcrest\Core\Set::set('property_name');
+ }
+
+ public function testEvaluatesToTrueIfArrayPropertyIsSet()
+ {
+ assertThat(array('foo' => 'bar'), set('foo'));
+ }
+
+ public function testNegatedEvaluatesToFalseIfArrayPropertyIsSet()
+ {
+ assertThat(array('foo' => 'bar'), not(notSet('foo')));
+ }
+
+ public function testEvaluatesToTrueIfClassPropertyIsSet()
+ {
+ self::$_classProperty = 'bar';
+ assertThat('Hamcrest\Core\SetTest', set('_classProperty'));
+ }
+
+ public function testNegatedEvaluatesToFalseIfClassPropertyIsSet()
+ {
+ self::$_classProperty = 'bar';
+ assertThat('Hamcrest\Core\SetTest', not(notSet('_classProperty')));
+ }
+
+ public function testEvaluatesToTrueIfObjectPropertyIsSet()
+ {
+ $this->_instanceProperty = 'bar';
+ assertThat($this, set('_instanceProperty'));
+ }
+
+ public function testNegatedEvaluatesToFalseIfObjectPropertyIsSet()
+ {
+ $this->_instanceProperty = 'bar';
+ assertThat($this, not(notSet('_instanceProperty')));
+ }
+
+ public function testEvaluatesToFalseIfArrayPropertyIsNotSet()
+ {
+ assertThat(array('foo' => 'bar'), not(set('baz')));
+ }
+
+ public function testNegatedEvaluatesToTrueIfArrayPropertyIsNotSet()
+ {
+ assertThat(array('foo' => 'bar'), notSet('baz'));
+ }
+
+ public function testEvaluatesToFalseIfClassPropertyIsNotSet()
+ {
+ assertThat('Hamcrest\Core\SetTest', not(set('_classProperty')));
+ }
+
+ public function testNegatedEvaluatesToTrueIfClassPropertyIsNotSet()
+ {
+ assertThat('Hamcrest\Core\SetTest', notSet('_classProperty'));
+ }
+
+ public function testEvaluatesToFalseIfObjectPropertyIsNotSet()
+ {
+ assertThat($this, not(set('_instanceProperty')));
+ }
+
+ public function testNegatedEvaluatesToTrueIfObjectPropertyIsNotSet()
+ {
+ assertThat($this, notSet('_instanceProperty'));
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription('set property foo', set('foo'));
+ $this->assertDescription('unset property bar', notSet('bar'));
+ }
+
+ public function testDecribesPropertySettingInMismatchMessage()
+ {
+ $this->assertMismatchDescription(
+ 'was not set',
+ set('bar'),
+ array('foo' => 'bar')
+ );
+ $this->assertMismatchDescription(
+ 'was "bar"',
+ notSet('foo'),
+ array('foo' => 'bar')
+ );
+ self::$_classProperty = 'bar';
+ $this->assertMismatchDescription(
+ 'was "bar"',
+ notSet('_classProperty'),
+ 'Hamcrest\Core\SetTest'
+ );
+ $this->_instanceProperty = 'bar';
+ $this->assertMismatchDescription(
+ 'was "bar"',
+ notSet('_instanceProperty'),
+ $this
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php
new file mode 100644
index 000000000..7543294ae
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php
@@ -0,0 +1,73 @@
+_result = $result;
+ }
+ public function getResult()
+ {
+ return $this->_result;
+ }
+}
+
+/* Test-specific subclass only */
+class ResultMatcher extends \Hamcrest\FeatureMatcher
+{
+ public function __construct()
+ {
+ parent::__construct(self::TYPE_ANY, null, equalTo('bar'), 'Thingy with result', 'result');
+ }
+ public function featureValueOf($actual)
+ {
+ if ($actual instanceof \Hamcrest\Thingy) {
+ return $actual->getResult();
+ }
+ }
+}
+
+class FeatureMatcherTest extends \Hamcrest\AbstractMatcherTest
+{
+
+ private $_resultMatcher;
+
+ public function setUp()
+ {
+ $this->_resultMatcher = $this->_resultMatcher();
+ }
+
+ protected function createMatcher()
+ {
+ return $this->_resultMatcher();
+ }
+
+ public function testMatchesPartOfAnObject()
+ {
+ $this->assertMatches($this->_resultMatcher, new \Hamcrest\Thingy('bar'), 'feature');
+ $this->assertDescription('Thingy with result "bar"', $this->_resultMatcher);
+ }
+
+ public function testMismatchesPartOfAnObject()
+ {
+ $this->assertMismatchDescription(
+ 'result was "foo"',
+ $this->_resultMatcher,
+ new \Hamcrest\Thingy('foo')
+ );
+ }
+
+ public function testDoesNotGenerateNoticesForNull()
+ {
+ $this->assertMismatchDescription('result was null', $this->_resultMatcher, null);
+ }
+
+ // -- Creation Methods
+
+ private function _resultMatcher()
+ {
+ return new \Hamcrest\ResultMatcher();
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php
new file mode 100644
index 000000000..218371211
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php
@@ -0,0 +1,190 @@
+getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat(null);
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat('');
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat(0);
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat(0.0);
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat(array());
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('', $ex->getMessage());
+ }
+ self::assertEquals(6, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+
+ public function testAssertThatWithIdentifierAndTrueArgPasses()
+ {
+ \Hamcrest\MatcherAssert::assertThat('identifier', true);
+ \Hamcrest\MatcherAssert::assertThat('identifier', 'non-empty');
+ \Hamcrest\MatcherAssert::assertThat('identifier', 1);
+ \Hamcrest\MatcherAssert::assertThat('identifier', 3.14159);
+ \Hamcrest\MatcherAssert::assertThat('identifier', array(true));
+ self::assertEquals(5, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+
+ public function testAssertThatWithIdentifierAndFalseArgFails()
+ {
+ try {
+ \Hamcrest\MatcherAssert::assertThat('identifier', false);
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('identifier', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat('identifier', null);
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('identifier', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat('identifier', '');
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('identifier', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat('identifier', 0);
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('identifier', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat('identifier', 0.0);
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('identifier', $ex->getMessage());
+ }
+ try {
+ \Hamcrest\MatcherAssert::assertThat('identifier', array());
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals('identifier', $ex->getMessage());
+ }
+ self::assertEquals(6, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+
+ public function testAssertThatWithActualValueAndMatcherArgsThatMatchPasses()
+ {
+ \Hamcrest\MatcherAssert::assertThat(true, is(true));
+ self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+
+ public function testAssertThatWithActualValueAndMatcherArgsThatDontMatchFails()
+ {
+ $expected = 'expected';
+ $actual = 'actual';
+
+ $expectedMessage =
+ 'Expected: "expected"' . PHP_EOL .
+ ' but: was "actual"';
+
+ try {
+ \Hamcrest\MatcherAssert::assertThat($actual, equalTo($expected));
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals($expectedMessage, $ex->getMessage());
+ self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+ }
+
+ public function testAssertThatWithIdentifierAndActualValueAndMatcherArgsThatMatchPasses()
+ {
+ \Hamcrest\MatcherAssert::assertThat('identifier', true, is(true));
+ self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+
+ public function testAssertThatWithIdentifierAndActualValueAndMatcherArgsThatDontMatchFails()
+ {
+ $expected = 'expected';
+ $actual = 'actual';
+
+ $expectedMessage =
+ 'identifier' . PHP_EOL .
+ 'Expected: "expected"' . PHP_EOL .
+ ' but: was "actual"';
+
+ try {
+ \Hamcrest\MatcherAssert::assertThat('identifier', $actual, equalTo($expected));
+ self::fail('expected assertion failure');
+ } catch (\Hamcrest\AssertionError $ex) {
+ self::assertEquals($expectedMessage, $ex->getMessage());
+ self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+ }
+
+ public function testAssertThatWithNoArgsThrowsErrorAndDoesntIncrementCount()
+ {
+ try {
+ \Hamcrest\MatcherAssert::assertThat();
+ self::fail('expected invalid argument exception');
+ } catch (\InvalidArgumentException $ex) {
+ self::assertEquals(0, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+ }
+
+ public function testAssertThatWithFourArgsThrowsErrorAndDoesntIncrementCount()
+ {
+ try {
+ \Hamcrest\MatcherAssert::assertThat(1, 2, 3, 4);
+ self::fail('expected invalid argument exception');
+ } catch (\InvalidArgumentException $ex) {
+ self::assertEquals(0, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
+ }
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php
new file mode 100644
index 000000000..987d55267
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php
@@ -0,0 +1,27 @@
+assertTrue($p->matches(1.0));
+ $this->assertTrue($p->matches(0.5));
+ $this->assertTrue($p->matches(1.5));
+
+ $this->assertDoesNotMatch($p, 2.0, 'too large');
+ $this->assertMismatchDescription('<2F> differed by <0.5F>', $p, 2.0);
+ $this->assertDoesNotMatch($p, 0.0, 'number too small');
+ $this->assertMismatchDescription('<0F> differed by <0.5F>', $p, 0.0);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php
new file mode 100644
index 000000000..a4c94d373
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php
@@ -0,0 +1,41 @@
+_text = $text;
+ }
+
+ public function describeTo(\Hamcrest\Description $description)
+ {
+ $description->appendText($this->_text);
+ }
+}
+
+class StringDescriptionTest extends \PhpUnit_Framework_TestCase
+{
+
+ private $_description;
+
+ public function setUp()
+ {
+ $this->_description = new \Hamcrest\StringDescription();
+ }
+
+ public function testAppendTextAppendsTextInformation()
+ {
+ $this->_description->appendText('foo')->appendText('bar');
+ $this->assertEquals('foobar', (string) $this->_description);
+ }
+
+ public function testAppendValueCanAppendTextTypes()
+ {
+ $this->_description->appendValue('foo');
+ $this->assertEquals('"foo"', (string) $this->_description);
+ }
+
+ public function testSpecialCharactersAreEscapedForStringTypes()
+ {
+ $this->_description->appendValue("foo\\bar\"zip\r\n");
+ $this->assertEquals('"foo\\bar\\"zip\r\n"', (string) $this->_description);
+ }
+
+ public function testIntegerValuesCanBeAppended()
+ {
+ $this->_description->appendValue(42);
+ $this->assertEquals('<42>', (string) $this->_description);
+ }
+
+ public function testFloatValuesCanBeAppended()
+ {
+ $this->_description->appendValue(42.78);
+ $this->assertEquals('<42.78F>', (string) $this->_description);
+ }
+
+ public function testNullValuesCanBeAppended()
+ {
+ $this->_description->appendValue(null);
+ $this->assertEquals('null', (string) $this->_description);
+ }
+
+ public function testArraysCanBeAppended()
+ {
+ $this->_description->appendValue(array('foo', 42.78));
+ $this->assertEquals('["foo", <42.78F>]', (string) $this->_description);
+ }
+
+ public function testObjectsCanBeAppended()
+ {
+ $this->_description->appendValue(new \stdClass());
+ $this->assertEquals('', (string) $this->_description);
+ }
+
+ public function testBooleanValuesCanBeAppended()
+ {
+ $this->_description->appendValue(false);
+ $this->assertEquals('', (string) $this->_description);
+ }
+
+ public function testListsOfvaluesCanBeAppended()
+ {
+ $this->_description->appendValue(array('foo', 42.78));
+ $this->assertEquals('["foo", <42.78F>]', (string) $this->_description);
+ }
+
+ public function testIterableOfvaluesCanBeAppended()
+ {
+ $items = new \ArrayObject(array('foo', 42.78));
+ $this->_description->appendValue($items);
+ $this->assertEquals('["foo", <42.78F>]', (string) $this->_description);
+ }
+
+ public function testIteratorOfvaluesCanBeAppended()
+ {
+ $items = new \ArrayObject(array('foo', 42.78));
+ $this->_description->appendValue($items->getIterator());
+ $this->assertEquals('["foo", <42.78F>]', (string) $this->_description);
+ }
+
+ public function testListsOfvaluesCanBeAppendedManually()
+ {
+ $this->_description->appendValueList('@start@', '@sep@ ', '@end@', array('foo', 42.78));
+ $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description);
+ }
+
+ public function testIterableOfvaluesCanBeAppendedManually()
+ {
+ $items = new \ArrayObject(array('foo', 42.78));
+ $this->_description->appendValueList('@start@', '@sep@ ', '@end@', $items);
+ $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description);
+ }
+
+ public function testIteratorOfvaluesCanBeAppendedManually()
+ {
+ $items = new \ArrayObject(array('foo', 42.78));
+ $this->_description->appendValueList('@start@', '@sep@ ', '@end@', $items->getIterator());
+ $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description);
+ }
+
+ public function testSelfDescribingObjectsCanBeAppended()
+ {
+ $this->_description
+ ->appendDescriptionOf(new \Hamcrest\SampleSelfDescriber('foo'))
+ ->appendDescriptionOf(new \Hamcrest\SampleSelfDescriber('bar'))
+ ;
+ $this->assertEquals('foobar', (string) $this->_description);
+ }
+
+ public function testSelfDescribingObjectsCanBeAppendedAsLists()
+ {
+ $this->_description->appendList('@start@', '@sep@ ', '@end@', array(
+ new \Hamcrest\SampleSelfDescriber('foo'),
+ new \Hamcrest\SampleSelfDescriber('bar')
+ ));
+ $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description);
+ }
+
+ public function testSelfDescribingObjectsCanBeAppendedAsIteratedLists()
+ {
+ $items = new \ArrayObject(array(
+ new \Hamcrest\SampleSelfDescriber('foo'),
+ new \Hamcrest\SampleSelfDescriber('bar')
+ ));
+ $this->_description->appendList('@start@', '@sep@ ', '@end@', $items);
+ $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description);
+ }
+
+ public function testSelfDescribingObjectsCanBeAppendedAsIterators()
+ {
+ $items = new \ArrayObject(array(
+ new \Hamcrest\SampleSelfDescriber('foo'),
+ new \Hamcrest\SampleSelfDescriber('bar')
+ ));
+ $this->_description->appendList('@start@', '@sep@ ', '@end@', $items->getIterator());
+ $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php
new file mode 100644
index 000000000..8d5c56be1
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php
@@ -0,0 +1,86 @@
+assertDoesNotMatch(emptyString(), null, 'null');
+ }
+
+ public function testEmptyDoesNotMatchZero()
+ {
+ $this->assertDoesNotMatch(emptyString(), 0, 'zero');
+ }
+
+ public function testEmptyDoesNotMatchFalse()
+ {
+ $this->assertDoesNotMatch(emptyString(), false, 'false');
+ }
+
+ public function testEmptyDoesNotMatchEmptyArray()
+ {
+ $this->assertDoesNotMatch(emptyString(), array(), 'empty array');
+ }
+
+ public function testEmptyMatchesEmptyString()
+ {
+ $this->assertMatches(emptyString(), '', 'empty string');
+ }
+
+ public function testEmptyDoesNotMatchNonEmptyString()
+ {
+ $this->assertDoesNotMatch(emptyString(), 'foo', 'non-empty string');
+ }
+
+ public function testEmptyHasAReadableDescription()
+ {
+ $this->assertDescription('an empty string', emptyString());
+ }
+
+ public function testEmptyOrNullMatchesNull()
+ {
+ $this->assertMatches(nullOrEmptyString(), null, 'null');
+ }
+
+ public function testEmptyOrNullMatchesEmptyString()
+ {
+ $this->assertMatches(nullOrEmptyString(), '', 'empty string');
+ }
+
+ public function testEmptyOrNullDoesNotMatchNonEmptyString()
+ {
+ $this->assertDoesNotMatch(nullOrEmptyString(), 'foo', 'non-empty string');
+ }
+
+ public function testEmptyOrNullHasAReadableDescription()
+ {
+ $this->assertDescription('(null or an empty string)', nullOrEmptyString());
+ }
+
+ public function testNonEmptyDoesNotMatchNull()
+ {
+ $this->assertDoesNotMatch(nonEmptyString(), null, 'null');
+ }
+
+ public function testNonEmptyDoesNotMatchEmptyString()
+ {
+ $this->assertDoesNotMatch(nonEmptyString(), '', 'empty string');
+ }
+
+ public function testNonEmptyMatchesNonEmptyString()
+ {
+ $this->assertMatches(nonEmptyString(), 'foo', 'non-empty string');
+ }
+
+ public function testNonEmptyHasAReadableDescription()
+ {
+ $this->assertDescription('a non-empty string', nonEmptyString());
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php
new file mode 100644
index 000000000..0539fd5cb
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php
@@ -0,0 +1,40 @@
+assertDescription(
+ 'equalToIgnoringCase("heLLo")',
+ equalToIgnoringCase('heLLo')
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php
new file mode 100644
index 000000000..6c2304f43
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php
@@ -0,0 +1,51 @@
+_matcher = \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace(
+ "Hello World how\n are we? "
+ );
+ }
+
+ protected function createMatcher()
+ {
+ return $this->_matcher;
+ }
+
+ public function testPassesIfWordsAreSameButWhitespaceDiffers()
+ {
+ assertThat('Hello World how are we?', $this->_matcher);
+ assertThat(" Hello \rWorld \t how are\nwe?", $this->_matcher);
+ }
+
+ public function testFailsIfTextOtherThanWhitespaceDiffers()
+ {
+ assertThat('Hello PLANET how are we?', not($this->_matcher));
+ assertThat('Hello World how are we', not($this->_matcher));
+ }
+
+ public function testFailsIfWhitespaceIsAddedOrRemovedInMidWord()
+ {
+ assertThat('HelloWorld how are we?', not($this->_matcher));
+ assertThat('Hello Wo rld how are we?', not($this->_matcher));
+ }
+
+ public function testFailsIfMatchingAgainstNull()
+ {
+ assertThat(null, not($this->_matcher));
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription(
+ "equalToIgnoringWhiteSpace(\"Hello World how\\n are we? \")",
+ $this->_matcher
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php
new file mode 100644
index 000000000..4891598f6
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php
@@ -0,0 +1,30 @@
+assertDescription('a string matching "pattern"', matchesPattern('pattern'));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php
new file mode 100644
index 000000000..3b5b08e3b
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php
@@ -0,0 +1,80 @@
+_stringContains = \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase(
+ strtolower(self::EXCERPT)
+ );
+ }
+
+ protected function createMatcher()
+ {
+ return $this->_stringContains;
+ }
+
+ public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring()
+ {
+ $this->assertTrue(
+ $this->_stringContains->matches(self::EXCERPT . 'END'),
+ 'should be true if excerpt at beginning'
+ );
+ $this->assertTrue(
+ $this->_stringContains->matches('START' . self::EXCERPT),
+ 'should be true if excerpt at end'
+ );
+ $this->assertTrue(
+ $this->_stringContains->matches('START' . self::EXCERPT . 'END'),
+ 'should be true if excerpt in middle'
+ );
+ $this->assertTrue(
+ $this->_stringContains->matches(self::EXCERPT . self::EXCERPT),
+ 'should be true if excerpt is repeated'
+ );
+
+ $this->assertFalse(
+ $this->_stringContains->matches('Something else'),
+ 'should not be true if excerpt is not in string'
+ );
+ $this->assertFalse(
+ $this->_stringContains->matches(substr(self::EXCERPT, 1)),
+ 'should not be true if part of excerpt is in string'
+ );
+ }
+
+ public function testEvaluatesToTrueIfArgumentIsEqualToSubstring()
+ {
+ $this->assertTrue(
+ $this->_stringContains->matches(self::EXCERPT),
+ 'should be true if excerpt is entire string'
+ );
+ }
+
+ public function testEvaluatesToTrueIfArgumentContainsExactSubstring()
+ {
+ $this->assertTrue(
+ $this->_stringContains->matches(strtolower(self::EXCERPT)),
+ 'should be false if excerpt is entire string ignoring case'
+ );
+ $this->assertTrue(
+ $this->_stringContains->matches('START' . strtolower(self::EXCERPT) . 'END'),
+ 'should be false if excerpt is contained in string ignoring case'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription(
+ 'a string containing in any case "'
+ . strtolower(self::EXCERPT) . '"',
+ $this->_stringContains
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php
new file mode 100644
index 000000000..0be70629f
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php
@@ -0,0 +1,42 @@
+_m = \Hamcrest\Text\StringContainsInOrder::stringContainsInOrder(array('a', 'b', 'c'));
+ }
+
+ protected function createMatcher()
+ {
+ return $this->_m;
+ }
+
+ public function testMatchesOnlyIfStringContainsGivenSubstringsInTheSameOrder()
+ {
+ $this->assertMatches($this->_m, 'abc', 'substrings in order');
+ $this->assertMatches($this->_m, '1a2b3c4', 'substrings separated');
+
+ $this->assertDoesNotMatch($this->_m, 'cab', 'substrings out of order');
+ $this->assertDoesNotMatch($this->_m, 'xyz', 'no substrings in string');
+ $this->assertDoesNotMatch($this->_m, 'ac', 'substring missing');
+ $this->assertDoesNotMatch($this->_m, '', 'empty string');
+ }
+
+ public function testAcceptsVariableArguments()
+ {
+ $this->assertMatches(stringContainsInOrder('a', 'b', 'c'), 'abc', 'substrings as variable arguments');
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription(
+ 'a string containing "a", "b", "c" in order',
+ $this->_m
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php
new file mode 100644
index 000000000..203fd918d
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php
@@ -0,0 +1,86 @@
+_stringContains = \Hamcrest\Text\StringContains::containsString(self::EXCERPT);
+ }
+
+ protected function createMatcher()
+ {
+ return $this->_stringContains;
+ }
+
+ public function testEvaluatesToTrueIfArgumentContainsSubstring()
+ {
+ $this->assertTrue(
+ $this->_stringContains->matches(self::EXCERPT . 'END'),
+ 'should be true if excerpt at beginning'
+ );
+ $this->assertTrue(
+ $this->_stringContains->matches('START' . self::EXCERPT),
+ 'should be true if excerpt at end'
+ );
+ $this->assertTrue(
+ $this->_stringContains->matches('START' . self::EXCERPT . 'END'),
+ 'should be true if excerpt in middle'
+ );
+ $this->assertTrue(
+ $this->_stringContains->matches(self::EXCERPT . self::EXCERPT),
+ 'should be true if excerpt is repeated'
+ );
+
+ $this->assertFalse(
+ $this->_stringContains->matches('Something else'),
+ 'should not be true if excerpt is not in string'
+ );
+ $this->assertFalse(
+ $this->_stringContains->matches(substr(self::EXCERPT, 1)),
+ 'should not be true if part of excerpt is in string'
+ );
+ }
+
+ public function testEvaluatesToTrueIfArgumentIsEqualToSubstring()
+ {
+ $this->assertTrue(
+ $this->_stringContains->matches(self::EXCERPT),
+ 'should be true if excerpt is entire string'
+ );
+ }
+
+ public function testEvaluatesToFalseIfArgumentContainsSubstringIgnoringCase()
+ {
+ $this->assertFalse(
+ $this->_stringContains->matches(strtolower(self::EXCERPT)),
+ 'should be false if excerpt is entire string ignoring case'
+ );
+ $this->assertFalse(
+ $this->_stringContains->matches('START' . strtolower(self::EXCERPT) . 'END'),
+ 'should be false if excerpt is contained in string ignoring case'
+ );
+ }
+
+ public function testIgnoringCaseReturnsCorrectMatcher()
+ {
+ $this->assertTrue(
+ $this->_stringContains->ignoringCase()->matches('EXceRpT'),
+ 'should be true if excerpt is entire string ignoring case'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription(
+ 'a string containing "'
+ . self::EXCERPT . '"',
+ $this->_stringContains
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php
new file mode 100644
index 000000000..fffa3c9cd
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php
@@ -0,0 +1,62 @@
+_stringEndsWith = \Hamcrest\Text\StringEndsWith::endsWith(self::EXCERPT);
+ }
+
+ protected function createMatcher()
+ {
+ return $this->_stringEndsWith;
+ }
+
+ public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring()
+ {
+ $this->assertFalse(
+ $this->_stringEndsWith->matches(self::EXCERPT . 'END'),
+ 'should be false if excerpt at beginning'
+ );
+ $this->assertTrue(
+ $this->_stringEndsWith->matches('START' . self::EXCERPT),
+ 'should be true if excerpt at end'
+ );
+ $this->assertFalse(
+ $this->_stringEndsWith->matches('START' . self::EXCERPT . 'END'),
+ 'should be false if excerpt in middle'
+ );
+ $this->assertTrue(
+ $this->_stringEndsWith->matches(self::EXCERPT . self::EXCERPT),
+ 'should be true if excerpt is at end and repeated'
+ );
+
+ $this->assertFalse(
+ $this->_stringEndsWith->matches('Something else'),
+ 'should be false if excerpt is not in string'
+ );
+ $this->assertFalse(
+ $this->_stringEndsWith->matches(substr(self::EXCERPT, 0, strlen(self::EXCERPT) - 2)),
+ 'should be false if part of excerpt is at end of string'
+ );
+ }
+
+ public function testEvaluatesToTrueIfArgumentIsEqualToSubstring()
+ {
+ $this->assertTrue(
+ $this->_stringEndsWith->matches(self::EXCERPT),
+ 'should be true if excerpt is entire string'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription('a string ending with "EXCERPT"', $this->_stringEndsWith);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php
new file mode 100644
index 000000000..fc3761bde
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php
@@ -0,0 +1,62 @@
+_stringStartsWith = \Hamcrest\Text\StringStartsWith::startsWith(self::EXCERPT);
+ }
+
+ protected function createMatcher()
+ {
+ return $this->_stringStartsWith;
+ }
+
+ public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring()
+ {
+ $this->assertTrue(
+ $this->_stringStartsWith->matches(self::EXCERPT . 'END'),
+ 'should be true if excerpt at beginning'
+ );
+ $this->assertFalse(
+ $this->_stringStartsWith->matches('START' . self::EXCERPT),
+ 'should be false if excerpt at end'
+ );
+ $this->assertFalse(
+ $this->_stringStartsWith->matches('START' . self::EXCERPT . 'END'),
+ 'should be false if excerpt in middle'
+ );
+ $this->assertTrue(
+ $this->_stringStartsWith->matches(self::EXCERPT . self::EXCERPT),
+ 'should be true if excerpt is at beginning and repeated'
+ );
+
+ $this->assertFalse(
+ $this->_stringStartsWith->matches('Something else'),
+ 'should be false if excerpt is not in string'
+ );
+ $this->assertFalse(
+ $this->_stringStartsWith->matches(substr(self::EXCERPT, 1)),
+ 'should be false if part of excerpt is at start of string'
+ );
+ }
+
+ public function testEvaluatesToTrueIfArgumentIsEqualToSubstring()
+ {
+ $this->assertTrue(
+ $this->_stringStartsWith->matches(self::EXCERPT),
+ 'should be true if excerpt is entire string'
+ );
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription('a string starting with "EXCERPT"', $this->_stringStartsWith);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php
new file mode 100644
index 000000000..d13c24d2c
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php
@@ -0,0 +1,35 @@
+assertDescription('an array', arrayValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', arrayValue(), null);
+ $this->assertMismatchDescription('was a string "foo"', arrayValue(), 'foo');
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php
new file mode 100644
index 000000000..24309fc09
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php
@@ -0,0 +1,35 @@
+assertDescription('a boolean', booleanValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', booleanValue(), null);
+ $this->assertMismatchDescription('was a string "foo"', booleanValue(), 'foo');
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php
new file mode 100644
index 000000000..5098e21ba
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php
@@ -0,0 +1,103 @@
+=')) {
+ $this->markTestSkipped('Closures require php 5.3');
+ }
+ eval('assertThat(function () {}, callableValue());');
+ }
+
+ public function testEvaluatesToTrueIfArgumentImplementsInvoke()
+ {
+ if (!version_compare(PHP_VERSION, '5.3', '>=')) {
+ $this->markTestSkipped('Magic method __invoke() requires php 5.3');
+ }
+ assertThat($this, callableValue());
+ }
+
+ public function testEvaluatesToFalseIfArgumentIsInvalidFunctionName()
+ {
+ if (function_exists('not_a_Hamcrest_function')) {
+ $this->markTestSkipped('Function "not_a_Hamcrest_function" must not exist');
+ }
+
+ assertThat('not_a_Hamcrest_function', not(callableValue()));
+ }
+
+ public function testEvaluatesToFalseIfArgumentIsInvalidStaticMethodCallback()
+ {
+ assertThat(
+ array('Hamcrest\Type\IsCallableTest', 'noMethod'),
+ not(callableValue())
+ );
+ }
+
+ public function testEvaluatesToFalseIfArgumentIsInvalidInstanceMethodCallback()
+ {
+ assertThat(array($this, 'noMethod'), not(callableValue()));
+ }
+
+ public function testEvaluatesToFalseIfArgumentDoesntImplementInvoke()
+ {
+ assertThat(new \stdClass(), not(callableValue()));
+ }
+
+ public function testEvaluatesToFalseIfArgumentDoesntMatchType()
+ {
+ assertThat(false, not(callableValue()));
+ assertThat(5.2, not(callableValue()));
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription('a callable', callableValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription(
+ 'was a string "invalid-function"',
+ callableValue(),
+ 'invalid-function'
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php
new file mode 100644
index 000000000..85c2a963c
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php
@@ -0,0 +1,35 @@
+assertDescription('a double', doubleValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', doubleValue(), null);
+ $this->assertMismatchDescription('was a string "foo"', doubleValue(), 'foo');
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php
new file mode 100644
index 000000000..ce5a51a9f
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php
@@ -0,0 +1,36 @@
+assertDescription('an integer', integerValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', integerValue(), null);
+ $this->assertMismatchDescription('was a string "foo"', integerValue(), 'foo');
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php
new file mode 100644
index 000000000..1fd83efe5
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php
@@ -0,0 +1,53 @@
+assertDescription('a number', numericValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', numericValue(), null);
+ $this->assertMismatchDescription('was a string "foo"', numericValue(), 'foo');
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php
new file mode 100644
index 000000000..a3b617c20
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php
@@ -0,0 +1,34 @@
+assertDescription('an object', objectValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', objectValue(), null);
+ $this->assertMismatchDescription('was a string "foo"', objectValue(), 'foo');
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php
new file mode 100644
index 000000000..d6ea53484
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php
@@ -0,0 +1,34 @@
+assertDescription('a resource', resourceValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', resourceValue(), null);
+ $this->assertMismatchDescription('was a string "foo"', resourceValue(), 'foo');
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php
new file mode 100644
index 000000000..72a188d67
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php
@@ -0,0 +1,39 @@
+assertDescription('a scalar', scalarValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', scalarValue(), null);
+ $this->assertMismatchDescription('was an array ["foo"]', scalarValue(), array('foo'));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php
new file mode 100644
index 000000000..557d5913a
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php
@@ -0,0 +1,35 @@
+assertDescription('a string', stringValue());
+ }
+
+ public function testDecribesActualTypeInMismatchMessage()
+ {
+ $this->assertMismatchDescription('was null', stringValue(), null);
+ $this->assertMismatchDescription('was a double <5.2F>', stringValue(), 5.2);
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php
new file mode 100644
index 000000000..0c2cd0433
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php
@@ -0,0 +1,80 @@
+assertSame($matcher, $newMatcher);
+ }
+
+ public function testWrapValueWithIsEqualWrapsPrimitive()
+ {
+ $matcher = \Hamcrest\Util::wrapValueWithIsEqual('foo');
+ $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matcher);
+ $this->assertTrue($matcher->matches('foo'));
+ }
+
+ public function testCheckAllAreMatchersAcceptsMatchers()
+ {
+ \Hamcrest\Util::checkAllAreMatchers(array(
+ new \Hamcrest\Text\MatchesPattern('/fo+/'),
+ new \Hamcrest\Core\IsEqual('foo'),
+ ));
+ }
+
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testCheckAllAreMatchersFailsForPrimitive()
+ {
+ \Hamcrest\Util::checkAllAreMatchers(array(
+ new \Hamcrest\Text\MatchesPattern('/fo+/'),
+ 'foo',
+ ));
+ }
+
+ private function callAndAssertCreateMatcherArray($items)
+ {
+ $matchers = \Hamcrest\Util::createMatcherArray($items);
+ $this->assertInternalType('array', $matchers);
+ $this->assertSameSize($items, $matchers);
+ foreach ($matchers as $matcher) {
+ $this->assertInstanceOf('\Hamcrest\Matcher', $matcher);
+ }
+
+ return $matchers;
+ }
+
+ public function testCreateMatcherArrayLeavesMatchersUntouched()
+ {
+ $matcher = new \Hamcrest\Text\MatchesPattern('/fo+/');
+ $items = array($matcher);
+ $matchers = $this->callAndAssertCreateMatcherArray($items);
+ $this->assertSame($matcher, $matchers[0]);
+ }
+
+ public function testCreateMatcherArrayWrapsPrimitiveWithIsEqualMatcher()
+ {
+ $matchers = $this->callAndAssertCreateMatcherArray(array('foo'));
+ $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matchers[0]);
+ $this->assertTrue($matchers[0]->matches('foo'));
+ }
+
+ public function testCreateMatcherArrayDoesntModifyOriginalArray()
+ {
+ $items = array('foo');
+ $this->callAndAssertCreateMatcherArray($items);
+ $this->assertSame('foo', $items[0]);
+ }
+
+ public function testCreateMatcherArrayUnwrapsSingleArrayElement()
+ {
+ $matchers = $this->callAndAssertCreateMatcherArray(array(array('foo')));
+ $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matchers[0]);
+ $this->assertTrue($matchers[0]->matches('foo'));
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php
new file mode 100644
index 000000000..677488716
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php
@@ -0,0 +1,198 @@
+
+
+
+ alice
+ Alice Frankel
+ admin
+
+
+ bob
+ Bob Frankel
+ user
+
+
+ charlie
+ Charlie Chan
+ user
+
+
+XML;
+ self::$doc = new \DOMDocument();
+ self::$doc->loadXML(self::$xml);
+
+ self::$html = <<
+
+ Home Page
+
+
+
Heading
+
Some text
+
+
+HTML;
+ }
+
+ protected function createMatcher()
+ {
+ return \Hamcrest\Xml\HasXPath::hasXPath('/users/user');
+ }
+
+ public function testMatchesWhenXPathIsFound()
+ {
+ assertThat('one match', self::$doc, hasXPath('user[id = "bob"]'));
+ assertThat('two matches', self::$doc, hasXPath('user[role = "user"]'));
+ }
+
+ public function testDoesNotMatchWhenXPathIsNotFound()
+ {
+ assertThat(
+ 'no match',
+ self::$doc,
+ not(hasXPath('user[contains(id, "frank")]'))
+ );
+ }
+
+ public function testMatchesWhenExpressionWithoutMatcherEvaluatesToTrue()
+ {
+ assertThat(
+ 'one match',
+ self::$doc,
+ hasXPath('count(user[id = "bob"])')
+ );
+ }
+
+ public function testDoesNotMatchWhenExpressionWithoutMatcherEvaluatesToFalse()
+ {
+ assertThat(
+ 'no matches',
+ self::$doc,
+ not(hasXPath('count(user[id = "frank"])'))
+ );
+ }
+
+ public function testMatchesWhenExpressionIsEqual()
+ {
+ assertThat(
+ 'one match',
+ self::$doc,
+ hasXPath('count(user[id = "bob"])', 1)
+ );
+ assertThat(
+ 'two matches',
+ self::$doc,
+ hasXPath('count(user[role = "user"])', 2)
+ );
+ }
+
+ public function testDoesNotMatchWhenExpressionIsNotEqual()
+ {
+ assertThat(
+ 'no match',
+ self::$doc,
+ not(hasXPath('count(user[id = "frank"])', 2))
+ );
+ assertThat(
+ 'one match',
+ self::$doc,
+ not(hasXPath('count(user[role = "admin"])', 2))
+ );
+ }
+
+ public function testMatchesWhenContentMatches()
+ {
+ assertThat(
+ 'one match',
+ self::$doc,
+ hasXPath('user/name', containsString('ice'))
+ );
+ assertThat(
+ 'two matches',
+ self::$doc,
+ hasXPath('user/role', equalTo('user'))
+ );
+ }
+
+ public function testDoesNotMatchWhenContentDoesNotMatch()
+ {
+ assertThat(
+ 'no match',
+ self::$doc,
+ not(hasXPath('user/name', containsString('Bobby')))
+ );
+ assertThat(
+ 'no matches',
+ self::$doc,
+ not(hasXPath('user/role', equalTo('owner')))
+ );
+ }
+
+ public function testProvidesConvenientShortcutForHasXPathEqualTo()
+ {
+ assertThat('matches', self::$doc, hasXPath('count(user)', 3));
+ assertThat('matches', self::$doc, hasXPath('user[2]/id', 'bob'));
+ }
+
+ public function testProvidesConvenientShortcutForHasXPathCountEqualTo()
+ {
+ assertThat('matches', self::$doc, hasXPath('user[id = "charlie"]', 1));
+ }
+
+ public function testMatchesAcceptsXmlString()
+ {
+ assertThat('accepts XML string', self::$xml, hasXPath('user'));
+ }
+
+ public function testMatchesAcceptsHtmlString()
+ {
+ assertThat('accepts HTML string', self::$html, hasXPath('body/h1', 'Heading'));
+ }
+
+ public function testHasAReadableDescription()
+ {
+ $this->assertDescription(
+ 'XML or HTML document with XPath "/users/user"',
+ hasXPath('/users/user')
+ );
+ $this->assertDescription(
+ 'XML or HTML document with XPath "count(/users/user)" <2>',
+ hasXPath('/users/user', 2)
+ );
+ $this->assertDescription(
+ 'XML or HTML document with XPath "/users/user/name"'
+ . ' a string starting with "Alice"',
+ hasXPath('/users/user/name', startsWith('Alice'))
+ );
+ }
+
+ public function testHasAReadableMismatchDescription()
+ {
+ $this->assertMismatchDescription(
+ 'XPath returned no results',
+ hasXPath('/users/name'),
+ self::$doc
+ );
+ $this->assertMismatchDescription(
+ 'XPath expression result was <3F>',
+ hasXPath('/users/user', 2),
+ self::$doc
+ );
+ $this->assertMismatchDescription(
+ 'XPath returned ["alice", "bob", "charlie"]',
+ hasXPath('/users/user/id', 'Frank'),
+ self::$doc
+ );
+ }
+}
diff --git a/vendor/hamcrest/hamcrest-php/tests/bootstrap.php b/vendor/hamcrest/hamcrest-php/tests/bootstrap.php
new file mode 100644
index 000000000..bc4958d1f
--- /dev/null
+++ b/vendor/hamcrest/hamcrest-php/tests/bootstrap.php
@@ -0,0 +1,11 @@
+
+
+
+ .
+
+
+
+
+
+ ../hamcrest
+
+
+
diff --git a/vendor/johnpbloch/wordpress-core-installer/LICENSE.md b/vendor/johnpbloch/wordpress-core-installer/LICENSE.md
new file mode 100644
index 000000000..23cb79033
--- /dev/null
+++ b/vendor/johnpbloch/wordpress-core-installer/LICENSE.md
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the 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 Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {description}
+ Copyright (C) {year} {fullname}
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ {signature of Ty Coon}, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/vendor/johnpbloch/wordpress-core-installer/composer.json b/vendor/johnpbloch/wordpress-core-installer/composer.json
new file mode 100644
index 000000000..2d147a204
--- /dev/null
+++ b/vendor/johnpbloch/wordpress-core-installer/composer.json
@@ -0,0 +1,46 @@
+{
+ "name": "johnpbloch/wordpress-core-installer",
+ "description": "A custom installer to handle deploying WordPress with composer",
+ "keywords": [
+ "wordpress"
+ ],
+ "type": "composer-plugin",
+ "license": "GPL-2.0+",
+ "minimum-stability": "dev",
+ "prefer-stable": true,
+ "authors": [
+ {
+ "name": "John P. Bloch",
+ "email": "me@johnpbloch.com"
+ }
+ ],
+ "autoload": {
+ "psr-0": {
+ "johnpbloch\\Composer\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Tests\\JohnPBloch\\Composer\\": "tests/"
+ }
+ },
+ "extra": {
+ "class": "johnpbloch\\Composer\\WordPressCorePlugin"
+ },
+ "require": {
+ "composer-plugin-api": "^1.0"
+ },
+ "require-dev": {
+ "composer/composer": "^1.0",
+ "phpunit/phpunit": ">=4.8.35"
+ },
+ "conflict": {
+ "composer/installers": "<1.0.6"
+ },
+ "scripts": {
+ "test:phpunit": "phpunit",
+ "test": [
+ "@test:phpunit"
+ ]
+ }
+}
diff --git a/vendor/johnpbloch/wordpress-core-installer/src/johnpbloch/Composer/WordPressCoreInstaller.php b/vendor/johnpbloch/wordpress-core-installer/src/johnpbloch/Composer/WordPressCoreInstaller.php
new file mode 100644
index 000000000..bfbfe5546
--- /dev/null
+++ b/vendor/johnpbloch/wordpress-core-installer/src/johnpbloch/Composer/WordPressCoreInstaller.php
@@ -0,0 +1,111 @@
+getPrettyName();
+ if ( $this->composer->getPackage() ) {
+ $topExtra = $this->composer->getPackage()->getExtra();
+ if ( ! empty( $topExtra['wordpress-install-dir'] ) ) {
+ $installationDir = $topExtra['wordpress-install-dir'];
+ if ( is_array( $installationDir ) ) {
+ $installationDir = empty( $installationDir[ $prettyName ] ) ? false : $installationDir[ $prettyName ];
+ }
+ }
+ }
+ $extra = $package->getExtra();
+ if ( ! $installationDir && ! empty( $extra['wordpress-install-dir'] ) ) {
+ $installationDir = $extra['wordpress-install-dir'];
+ }
+ if ( ! $installationDir ) {
+ $installationDir = 'wordpress';
+ }
+ $vendorDir = $this->composer->getConfig()->get( 'vendor-dir', Config::RELATIVE_PATHS ) ?: 'vendor';
+ if (
+ in_array( $installationDir, $this->sensitiveDirectories ) ||
+ ( $installationDir === $vendorDir )
+ ) {
+ throw new \InvalidArgumentException( $this->getSensitiveDirectoryMessage( $installationDir, $prettyName ) );
+ }
+ if (
+ ! empty( self::$_installedPaths[ $installationDir ] ) &&
+ $prettyName !== self::$_installedPaths[ $installationDir ]
+ ) {
+ $conflict_message = $this->getConflictMessage( $prettyName, self::$_installedPaths[ $installationDir ] );
+ throw new \InvalidArgumentException( $conflict_message );
+ }
+ self::$_installedPaths[ $installationDir ] = $prettyName;
+
+ return $installationDir;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function supports( $packageType ) {
+ return self::TYPE === $packageType;
+ }
+
+ /**
+ * Get the exception message with conflicting packages
+ *
+ * @param string $attempted
+ * @param string $alreadyExists
+ *
+ * @return string
+ */
+ private function getConflictMessage( $attempted, $alreadyExists ) {
+ return sprintf( self::MESSAGE_CONFLICT, $attempted, $alreadyExists );
+ }
+
+ /**
+ * Get the exception message for attempted sensitive directories
+ *
+ * @param string $attempted
+ * @param string $packageName
+ *
+ * @return string
+ */
+ private function getSensitiveDirectoryMessage( $attempted, $packageName ) {
+ return sprintf( self::MESSAGE_SENSITIVE, $attempted, $packageName );
+ }
+
+}
diff --git a/vendor/johnpbloch/wordpress-core-installer/src/johnpbloch/Composer/WordPressCorePlugin.php b/vendor/johnpbloch/wordpress-core-installer/src/johnpbloch/Composer/WordPressCorePlugin.php
new file mode 100644
index 000000000..13d8c2f93
--- /dev/null
+++ b/vendor/johnpbloch/wordpress-core-installer/src/johnpbloch/Composer/WordPressCorePlugin.php
@@ -0,0 +1,41 @@
+getInstallationManager()->addInstaller( $installer );
+ }
+
+}
diff --git a/vendor/johnpbloch/wordpress/README.md b/vendor/johnpbloch/wordpress/README.md
new file mode 100644
index 000000000..b6cc2bc6d
--- /dev/null
+++ b/vendor/johnpbloch/wordpress/README.md
@@ -0,0 +1,6 @@
+# WordPress Composer Fork
+
+If you're looking for more information on using composer and WordPress together, go check out http://composer.rarst.net
+
+If you're looking for WordPress core, the core package is now at https://github.com/johnpbloch/wordpress-core
+
diff --git a/vendor/johnpbloch/wordpress/composer.json b/vendor/johnpbloch/wordpress/composer.json
new file mode 100644
index 000000000..60ea6528b
--- /dev/null
+++ b/vendor/johnpbloch/wordpress/composer.json
@@ -0,0 +1,30 @@
+{
+ "name": "johnpbloch/wordpress",
+ "description": "WordPress is web software you can use to create a beautiful website or blog.",
+ "keywords": [
+ "wordpress",
+ "blog",
+ "cms"
+ ],
+ "type": "package",
+ "homepage": "http://wordpress.org/",
+ "license": "GPL-2.0+",
+ "authors": [
+ {
+ "name": "WordPress Community",
+ "homepage": "http://wordpress.org/about/"
+ }
+ ],
+ "support": {
+ "issues": "http://core.trac.wordpress.org/",
+ "forum": "http://wordpress.org/support/",
+ "wiki": "http://codex.wordpress.org/",
+ "irc": "irc://irc.freenode.net/wordpress",
+ "source": "http://core.trac.wordpress.org/browser"
+ },
+ "require": {
+ "php": ">=5.3.2",
+ "johnpbloch/wordpress-core-installer": "^1.0",
+ "johnpbloch/wordpress-core": "4.9.8"
+ }
+}
diff --git a/vendor/mockery/mockery/.gitignore b/vendor/mockery/mockery/.gitignore
new file mode 100644
index 000000000..062facccd
--- /dev/null
+++ b/vendor/mockery/mockery/.gitignore
@@ -0,0 +1,15 @@
+*~
+pearfarm.spec
+*.sublime-project
+library/Hamcrest/*
+composer.lock
+vendor/
+composer.phar
+test.php
+build/
+phpunit.xml
+*.DS_store
+.idea/*
+.php_cs.cache
+docs/api
+phpDocumentor.phar*
diff --git a/vendor/mockery/mockery/.php_cs b/vendor/mockery/mockery/.php_cs
new file mode 100644
index 000000000..be098ba38
--- /dev/null
+++ b/vendor/mockery/mockery/.php_cs
@@ -0,0 +1,30 @@
+in([
+ 'library',
+ 'tests',
+ ]);
+
+ return PhpCsFixer\Config::create()
+ ->setRules(array(
+ '@PSR2' => true,
+ ))
+ ->setUsingCache(true)
+ ->setFinder($finder)
+ ;
+}
+
+$finder = DefaultFinder::create()->in(
+ [
+ 'library',
+ 'tests',
+ ]);
+
+return Config::create()
+ ->level('psr2')
+ ->setUsingCache(true)
+ ->finder($finder);
diff --git a/vendor/mockery/mockery/.phpstorm.meta.php b/vendor/mockery/mockery/.phpstorm.meta.php
new file mode 100644
index 000000000..6c53f80cd
--- /dev/null
+++ b/vendor/mockery/mockery/.phpstorm.meta.php
@@ -0,0 +1,11 @@
+> ~/.phpenv/versions/"$(phpenv version-name)"/etc/conf.d/travis.ini
+ fi
+
+script:
+- |
+ if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then
+ ./vendor/bin/phpunit --coverage-text --coverage-clover="build/logs/clover.xml" --testsuite="Mockery Test Suite PHP56";
+ else
+ ./vendor/bin/phpunit --coverage-text --coverage-clover="build/logs/clover.xml" --testsuite="Mockery Test Suite";
+ fi
+
+after_success:
+ - composer require satooshi/php-coveralls
+ - vendor/bin/coveralls -v
+ - wget https://scrutinizer-ci.com/ocular.phar
+ - php ocular.phar code-coverage:upload --format=php-clover "build/logs/clover.xml"
+ - make apidocs
+
+notifications:
+ email:
+ - padraic.brady@gmail.com
+ - dave@atstsolutions.co.uk
+
+ irc: irc.freenode.org#mockery
+deploy:
+ overwrite: true
+ provider: pages
+ file_glob: true
+ file: docs/api/*
+ local_dir: docs/api
+ skip_cleanup: true
+ github_token: $GITHUB_TOKEN
+ on:
+ branch: master
+ php: '7.1'
+ condition: $DEPS = latest
diff --git a/vendor/mockery/mockery/CHANGELOG.md b/vendor/mockery/mockery/CHANGELOG.md
new file mode 100644
index 000000000..ba8a3e67a
--- /dev/null
+++ b/vendor/mockery/mockery/CHANGELOG.md
@@ -0,0 +1,106 @@
+# Change Log
+
+## x.y.z (unreleased)
+
+## 1.2.0 (2018-10-02)
+
+* Starts counting default expectations towards count (#910)
+* Adds workaround for some HHVM return types (#909)
+* Adds PhpStorm metadata support for autocomplete etc (#904)
+* Further attempts to support multiple PHPUnit versions (#903)
+* Allows setting constructor expectations on instance mocks (#900)
+* Adds workaround for HHVM memoization decorator (#893)
+* Adds experimental support for callable spys (#712)
+
+## 1.1.0 (2018-05-08)
+
+* Allows use of string method names in allows and expects (#794)
+* Finalises allows and expects syntax in API (#799)
+* Search for handlers in a case instensitive way (#801)
+* Deprecate allowMockingMethodsUnnecessarily (#808)
+* Fix risky tests (#769)
+* Fix namespace in TestListener (#812)
+* Fixed conflicting mock names (#813)
+* Clean elses (#819)
+* Updated protected method mocking exception message (#826)
+* Map of constants to mock (#829)
+* Simplify foreach with `in_array` function (#830)
+* Typehinted return value on Expectation#verify. (#832)
+* Fix shouldNotHaveReceived with HigherOrderMessage (#842)
+* Deprecates shouldDeferMissing (#839)
+* Adds support for return type hints in Demeter chains (#848)
+* Adds shouldNotReceive to composite expectation (#847)
+* Fix internal error when using --static-backup (#845)
+* Adds `andAnyOtherArgs` as an optional argument matcher (#860)
+* Fixes namespace qualifying with namespaced named mocks (#872)
+* Added possibility to add Constructor-Expections on hard dependencies, read: Mockery::mock('overload:...') (#781)
+
+## 1.0.0 (2017-09-06)
+
+* Destructors (`__destruct`) are stubbed out where it makes sense
+* Allow passing a closure argument to `withArgs()` to validate multiple arguments at once.
+* `Mockery\Adapter\Phpunit\TestListener` has been rewritten because it
+ incorrectly marked some tests as risky. It will no longer verify mock
+ expectations but instead check that tests do that themselves. PHPUnit 6 is
+ required if you want to use this fail safe.
+* Removes SPL Class Loader
+* Removed object recorder feature
+* Bumped minimum PHP version to 5.6
+* `andThrow` will now throw anything `\Throwable`
+* Adds `allows` and `expects` syntax
+* Adds optional global helpers for `mock`, `namedMock` and `spy`
+* Adds ability to create objects using traits
+* `Mockery\Matcher\MustBe` was deprecated
+* Marked `Mockery\MockInterface` as internal
+* Subset matcher matches recursively
+* BC BREAK - Spies return `null` by default from ignored (non-mocked) methods with nullable return type
+* Removed extracting getter methods of object instances
+* BC BREAK - Remove implicit regex matching when trying to match string arguments, introduce `\Mockery::pattern()` when regex matching is needed
+* Fix Mockery not getting closed in cases of failing test cases
+* Fix Mockery not setting properties on overloaded instance mocks
+* BC BREAK - Fix Mockery not trying default expectations if there is any concrete expectation
+* BC BREAK - Mockery's PHPUnit integration will mark a test as risky if it
+ thinks one it's exceptions has been swallowed in PHPUnit > 5.7.6. Use `$e->dismiss()` to dismiss.
+
+## 0.9.4 (XXXX-XX-XX)
+
+* `shouldIgnoreMissing` will respect global `allowMockingNonExistentMethods`
+ config
+* Some support for variadic parameters
+* Hamcrest is now a required dependency
+* Instance mocks now respect `shouldIgnoreMissing` call on control instance
+* This will be the *last version to support PHP 5.3*
+* Added `Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration` trait
+* Added `makePartial` to `Mockery\MockInterface` as it was missing
+
+## 0.9.3 (2014-12-22)
+
+* Added a basic spy implementation
+* Added `Mockery\Adapter\Phpunit\MockeryTestCase` for more reliable PHPUnit
+ integration
+
+## 0.9.2 (2014-09-03)
+
+* Some workarounds for the serialisation problems created by changes to PHP in 5.5.13, 5.4.29,
+ 5.6.
+* Demeter chains attempt to reuse doubles as they see fit, so for foo->bar and
+ foo->baz, we'll attempt to use the same foo
+
+## 0.9.1 (2014-05-02)
+
+* Allow specifying consecutive exceptions to be thrown with `andThrowExceptions`
+* Allow specifying methods which can be mocked when using
+ `Mockery\Configuration::allowMockingNonExistentMethods(false)` with
+ `Mockery\MockInterface::shouldAllowMockingMethod($methodName)`
+* Added andReturnSelf method: `$mock->shouldReceive("foo")->andReturnSelf()`
+* `shouldIgnoreMissing` now takes an optional value that will be return instead
+ of null, e.g. `$mock->shouldIgnoreMissing($mock)`
+
+## 0.9.0 (2014-02-05)
+
+* Allow mocking classes with final __wakeup() method
+* Quick definitions are now always `byDefault`
+* Allow mocking of protected methods with `shouldAllowMockingProtectedMethods`
+* Support official Hamcrest package
+* Generator completely rewritten
+* Easily create named mocks with namedMock
diff --git a/vendor/mockery/mockery/CONTRIBUTING.md b/vendor/mockery/mockery/CONTRIBUTING.md
new file mode 100644
index 000000000..b714f3f44
--- /dev/null
+++ b/vendor/mockery/mockery/CONTRIBUTING.md
@@ -0,0 +1,88 @@
+# Contributing
+
+
+We'd love you to help out with mockery and no contribution is too small.
+
+
+## Reporting Bugs
+
+Issues can be reported on the [issue
+tracker](https://github.com/padraic/mockery/issues). Please try and report any
+bugs with a minimal reproducible example, it will make things easier for other
+contributors and your problems will hopefully be resolved quickly.
+
+
+## Requesting Features
+
+We're always interested to hear about your ideas and you can request features by
+creating a ticket in the [issue
+tracker](https://github.com/padraic/mockery/issues). We can't always guarantee
+someone will jump on it straight away, but putting it out there to see if anyone
+else is interested is a good idea.
+
+Likewise, if a feature you would like is already listed in
+the issue tracker, add a :+1: so that other contributors know it's a feature
+that would help others.
+
+
+## Contributing code and documentation
+
+We loosely follow the
+[PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
+and
+[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standards,
+but we'll probably merge any code that looks close enough.
+
+* Fork the [repository](https://github.com/padraic/mockery) on GitHub
+* Add the code for your feature or bug
+* Add some tests for your feature or bug
+* Optionally, but preferably, write some documentation
+* Optionally, update the CHANGELOG.md file with your feature or
+ [BC](http://en.wikipedia.org/wiki/Backward_compatibility) break
+* Send a [Pull
+ Request](https://help.github.com/articles/creating-a-pull-request) to the
+ correct target branch (see below)
+
+If you have a big change or would like to discuss something, create an issue in
+the [issue tracker](https://github.com/padraic/mockery/issues) or jump in to
+\#mockery on freenode
+
+
+Any code you contribute must be licensed under the [BSD 3-Clause
+License](http://opensource.org/licenses/BSD-3-Clause).
+
+
+## Target Branch
+
+Mockery may have several active branches at any one time and roughly follows a
+[Git Branching Model](https://igor.io/2013/10/21/git-branching-model.html).
+Generally, if you're developing a new feature, you want to be targeting the
+master branch, if it's a bug fix, you want to be targeting a release branch,
+e.g. 0.8.
+
+
+## Testing Mockery
+
+To run the unit tests for Mockery, clone the git repository, download Composer using
+the instructions at [http://getcomposer.org/download/](http://getcomposer.org/download/),
+then install the dependencies with `php /path/to/composer.phar install`.
+
+This will install the required PHPUnit and Hamcrest dev dependencies and create the
+autoload files required by the unit tests. You may run the `vendor/bin/phpunit` command
+to run the unit tests. If everything goes to plan, there will be no failed tests!
+
+
+## Debugging Mockery
+
+Mockery and its code generation can be difficult to debug. A good start is to
+use the `RequireLoader`, which will dump the code generated by mockery to a file
+before requiring it, rather than using eval. This will help with stack traces,
+and you will be able to open the mock class in your editor.
+
+``` php
+
+// tests/bootstrap.php
+
+Mockery::setLoader(new Mockery\Loader\RequireLoader(sys_get_temp_dir()));
+
+```
diff --git a/vendor/mockery/mockery/LICENSE b/vendor/mockery/mockery/LICENSE
new file mode 100644
index 000000000..2e127a651
--- /dev/null
+++ b/vendor/mockery/mockery/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2010, Pádraic Brady
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * The name of Pádraic Brady may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/mockery/mockery/Makefile b/vendor/mockery/mockery/Makefile
new file mode 100644
index 000000000..c312f705e
--- /dev/null
+++ b/vendor/mockery/mockery/Makefile
@@ -0,0 +1,52 @@
+vendor/composer/installed.json: composer.json
+ composer install
+
+.PHONY: deps
+deps: vendor/composer/installed.json
+
+.PHONY: test
+test: deps
+ php vendor/bin/phpunit
+
+.PHONY: apidocs
+apidocs: docs/api/index.html
+
+phpDocumentor.phar:
+ wget https://github.com/phpDocumentor/phpDocumentor2/releases/download/v3.0.0-alpha.2-nightly-gdff5545/phpDocumentor.phar
+ wget https://github.com/phpDocumentor/phpDocumentor2/releases/download/v3.0.0-alpha.2-nightly-gdff5545/phpDocumentor.phar.pubkey
+
+library_files=$(shell find library -name '*.php')
+docs/api/index.html: vendor/composer/installed.json $(library_files) phpDocumentor.phar
+ php phpDocumentor.phar run -d library -t docs/api
+
+.PHONY: test-all
+test-all: test-72 test-71 test-70 test-56
+
+.PHONY: test-all-7
+test-all-7: test-72 test-71 test-70
+
+.PHONY: test-72
+test-72: deps
+ docker run -it --rm -v "$$PWD":/opt/mockery -w /opt/mockery php:7.2-cli php vendor/bin/phpunit
+
+.PHONY: test-71
+test-71: deps
+ docker run -it --rm -v "$$PWD":/opt/mockery -w /opt/mockery php:7.1-cli php vendor/bin/phpunit
+
+.PHONY: test-70
+test-70: deps
+ docker run -it --rm -v "$$PWD":/opt/mockery -w /opt/mockery php:7.0-cli php vendor/bin/phpunit
+
+.PHONY: test-56
+test-56: build56
+ docker run -it --rm \
+ -v "$$PWD/library":/opt/mockery/library \
+ -v "$$PWD/tests":/opt/mockery/tests \
+ -v "$$PWD/phpunit.xml.dist":/opt/mockery/phpunit.xml \
+ -w /opt/mockery \
+ mockery_php56 \
+ php vendor/bin/phpunit
+
+.PHONY: build56
+build56:
+ docker build -t mockery_php56 -f "$$PWD/docker/php56/Dockerfile" .
diff --git a/vendor/mockery/mockery/README.md b/vendor/mockery/mockery/README.md
new file mode 100644
index 000000000..b346f4b0c
--- /dev/null
+++ b/vendor/mockery/mockery/README.md
@@ -0,0 +1,299 @@
+Mockery
+=======
+
+[![Build Status](https://travis-ci.org/mockery/mockery.svg?branch=master)](https://travis-ci.org/mockery/mockery)
+[![Latest Stable Version](https://poser.pugx.org/mockery/mockery/v/stable.svg)](https://packagist.org/packages/mockery/mockery)
+[![Coverage Status](https://coveralls.io/repos/github/mockery/mockery/badge.svg)](https://coveralls.io/github/mockery/mockery)
+[![Total Downloads](https://poser.pugx.org/mockery/mockery/downloads.svg)](https://packagist.org/packages/mockery/mockery)
+
+Mockery is a simple yet flexible PHP mock object framework for use in unit testing
+with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a
+test double framework with a succinct API capable of clearly defining all possible
+object operations and interactions using a human readable Domain Specific Language
+(DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library,
+Mockery is easy to integrate with PHPUnit and can operate alongside
+phpunit-mock-objects without the World ending.
+
+Mockery is released under a New BSD License.
+
+## Installation
+
+To install Mockery, run the command below and you will get the latest
+version
+
+```sh
+composer require --dev mockery/mockery
+```
+
+## Documentation
+
+In older versions, this README file was the documentation for Mockery. Over time
+we have improved this, and have created an extensive documentation for you. Please
+use this README file as a starting point for Mockery, but do read the documentation
+to learn how to use Mockery.
+
+The current version can be seen at [docs.mockery.io](http://docs.mockery.io).
+
+## Test Doubles
+
+Test doubles (often called mocks) simulate the behaviour of real objects. They are
+commonly utilised to offer test isolation, to stand in for objects which do not
+yet exist, or to allow for the exploratory design of class APIs without
+requiring actual implementation up front.
+
+The benefits of a test double framework are to allow for the flexible generation
+and configuration of test doubles. They allow the setting of expected method calls
+and/or return values using a flexible API which is capable of capturing every
+possible real object behaviour in way that is stated as close as possible to a
+natural language description. Use the `Mockery::mock` method to create a test
+double.
+
+``` php
+$double = Mockery::mock();
+```
+
+If you need Mockery to create a test double to satisfy a particular type hint,
+you can pass the type to the `mock` method.
+
+``` php
+class Book {}
+
+interface BookRepository {
+ function find($id): Book;
+ function findAll(): array;
+ function add(Book $book): void;
+}
+
+$double = Mockery::mock(BookRepository::class);
+```
+
+A detailed explanation of creating and working with test doubles is given in the
+documentation, [Creating test doubles](http://docs.mockery.io/en/latest/reference/creating_test_doubles.html)
+section.
+
+## Method Stubs 🎫
+
+A method stub is a mechanism for having your test double return canned responses
+to certain method calls. With stubs, you don't care how many times, if at all,
+the method is called. Stubs are used to provide indirect input to the system
+under test.
+
+``` php
+$double->allows()->find(123)->andReturns(new Book());
+
+$book = $double->find(123);
+```
+
+If you have used Mockery before, you might see something new in the example
+above — we created a method stub using `allows`, instead of the "old"
+`shouldReceive` syntax. This is a new feature of Mockery v1, but fear not,
+the trusty ol' `shouldReceive` is still here.
+
+For new users of Mockery, the above example can also be written as:
+
+``` php
+$double->shouldReceive('find')->with(123)->andReturn(new Book());
+$book = $double->find(123);
+```
+
+If your stub doesn't require specific arguments, you can also use this shortcut
+for setting up multiple calls at once:
+
+``` php
+$double->allows([
+ "findAll" => [new Book(), new Book()],
+]);
+```
+
+or
+
+``` php
+$double->shouldReceive('findAll')
+ ->andReturn([new Book(), new Book()]);
+```
+
+You can also use this shortcut, which creates a double and sets up some stubs in
+one call:
+
+``` php
+$double = Mockery::mock(BookRepository::class, [
+ "findAll" => [new Book(), new Book()],
+]);
+```
+
+## Method Call Expectations 📲
+
+A Method call expectation is a mechanism to allow you to verify that a
+particular method has been called. You can specify the parameters and you can
+also specify how many times you expect it to be called. Method call expectations
+are used to verify indirect output of the system under test.
+
+``` php
+$book = new Book();
+
+$double = Mockery::mock(BookRepository::class);
+$double->expects()->add($book);
+```
+
+During the test, Mockery accept calls to the `add` method as prescribed.
+After you have finished exercising the system under test, you need to
+tell Mockery to check that the method was called as expected, using the
+`Mockery::close` method. One way to do that is to add it to your `tearDown`
+method in PHPUnit.
+
+``` php
+
+public function tearDown()
+{
+ Mockery::close();
+}
+```
+
+The `expects()` method automatically sets up an expectation that the method call
+(and matching parameters) is called **once and once only**. You can choose to change
+this if you are expecting more calls.
+
+``` php
+$double->expects()->add($book)->twice();
+```
+
+If you have used Mockery before, you might see something new in the example
+above — we created a method expectation using `expects`, instead of the "old"
+`shouldReceive` syntax. This is a new feature of Mockery v1, but same as with
+`accepts` in the previous section, it can be written in the "old" style.
+
+For new users of Mockery, the above example can also be written as:
+
+``` php
+$double->shouldReceive('find')
+ ->with(123)
+ ->once()
+ ->andReturn(new Book());
+$book = $double->find(123);
+```
+
+A detailed explanation of declaring expectations on method calls, please
+read the documentation, the [Expectation declarations](http://docs.mockery.io/en/latest/reference/expectations.html)
+section. After that, you can also learn about the new `allows` and `expects` methods
+in the [Alternative shouldReceive syntax](http://docs.mockery.io/en/latest/reference/alternative_should_receive_syntax.html)
+section.
+
+It is worth mentioning that one way of setting up expectations is no better or worse
+than the other. Under the hood, `allows` and `expects` are doing the same thing as
+`shouldReceive`, at times in "less words", and as such it comes to a personal preference
+of the programmer which way to use.
+
+## Test Spies 🕵️
+
+By default, all test doubles created with the `Mockery::mock` method will only
+accept calls that they have been configured to `allow` or `expect` (or in other words,
+calls that they `shouldReceive`). Sometimes we don't necessarily care about all of the
+calls that are going to be made to an object. To facilitate this, we can tell Mockery
+to ignore any calls it has not been told to expect or allow. To do so, we can tell a
+test double `shouldIgnoreMissing`, or we can create the double using the `Mocker::spy`
+shortcut.
+
+``` php
+// $double = Mockery::mock()->shouldIgnoreMissing();
+$double = Mockery::spy();
+
+$double->foo(); // null
+$double->bar(); // null
+```
+
+Further to this, sometimes we want to have the object accept any call during the test execution
+and then verify the calls afterwards. For these purposes, we need our test
+double to act as a Spy. All mockery test doubles record the calls that are made
+to them for verification afterwards by default:
+
+``` php
+$double->baz(123);
+
+$double->shouldHaveReceived()->baz(123); // null
+$double->shouldHaveReceived()->baz(12345); // Uncaught Exception Mockery\Exception\InvalidCountException...
+```
+
+Please refer to the [Spies](http://docs.mockery.io/en/latest/reference/spies.html) section
+of the documentation to learn more about the spies.
+
+## Utilities 🔌
+
+### Global Helpers
+
+Mockery ships with a handful of global helper methods, you just need to ask
+Mockery to declare them.
+
+``` php
+Mockery::globalHelpers();
+
+$mock = mock(Some::class);
+$spy = spy(Some::class);
+
+$spy->shouldHaveReceived()
+ ->foo(anyArgs());
+```
+
+All of the global helpers are wrapped in a `!function_exists` call to avoid
+conflicts. So if you already have a global function called `spy`, Mockery will
+silently skip the declaring its own `spy` function.
+
+### Testing Traits
+
+As Mockery ships with code generation capabilities, it was trivial to add
+functionality allowing users to create objects on the fly that use particular
+traits. Any abstract methods defined by the trait will be created and can have
+expectations or stubs configured like normal Test Doubles.
+
+``` php
+trait Foo {
+ function foo() {
+ return $this->doFoo();
+ }
+
+ abstract function doFoo();
+}
+
+$double = Mockery::mock(Foo::class);
+$double->allows()->doFoo()->andReturns(123);
+$double->foo(); // int(123)
+```
+
+### Testing the constructor arguments of hard Dependencies
+
+See [Mocking hard dependencies](http://docs.mockery.io/en/latest/cookbook/mocking_hard_dependencies.html)
+
+``` php
+$implementationMock = Mockery::mock('overload:\Some\Implementation');
+
+$implementationMock->shouldReceive('__construct')
+ ->once()
+ ->with(['host' => 'localhost]);
+// add other expectations as usual
+
+$implementation = new \Some\Implementation(['host' => 'localhost']);
+```
+
+## Versioning
+
+The Mockery team attempts to adhere to [Semantic Versioning](http://semver.org),
+however, some of Mockery's internals are considered private and will be open to
+change at any time. Just because a class isn't final, or a method isn't marked
+private, does not mean it constitutes part of the API we guarantee under the
+versioning scheme.
+
+### Alternative Runtimes
+
+Mockery will attempt to continue support HHVM, but will not make any guarantees.
+
+## A new home for Mockery
+
+⚠️️ Update your remotes! Mockery has transferred to a new location. While it was once
+at `padraic/mockery`, it is now at `mockery/mockery`. While your
+existing repositories will redirect transparently for any operations, take some
+time to transition to the new URL.
+```sh
+$ git remote set-url upstream https://github.com/mockery/mockery.git
+```
+Replace `upstream` with the name of the remote you use locally; `upstream` is commonly
+used but you may be using something else. Run `git remote -v` to see what you're actually
+using.
diff --git a/vendor/mockery/mockery/composer.json b/vendor/mockery/mockery/composer.json
new file mode 100644
index 000000000..4d7c96c29
--- /dev/null
+++ b/vendor/mockery/mockery/composer.json
@@ -0,0 +1,56 @@
+{
+ "name": "mockery/mockery",
+ "description": "Mockery is a simple yet flexible PHP mock object framework",
+ "scripts": {
+ "docs": "phpdoc -d library -t docs/api"
+ },
+ "keywords": [
+ "bdd",
+ "library",
+ "mock",
+ "mock objects",
+ "mockery",
+ "stub",
+ "tdd",
+ "test",
+ "test double",
+ "testing"
+ ],
+ "homepage": "https://github.com/mockery/mockery",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Pádraic Brady",
+ "email": "padraic.brady@gmail.com",
+ "homepage": "http://blog.astrumfutura.com"
+ },
+ {
+ "name": "Dave Marshall",
+ "email": "dave.marshall@atstsolutions.co.uk",
+ "homepage": "http://davedevelopment.co.uk"
+ }
+ ],
+ "require": {
+ "php": ">=5.6.0",
+ "lib-pcre": ">=7.0",
+ "hamcrest/hamcrest-php": "~2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~5.7.10|~6.5|~7.0"
+ },
+ "autoload": {
+ "psr-0": {
+ "Mockery": "library/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "test\\": "tests/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/vendor/mockery/mockery/docker/php56/Dockerfile b/vendor/mockery/mockery/docker/php56/Dockerfile
new file mode 100644
index 000000000..264c5c036
--- /dev/null
+++ b/vendor/mockery/mockery/docker/php56/Dockerfile
@@ -0,0 +1,14 @@
+FROM php:5.6-cli
+
+RUN apt-get update && \
+ apt-get install -y git zip unzip && \
+ apt-get -y autoremove && \
+ apt-get clean && \
+ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+WORKDIR /opt/mockery
+
+COPY composer.json ./
+
+RUN composer install
diff --git a/vendor/mockery/mockery/docs/.gitignore b/vendor/mockery/mockery/docs/.gitignore
new file mode 100644
index 000000000..e35d8850c
--- /dev/null
+++ b/vendor/mockery/mockery/docs/.gitignore
@@ -0,0 +1 @@
+_build
diff --git a/vendor/mockery/mockery/docs/Makefile b/vendor/mockery/mockery/docs/Makefile
new file mode 100644
index 000000000..9a8c94087
--- /dev/null
+++ b/vendor/mockery/mockery/docs/Makefile
@@ -0,0 +1,177 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# User-friendly check for sphinx-build
+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
+endif
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+ @echo "Please use \`make ' where is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " xml to make Docutils-native XML files"
+ @echo " pseudoxml to make pseudoxml-XML files for display purposes"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MockeryDocs.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MockeryDocs.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/MockeryDocs"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MockeryDocs"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+latexpdfja:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through platex and dvipdfmx..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
+
+xml:
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+ @echo
+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+pseudoxml:
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+ @echo
+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff --git a/vendor/mockery/mockery/docs/README.md b/vendor/mockery/mockery/docs/README.md
new file mode 100644
index 000000000..63ca69db7
--- /dev/null
+++ b/vendor/mockery/mockery/docs/README.md
@@ -0,0 +1,4 @@
+mockery-docs
+============
+
+Document for the PHP Mockery framework on readthedocs.org
\ No newline at end of file
diff --git a/vendor/mockery/mockery/docs/conf.py b/vendor/mockery/mockery/docs/conf.py
new file mode 100644
index 000000000..901f04056
--- /dev/null
+++ b/vendor/mockery/mockery/docs/conf.py
@@ -0,0 +1,267 @@
+# -*- coding: utf-8 -*-
+#
+# Mockery Docs documentation build configuration file, created by
+# sphinx-quickstart on Mon Mar 3 14:04:26 2014.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+ 'sphinx.ext.todo',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'Mockery Docs'
+copyright = u'Pádraic Brady, Dave Marshall and contributors'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '1.0'
+# The full version, including alpha/beta/rc tags.
+release = '1.0-alpha'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#html_extra_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'MockeryDocsdoc'
+
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ ('index', 'MockeryDocs.tex', u'Mockery Docs Documentation',
+ u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'mockerydocs', u'Mockery Docs Documentation',
+ [u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'MockeryDocs', u'Mockery Docs Documentation',
+ u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell', 'MockeryDocs', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#texinfo_no_detailmenu = False
+
+
+#on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+if not on_rtd: # only import and set the theme if we're building docs locally
+ import sphinx_rtd_theme
+ html_theme = 'sphinx_rtd_theme'
+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+ print sphinx_rtd_theme.get_html_theme_path()
+
+# load PhpLexer
+from sphinx.highlighting import lexers
+from pygments.lexers.web import PhpLexer
+
+# enable highlighting for PHP code not between by default
+lexers['php'] = PhpLexer(startinline=True)
+lexers['php-annotations'] = PhpLexer(startinline=True)
diff --git a/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst b/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst
new file mode 100644
index 000000000..a27d5327c
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst
@@ -0,0 +1,52 @@
+.. index::
+ single: Cookbook; Big Parent Class
+
+Big Parent Class
+================
+
+In some application code, especially older legacy code, we can come across some
+classes that extend a "big parent class" - a parent class that knows and does
+too much:
+
+.. code-block:: php
+
+ class BigParentClass
+ {
+ public function doesEverything()
+ {
+ // sets up database connections
+ // writes to log files
+ }
+ }
+
+ class ChildClass extends BigParentClass
+ {
+ public function doesOneThing()
+ {
+ // but calls on BigParentClass methods
+ $result = $this->doesEverything();
+ // does something with $result
+ return $result;
+ }
+ }
+
+We want to test our ``ChildClass`` and its ``doesOneThing`` method, but the
+problem is that it calls on ``BigParentClass::doesEverything()``. One way to
+handle this would be to mock out **all** of the dependencies ``BigParentClass``
+has and needs, and then finally actually test our ``doesOneThing`` method. It's
+an awful lot of work to do that.
+
+What we can do, is to do something... unconventional. We can create a runtime
+partial test double of the ``ChildClass`` itself and mock only the parent's
+``doesEverything()`` method:
+
+.. code-block:: php
+
+ $childClass = \Mockery::mock('ChildClass')->makePartial();
+ $childClass->shouldReceive('doesEverything')
+ ->andReturn('some result from parent');
+
+ $childClass->doesOneThing(); // string("some result from parent");
+
+With this approach we mock out only the ``doesEverything()`` method, and all the
+unmocked methods are called on the actual ``ChildClass`` instance.
diff --git a/vendor/mockery/mockery/docs/cookbook/class_constants.rst b/vendor/mockery/mockery/docs/cookbook/class_constants.rst
new file mode 100644
index 000000000..0d13dd207
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/class_constants.rst
@@ -0,0 +1,183 @@
+.. index::
+ single: Cookbook; Class Constants
+
+Class Constants
+===============
+
+When creating a test double for a class, Mockery does not create stubs out of
+any class constants defined in the class we are mocking. Sometimes though, the
+non-existence of these class constants, setup of the test, and the application
+code itself, it can lead to undesired behavior, and even a PHP error:
+``PHP Fatal error: Uncaught Error: Undefined class constant 'FOO' in ...```
+
+While supporting class constants in Mockery would be possible, it does require
+an awful lot of work, for a small number of use cases.
+
+Named Mocks
+-----------
+
+We can, however, deal with these constants in a way supported by Mockery - by
+using :ref:`creating-test-doubles-named-mocks`.
+
+A named mock is a test double that has a name of the class we want to mock, but
+under it is a stubbed out class that mimics the real class with canned responses.
+
+Lets look at the following made up, but not impossible scenario:
+
+.. code-block:: php
+
+ class Fetcher
+ {
+ const SUCCESS = 0;
+ const FAILURE = 1;
+
+ public static function fetch()
+ {
+ // Fetcher gets something for us from somewhere...
+ return self::SUCCESS;
+ }
+ }
+
+ class MyClass
+ {
+ public function doFetching()
+ {
+ $response = Fetcher::fetch();
+
+ if ($response == Fetcher::SUCCESS) {
+ echo "Thanks!" . PHP_EOL;
+ } else {
+ echo "Try again!" . PHP_EOL;
+ }
+ }
+ }
+
+Our ``MyClass`` calls a ``Fetcher`` that fetches some resource from somewhere -
+maybe it downloads a file from a remote web service. Our ``MyClass`` prints out
+a response message depending on the response from the ``Fetcher::fetch()`` call.
+
+When testing ``MyClass`` we don't really want ``Fetcher`` to go and download
+random stuff from the internet every time we run our test suite. So we mock it
+out:
+
+.. code-block:: php
+
+ // Using alias: because fetch is called statically!
+ \Mockery::mock('alias:Fetcher')
+ ->shouldReceive('fetch')
+ ->andReturn(0);
+
+ $myClass = new MyClass();
+ $myClass->doFetching();
+
+If we run this, our test will error out with a nasty
+``PHP Fatal error: Uncaught Error: Undefined class constant 'SUCCESS' in ..``.
+
+Here's how a ``namedMock()`` can help us in a situation like this.
+
+We create a stub for the ``Fetcher`` class, stubbing out the class constants,
+and then use ``namedMock()`` to create a mock named ``Fetcher`` based on our
+stub:
+
+.. code-block:: php
+
+ class FetcherStub
+ {
+ const SUCCESS = 0;
+ const FAILURE = 1;
+ }
+
+ \Mockery::mock('Fetcher', 'FetcherStub')
+ ->shouldReceive('fetch')
+ ->andReturn(0);
+
+ $myClass = new MyClass();
+ $myClass->doFetching();
+
+This works because under the hood, Mockery creates a class called ``Fetcher``
+that extends ``FetcherStub``.
+
+The same approach will work even if ``Fetcher::fetch()`` is not a static
+dependency:
+
+.. code-block:: php
+
+ class Fetcher
+ {
+ const SUCCESS = 0;
+ const FAILURE = 1;
+
+ public function fetch()
+ {
+ // Fetcher gets something for us from somewhere...
+ return self::SUCCESS;
+ }
+ }
+
+ class MyClass
+ {
+ public function doFetching($fetcher)
+ {
+ $response = $fetcher->fetch();
+
+ if ($response == Fetcher::SUCCESS) {
+ echo "Thanks!" . PHP_EOL;
+ } else {
+ echo "Try again!" . PHP_EOL;
+ }
+ }
+ }
+
+And the test will have something like this:
+
+.. code-block:: php
+
+ class FetcherStub
+ {
+ const SUCCESS = 0;
+ const FAILURE = 1;
+ }
+
+ $mock = \Mockery::mock('Fetcher', 'FetcherStub')
+ $mock->shouldReceive('fetch')
+ ->andReturn(0);
+
+ $myClass = new MyClass();
+ $myClass->doFetching($mock);
+
+
+Constants Map
+-------------
+
+Another way of mocking class constants can be with the use of the constants map configuration.
+
+Given a class with constants:
+
+.. code-block:: php
+
+ class Fetcher
+ {
+ const SUCCESS = 0;
+ const FAILURE = 1;
+
+ public function fetch()
+ {
+ // Fetcher gets something for us from somewhere...
+ return self::SUCCESS;
+ }
+ }
+
+It can be mocked with:
+
+.. code-block:: php
+
+ \Mockery::getConfiguration()->setConstantsMap([
+ 'Fetcher' => [
+ 'SUCCESS' => 'success',
+ 'FAILURE' => 'fail',
+ ]
+ ]);
+
+ $mock = \Mockery::mock('Fetcher');
+ var_dump($mock::SUCCESS); // (string) 'success'
+ var_dump($mock::FAILURE); // (string) 'fail'
diff --git a/vendor/mockery/mockery/docs/cookbook/default_expectations.rst b/vendor/mockery/mockery/docs/cookbook/default_expectations.rst
new file mode 100644
index 000000000..2c6fcae23
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/default_expectations.rst
@@ -0,0 +1,17 @@
+.. index::
+ single: Cookbook; Default Mock Expectations
+
+Default Mock Expectations
+=========================
+
+Often in unit testing, we end up with sets of tests which use the same object
+dependency over and over again. Rather than mocking this class/object within
+every single unit test (requiring a mountain of duplicate code), we can
+instead define reusable default mocks within the test case's ``setup()``
+method. This even works where unit tests use varying expectations on the same
+or similar mock object.
+
+How this works, is that you can define mocks with default expectations. Then,
+in a later unit test, you can add or fine-tune expectations for that specific
+test. Any expectation can be set as a default using the ``byDefault()``
+declaration.
diff --git a/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst b/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst
new file mode 100644
index 000000000..0210c692b
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst
@@ -0,0 +1,13 @@
+.. index::
+ single: Cookbook; Detecting Mock Objects
+
+Detecting Mock Objects
+======================
+
+Users may find it useful to check whether a given object is a real object or a
+simulated Mock Object. All Mockery mocks implement the
+``\Mockery\MockInterface`` interface which can be used in a type check.
+
+.. code-block:: php
+
+ assert($mightBeMocked instanceof \Mockery\MockInterface);
diff --git a/vendor/mockery/mockery/docs/cookbook/index.rst b/vendor/mockery/mockery/docs/cookbook/index.rst
new file mode 100644
index 000000000..48acbab07
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/index.rst
@@ -0,0 +1,15 @@
+Cookbook
+========
+
+.. toctree::
+ :hidden:
+
+ default_expectations
+ detecting_mock_objects
+ not_calling_the_constructor
+ mocking_hard_dependencies
+ class_constants
+ big_parent_class
+ mockery_on
+
+.. include:: map.rst.inc
diff --git a/vendor/mockery/mockery/docs/cookbook/map.rst.inc b/vendor/mockery/mockery/docs/cookbook/map.rst.inc
new file mode 100644
index 000000000..c9dd99efe
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/map.rst.inc
@@ -0,0 +1,7 @@
+* :doc:`/cookbook/default_expectations`
+* :doc:`/cookbook/detecting_mock_objects`
+* :doc:`/cookbook/not_calling_the_constructor`
+* :doc:`/cookbook/mocking_hard_dependencies`
+* :doc:`/cookbook/class_constants`
+* :doc:`/cookbook/big_parent_class`
+* :doc:`/cookbook/mockery_on`
diff --git a/vendor/mockery/mockery/docs/cookbook/mockery_on.rst b/vendor/mockery/mockery/docs/cookbook/mockery_on.rst
new file mode 100644
index 000000000..631f1241c
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/mockery_on.rst
@@ -0,0 +1,85 @@
+.. index::
+ single: Cookbook; Complex Argument Matching With Mockery::on
+
+Complex Argument Matching With Mockery::on
+==========================================
+
+When we need to do a more complex argument matching for an expected method call,
+the ``\Mockery::on()`` matcher comes in really handy. It accepts a closure as an
+argument and that closure in turn receives the argument passed in to the method,
+when called. If the closure returns ``true``, Mockery will consider that the
+argument has passed the expectation. If the closure returns ``false``, or a
+"falsey" value, the expectation will not pass.
+
+The ``\Mockery::on()`` matcher can be used in various scenarios — validating
+an array argument based on multiple keys and values, complex string matching...
+
+Say, for example, we have the following code. It doesn't do much; publishes a
+post by setting the ``published`` flag in the database to ``1`` and sets the
+``published_at`` to the current date and time:
+
+.. code-block:: php
+
+ model = $model;
+ }
+
+ public function publishPost($id)
+ {
+ $saveData = [
+ 'post_id' => $id,
+ 'published' => 1,
+ 'published_at' => gmdate('Y-m-d H:i:s'),
+ ];
+ $this->model->save($saveData);
+ }
+ }
+
+In a test we would mock the model and set some expectations on the call of the
+``save()`` method:
+
+.. code-block:: php
+
+ shouldReceive('save')
+ ->once()
+ ->with(\Mockery::on(function ($argument) use ($postId) {
+ $postIdIsSet = isset($argument['post_id']) && $argument['post_id'] === $postId;
+ $publishedFlagIsSet = isset($argument['published']) && $argument['published'] === 1;
+ $publishedAtIsSet = isset($argument['published_at']);
+
+ return $postIdIsSet && $publishedFlagIsSet && $publishedAtIsSet;
+ }));
+
+ $service = new \Service\Post($modelMock);
+ $service->publishPost($postId);
+
+ \Mockery::close();
+
+The important part of the example is inside the closure we pass to the
+``\Mockery::on()`` matcher. The ``$argument`` is actually the ``$saveData`` argument
+the ``save()`` method gets when it is called. We check for a couple of things in
+this argument:
+
+* the post ID is set, and is same as the post ID we passed in to the
+ ``publishPost()`` method,
+* the ``published`` flag is set, and is ``1``, and
+* the ``published_at`` key is present.
+
+If any of these requirements is not satisfied, the closure will return ``false``,
+the method call expectation will not be met, and Mockery will throw a
+``NoMatchingExpectationException``.
+
+.. note::
+
+ This cookbook entry is an adaption of the blog post titled
+ `"Complex argument matching in Mockery" `_,
+ published by Robert Basic on his blog.
diff --git a/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst b/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst
new file mode 100644
index 000000000..b9381fdf3
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst
@@ -0,0 +1,99 @@
+.. index::
+ single: Cookbook; Mocking Hard Dependencies
+
+Mocking Hard Dependencies (new Keyword)
+=======================================
+
+One prerequisite to mock hard dependencies is that the code we are trying to test uses autoloading.
+
+Let's take the following code for an example:
+
+.. code-block:: php
+
+ sendSomething($param);
+ return $externalService->getSomething();
+ }
+ }
+
+The way we can test this without doing any changes to the code itself is by creating :doc:`instance mocks ` by using the ``overload`` prefix.
+
+.. code-block:: php
+
+ shouldReceive('sendSomething')
+ ->once()
+ ->with($param);
+ $externalMock->shouldReceive('getSomething')
+ ->once()
+ ->andReturn('Tested!');
+
+ $service = new \App\Service();
+
+ $result = $service->callExternalService($param);
+
+ $this->assertSame('Tested!', $result);
+ }
+ }
+
+If we run this test now, it should pass. Mockery does its job and our ``App\Service`` will use the mocked external service instead of the real one.
+
+The problem with this is when we want to, for example, test the ``App\Service\External`` itself, or if we use that class somewhere else in our tests.
+
+When Mockery overloads a class, because of how PHP works with files, that overloaded class file must not be included otherwise Mockery will throw a "class already exists" exception. This is where autoloading kicks in and makes our job a lot easier.
+
+To make this possible, we'll tell PHPUnit to run the tests that have overloaded classes in separate processes and to not preserve global state. That way we'll avoid having the overloaded class included more than once. Of course this has its downsides as these tests will run slower.
+
+Our test example from above now becomes:
+
+.. code-block:: php
+
+ shouldReceive('sendSomething')
+ ->once()
+ ->with($param);
+ $externalMock->shouldReceive('getSomething')
+ ->once()
+ ->andReturn('Tested!');
+
+ $service = new \App\Service();
+
+ $result = $service->callExternalService($param);
+
+ $this->assertSame('Tested!', $result);
+ }
+ }
+
+.. note::
+
+ This cookbook entry is an adaption of the blog post titled
+ `"Mocking hard dependencies with Mockery" `_,
+ published by Robert Basic on his blog.
diff --git a/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst b/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst
new file mode 100644
index 000000000..b8157ae3c
--- /dev/null
+++ b/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst
@@ -0,0 +1,63 @@
+.. index::
+ single: Cookbook; Not Calling the Original Constructor
+
+Not Calling the Original Constructor
+====================================
+
+When creating generated partial test doubles, Mockery mocks out only the method
+which we specifically told it to. This means that the original constructor of
+the class we are mocking will be called.
+
+In some cases this is not a desired behavior, as the constructor might issue
+calls to other methods, or other object collaborators, and as such, can create
+undesired side-effects in the application's environment when running the tests.
+
+If this happens, we need to use runtime partial test doubles, as they don't
+call the original constructor.
+
+.. code-block:: php
+
+ class MyClass
+ {
+ public function __construct()
+ {
+ echo "Original constructor called." . PHP_EOL;
+ // Other side-effects can happen...
+ }
+ }
+
+ // This will print "Original constructor called."
+ $mock = \Mockery::mock('MyClass[foo]');
+
+A better approach is to use runtime partial doubles:
+
+.. code-block:: php
+
+ class MyClass
+ {
+ public function __construct()
+ {
+ echo "Original constructor called." . PHP_EOL;
+ // Other side-effects can happen...
+ }
+ }
+
+ // This will not print anything
+ $mock = \Mockery::mock('MyClass')->makePartial();
+ $mock->shouldReceive('foo');
+
+This is one of the reason why we don't recommend using generated partial test
+doubles, but if possible, always use the runtime partials.
+
+Read more about :ref:`creating-test-doubles-partial-test-doubles`.
+
+.. note::
+
+ The way generated partial test doubles work, is a BC break. If you use a
+ really old version of Mockery, it might behave in a way that the constructor
+ is not being called for these generated partials. In the case if you upgrade
+ to a more recent version of Mockery, you'll probably have to change your
+ tests to use runtime partials, instead of generated ones.
+
+ This change was introduced in early 2013, so it is highly unlikely that you
+ are using a Mockery from before that, so this should not be an issue.
diff --git a/vendor/mockery/mockery/docs/getting_started/index.rst b/vendor/mockery/mockery/docs/getting_started/index.rst
new file mode 100644
index 000000000..434755c86
--- /dev/null
+++ b/vendor/mockery/mockery/docs/getting_started/index.rst
@@ -0,0 +1,12 @@
+Getting Started
+===============
+
+.. toctree::
+ :hidden:
+
+ installation
+ upgrading
+ simple_example
+ quick_reference
+
+.. include:: map.rst.inc
diff --git a/vendor/mockery/mockery/docs/getting_started/installation.rst b/vendor/mockery/mockery/docs/getting_started/installation.rst
new file mode 100644
index 000000000..8019567f4
--- /dev/null
+++ b/vendor/mockery/mockery/docs/getting_started/installation.rst
@@ -0,0 +1,43 @@
+.. index::
+ single: Installation
+
+Installation
+============
+
+Mockery can be installed using Composer or by cloning it from its GitHub
+repository. These two options are outlined below.
+
+Composer
+--------
+
+You can read more about Composer on `getcomposer.org `_.
+To install Mockery using Composer, first install Composer for your project
+using the instructions on the `Composer download page `_.
+You can then define your development dependency on Mockery using the suggested
+parameters below. While every effort is made to keep the master branch stable,
+you may prefer to use the current stable version tag instead (use the
+``@stable`` tag).
+
+.. code-block:: json
+
+ {
+ "require-dev": {
+ "mockery/mockery": "dev-master"
+ }
+ }
+
+To install, you then may call:
+
+.. code-block:: bash
+
+ php composer.phar update
+
+This will install Mockery as a development dependency, meaning it won't be
+installed when using ``php composer.phar update --no-dev`` in production.
+
+Git
+---
+
+The Git repository hosts the development version in its master branch. You can
+install this using Composer by referencing ``dev-master`` as your preferred
+version in your project's ``composer.json`` file as the earlier example shows.
diff --git a/vendor/mockery/mockery/docs/getting_started/map.rst.inc b/vendor/mockery/mockery/docs/getting_started/map.rst.inc
new file mode 100644
index 000000000..1055945ba
--- /dev/null
+++ b/vendor/mockery/mockery/docs/getting_started/map.rst.inc
@@ -0,0 +1,4 @@
+* :doc:`/getting_started/installation`
+* :doc:`/getting_started/upgrading`
+* :doc:`/getting_started/simple_example`
+* :doc:`/getting_started/quick_reference`
diff --git a/vendor/mockery/mockery/docs/getting_started/quick_reference.rst b/vendor/mockery/mockery/docs/getting_started/quick_reference.rst
new file mode 100644
index 000000000..e729a850f
--- /dev/null
+++ b/vendor/mockery/mockery/docs/getting_started/quick_reference.rst
@@ -0,0 +1,200 @@
+.. index::
+ single: Quick Reference
+
+Quick Reference
+===============
+
+The purpose of this page is to give a quick and short overview of some of the
+most common Mockery features.
+
+Do read the :doc:`../reference/index` to learn about all the Mockery features.
+
+Integrate Mockery with PHPUnit, either by extending the ``MockeryTestCase``:
+
+.. code-block:: php
+
+ use \Mockery\Adapter\Phpunit\MockeryTestCase;
+
+ class MyTest extends MockeryTestCase
+ {
+ }
+
+or by using the ``MockeryPHPUnitIntegration`` trait:
+
+.. code-block:: php
+
+ use \PHPUnit\Framework\TestCase;
+ use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
+
+ class MyTest extends TestCase
+ {
+ use MockeryPHPUnitIntegration;
+ }
+
+Creating a test double:
+
+.. code-block:: php
+
+ $testDouble = \Mockery::mock('MyClass');
+
+Creating a test double that implements a certain interface:
+
+.. code-block:: php
+
+ $testDouble = \Mockery::mock('MyClass, MyInterface');
+
+Expecting a method to be called on a test double:
+
+.. code-block:: php
+
+ $testDouble = \Mockery::mock('MyClass');
+ $testDouble->shouldReceive('foo');
+
+Expecting a method to **not** be called on a test double:
+
+.. code-block:: php
+
+ $testDouble = \Mockery::mock('MyClass');
+ $testDouble->shouldNotReceive('foo');
+
+Expecting a method to be called on a test double, once, with a certain argument,
+and to return a value:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->once()
+ ->with($arg)
+ ->andReturn($returnValue);
+
+Expecting a method to be called on a test double and to return a different value
+for each successive call:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->andReturn(1, 2, 3);
+
+ $mock->foo(); // int(1);
+ $mock->foo(); // int(2);
+ $mock->foo(); // int(3);
+ $mock->foo(); // int(3);
+
+Creating a runtime partial test double:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass')->makePartial();
+
+Creating a spy:
+
+.. code-block:: php
+
+ $spy = \Mockery::spy('MyClass');
+
+Expecting that a spy should have received a method call:
+
+.. code-block:: php
+
+ $spy = \Mockery::spy('MyClass');
+
+ $spy->foo();
+
+ $spy->shouldHaveReceived()->foo();
+
+Not so simple examples
+^^^^^^^^^^^^^^^^^^^^^^
+
+Creating a mock object to return a sequence of values from a set of method
+calls:
+
+.. code-block:: php
+
+ use \Mockery\Adapter\Phpunit\MockeryTestCase;
+
+ class SimpleTest extends MockeryTestCase
+ {
+ public function testSimpleMock()
+ {
+ $mock = \Mockery::mock(array('pi' => 3.1416, 'e' => 2.71));
+ $this->assertEquals(3.1416, $mock->pi());
+ $this->assertEquals(2.71, $mock->e());
+ }
+ }
+
+Creating a mock object which returns a self-chaining Undefined object for a
+method call:
+
+.. code-block:: php
+
+ use \Mockery\Adapter\Phpunit\MockeryTestCase;
+
+ class UndefinedTest extends MockeryTestCase
+ {
+ public function testUndefinedValues()
+ {
+ $mock = \Mockery::mock('mymock');
+ $mock->shouldReceive('divideBy')->with(0)->andReturnUndefined();
+ $this->assertTrue($mock->divideBy(0) instanceof \Mockery\Undefined);
+ }
+ }
+
+Creating a mock object with multiple query calls and a single update call:
+
+.. code-block:: php
+
+ use \Mockery\Adapter\Phpunit\MockeryTestCase;
+
+ class DbTest extends MockeryTestCase
+ {
+ public function testDbAdapter()
+ {
+ $mock = \Mockery::mock('db');
+ $mock->shouldReceive('query')->andReturn(1, 2, 3);
+ $mock->shouldReceive('update')->with(5)->andReturn(NULL)->once();
+
+ // ... test code here using the mock
+ }
+ }
+
+Expecting all queries to be executed before any updates:
+
+.. code-block:: php
+
+ use \Mockery\Adapter\Phpunit\MockeryTestCase;
+
+ class DbTest extends MockeryTestCase
+ {
+ public function testQueryAndUpdateOrder()
+ {
+ $mock = \Mockery::mock('db');
+ $mock->shouldReceive('query')->andReturn(1, 2, 3)->ordered();
+ $mock->shouldReceive('update')->andReturn(NULL)->once()->ordered();
+
+ // ... test code here using the mock
+ }
+ }
+
+Creating a mock object where all queries occur after startup, but before finish,
+and where queries are expected with several different params:
+
+.. code-block:: php
+
+ use \Mockery\Adapter\Phpunit\MockeryTestCase;
+
+ class DbTest extends MockeryTestCase
+ {
+ public function testOrderedQueries()
+ {
+ $db = \Mockery::mock('db');
+ $db->shouldReceive('startup')->once()->ordered();
+ $db->shouldReceive('query')->with('CPWR')->andReturn(12.3)->once()->ordered('queries');
+ $db->shouldReceive('query')->with('MSFT')->andReturn(10.0)->once()->ordered('queries');
+ $db->shouldReceive('query')->with(\Mockery::pattern("/^....$/"))->andReturn(3.3)->atLeast()->once()->ordered('queries');
+ $db->shouldReceive('finish')->once()->ordered();
+
+ // ... test code here using the mock
+ }
+ }
diff --git a/vendor/mockery/mockery/docs/getting_started/simple_example.rst b/vendor/mockery/mockery/docs/getting_started/simple_example.rst
new file mode 100644
index 000000000..1fb252e4f
--- /dev/null
+++ b/vendor/mockery/mockery/docs/getting_started/simple_example.rst
@@ -0,0 +1,70 @@
+.. index::
+ single: Getting Started; Simple Example
+
+Simple Example
+==============
+
+Imagine we have a ``Temperature`` class which samples the temperature of a
+locale before reporting an average temperature. The data could come from a web
+service or any other data source, but we do not have such a class at present.
+We can, however, assume some basic interactions with such a class based on its
+interaction with the ``Temperature`` class:
+
+.. code-block:: php
+
+ class Temperature
+ {
+ private $service;
+
+ public function __construct($service)
+ {
+ $this->service = $service;
+ }
+
+ public function average()
+ {
+ $total = 0;
+ for ($i=0; $i<3; $i++) {
+ $total += $this->service->readTemp();
+ }
+ return $total/3;
+ }
+ }
+
+Even without an actual service class, we can see how we expect it to operate.
+When writing a test for the ``Temperature`` class, we can now substitute a
+mock object for the real service which allows us to test the behaviour of the
+``Temperature`` class without actually needing a concrete service instance.
+
+.. code-block:: php
+
+ use \Mockery;
+
+ class TemperatureTest extends PHPUnit_Framework_TestCase
+ {
+ public function tearDown()
+ {
+ Mockery::close();
+ }
+
+ public function testGetsAverageTemperatureFromThreeServiceReadings()
+ {
+ $service = Mockery::mock('service');
+ $service->shouldReceive('readTemp')
+ ->times(3)
+ ->andReturn(10, 12, 14);
+
+ $temperature = new Temperature($service);
+
+ $this->assertEquals(12, $temperature->average());
+ }
+ }
+
+We create a mock object which our ``Temperature`` class will use and set some
+expectations for that mock — that it should receive three calls to the ``readTemp``
+method, and these calls will return 10, 12, and 14 as results.
+
+.. note::
+
+ PHPUnit integration can remove the need for a ``tearDown()`` method. See
+ ":doc:`/reference/phpunit_integration`" for more information.
diff --git a/vendor/mockery/mockery/docs/getting_started/upgrading.rst b/vendor/mockery/mockery/docs/getting_started/upgrading.rst
new file mode 100644
index 000000000..7201e5973
--- /dev/null
+++ b/vendor/mockery/mockery/docs/getting_started/upgrading.rst
@@ -0,0 +1,82 @@
+.. index::
+ single: Upgrading
+
+Upgrading
+=========
+
+Upgrading to 1.0.0
+------------------
+
+Minimum PHP version
++++++++++++++++++++
+
+As of Mockery 1.0.0 the minimum PHP version required is 5.6.
+
+Using Mockery with PHPUnit
+++++++++++++++++++++++++++
+
+In the "old days", 0.9.x and older, the way Mockery was integrated with PHPUnit was
+through a PHPUnit listener. That listener would in turn call the ``\Mockery::close()``
+method for us.
+
+As of 1.0.0, PHPUnit test cases where we want to use Mockery, should either use the
+``\Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration`` trait, or extend the
+``\Mockery\Adapter\Phpunit\MockeryTestCase`` test case. This will in turn call the
+``\Mockery::close()`` method for us.
+
+Read the documentation for a detailed overview of ":doc:`/reference/phpunit_integration`".
+
+``\Mockery\Matcher\MustBe`` is deprecated
++++++++++++++++++++++++++++++++++++++++++
+
+As of 1.0.0 the ``\Mockery\Matcher\MustBe`` matcher is deprecated and will be removed in
+Mockery 2.0.0. We recommend instead to use the PHPUnit or Hamcrest equivalents of the
+MustBe matcher.
+
+``allows`` and ``expects``
+++++++++++++++++++++++++++
+
+As of 1.0.0, Mockery has two new methods to set up expectations: ``allows`` and ``expects``.
+This means that these methods names are now "reserved" for Mockery, or in other words
+classes you want to mock with Mockery, can't have methods called ``allows`` or ``expects``.
+
+Read more in the documentation about this ":doc:`/reference/alternative_should_receive_syntax`".
+
+No more implicit regex matching for string arguments
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+When setting up string arguments in method expectations, Mockery 0.9.x and older, would try
+to match arguments using a regular expression in a "last attempt" scenario.
+
+As of 1.0.0, Mockery will no longer attempt to do this regex matching, but will only try
+first the identical operator ``===``, and failing that, the equals operator ``==``.
+
+If you want to match an argument using regular expressions, please use the new
+``\Mockery\Matcher\Pattern`` matcher. Read more in the documentation about this
+pattern matcher in the ":doc:`/reference/argument_validation`" section.
+
+``andThrow`` ``\Throwable``
++++++++++++++++++++++++++++
+
+As of 1.0.0, the ``andThrow`` can now throw any ``\Throwable``.
+
+Upgrading to 0.9
+----------------
+
+The generator was completely rewritten, so any code with a deep integration to
+mockery will need evaluating.
+
+Upgrading to 0.8
+----------------
+
+Since the release of 0.8.0 the following behaviours were altered:
+
+1. The ``shouldIgnoreMissing()`` behaviour optionally applied to mock objects
+ returned an instance of ``\Mockery\Undefined`` when methods called did not
+ match a known expectation. Since 0.8.0, this behaviour was switched to
+ returning ``null`` instead. You can restore the 0.7.2 behaviour by using the
+ following:
+
+ .. code-block:: php
+
+ $mock = \Mockery::mock('stdClass')->shouldIgnoreMissing()->asUndefined();
diff --git a/vendor/mockery/mockery/docs/index.rst b/vendor/mockery/mockery/docs/index.rst
new file mode 100644
index 000000000..f8cbbd32a
--- /dev/null
+++ b/vendor/mockery/mockery/docs/index.rst
@@ -0,0 +1,76 @@
+Mockery
+=======
+
+Mockery is a simple yet flexible PHP mock object framework for use in unit
+testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is
+to offer a test double framework with a succinct API capable of clearly
+defining all possible object operations and interactions using a human
+readable Domain Specific Language (DSL). Designed as a drop in alternative to
+PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with
+PHPUnit and can operate alongside phpunit-mock-objects without the World
+ending.
+
+Mock Objects
+------------
+
+In unit tests, mock objects simulate the behaviour of real objects. They are
+commonly utilised to offer test isolation, to stand in for objects which do
+not yet exist, or to allow for the exploratory design of class APIs without
+requiring actual implementation up front.
+
+The benefits of a mock object framework are to allow for the flexible
+generation of such mock objects (and stubs). They allow the setting of
+expected method calls and return values using a flexible API which is capable
+of capturing every possible real object behaviour in way that is stated as
+close as possible to a natural language description.
+
+Getting Started
+---------------
+
+Ready to dive into the Mockery framework? Then you can get started by reading
+the "Getting Started" section!
+
+.. toctree::
+ :hidden:
+
+ getting_started/index
+
+.. include:: getting_started/map.rst.inc
+
+Reference
+---------
+
+The reference contains a complete overview of all features of the Mockery
+framework.
+
+.. toctree::
+ :hidden:
+
+ reference/index
+
+.. include:: reference/map.rst.inc
+
+Mockery
+-------
+
+Learn about Mockery's configuration, reserved method names, exceptions...
+
+.. toctree::
+ :hidden:
+
+ mockery/index
+
+.. include:: mockery/map.rst.inc
+
+Cookbook
+--------
+
+Want to learn some easy tips and tricks? Take a look at the cookbook articles!
+
+.. toctree::
+ :hidden:
+
+ cookbook/index
+
+.. include:: cookbook/map.rst.inc
+
diff --git a/vendor/mockery/mockery/docs/mockery/configuration.rst b/vendor/mockery/mockery/docs/mockery/configuration.rst
new file mode 100644
index 000000000..3a89579cf
--- /dev/null
+++ b/vendor/mockery/mockery/docs/mockery/configuration.rst
@@ -0,0 +1,77 @@
+.. index::
+ single: Mockery; Configuration
+
+Mockery Global Configuration
+============================
+
+To allow for a degree of fine-tuning, Mockery utilises a singleton
+configuration object to store a small subset of core behaviours. The two
+currently present include:
+
+* Option to allow/disallow the mocking of methods which do not actually exist
+ fulfilled (i.e. unused)
+* Setter/Getter for added a parameter map for internal PHP class methods
+ (``Reflection`` cannot detect these automatically)
+
+By default, the first behaviour is enabled. Of course, there are
+situations where this can lead to unintended consequences. The mocking of
+non-existent methods may allow mocks based on real classes/objects to fall out
+of sync with the actual implementations, especially when some degree of
+integration testing (testing of object wiring) is not being performed.
+
+You may allow or disallow this behaviour (whether for whole test suites or
+just select tests) by using the following call:
+
+.. code-block:: php
+
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(bool);
+
+Passing a true allows the behaviour, false disallows it. It takes effect
+immediately until switched back. If the behaviour is detected when not allowed,
+it will result in an Exception being thrown at that point. Note that disallowing
+this behaviour should be carefully considered since it necessarily removes at
+least some of Mockery's flexibility.
+
+The other two methods are:
+
+.. code-block:: php
+
+ \Mockery::getConfiguration()->setInternalClassMethodParamMap($class, $method, array $paramMap)
+ \Mockery::getConfiguration()->getInternalClassMethodParamMap($class, $method)
+
+These are used to define parameters (i.e. the signature string of each) for the
+methods of internal PHP classes (e.g. SPL, or PECL extension classes like
+ext/mongo's MongoCollection. Reflection cannot analyse the parameters of internal
+classes. Most of the time, you never need to do this. It's mainly needed where an
+internal class method uses pass-by-reference for a parameter - you MUST in such
+cases ensure the parameter signature includes the ``&`` symbol correctly as Mockery
+won't correctly add it automatically for internal classes.
+
+Disabling reflection caching
+----------------------------
+
+Mockery heavily uses `"reflection" `_
+to do it's job. To speed up things, Mockery caches internally the information it
+gathers via reflection. In some cases, this caching can cause problems.
+
+The **only** known situation when this occurs is when PHPUnit's ``--static-backup`` option
+is used. If you use ``--static-backup`` and you get an error that looks like the
+following:
+
+.. code-block:: php
+
+ Error: Internal error: Failed to retrieve the reflection object
+
+We suggest turning off the reflection cache as so:
+
+.. code-block:: php
+
+ \Mockery::getConfiguration()->disableReflectionCache();
+
+Turning it back on can be done like so:
+
+.. code-block:: php
+
+ \Mockery::getConfiguration()->enableReflectionCache();
+
+In no other situation should you be required turn this reflection cache off.
diff --git a/vendor/mockery/mockery/docs/mockery/exceptions.rst b/vendor/mockery/mockery/docs/mockery/exceptions.rst
new file mode 100644
index 000000000..623b158e2
--- /dev/null
+++ b/vendor/mockery/mockery/docs/mockery/exceptions.rst
@@ -0,0 +1,65 @@
+.. index::
+ single: Mockery; Exceptions
+
+Mockery Exceptions
+==================
+
+Mockery throws three types of exceptions when it cannot verify a mock object.
+
+#. ``\Mockery\Exception\InvalidCountException``
+#. ``\Mockery\Exception\InvalidOrderException``
+#. ``\Mockery\Exception\NoMatchingExpectationException``
+
+You can capture any of these exceptions in a try...catch block to query them
+for specific information which is also passed along in the exception message
+but is provided separately from getters should they be useful when logging or
+reformatting output.
+
+\Mockery\Exception\InvalidCountException
+----------------------------------------
+
+The exception class is used when a method is called too many (or too few)
+times and offers the following methods:
+
+* ``getMock()`` - return actual mock object
+* ``getMockName()`` - return the name of the mock object
+* ``getMethodName()`` - return the name of the method the failing expectation
+ is attached to
+* ``getExpectedCount()`` - return expected calls
+* ``getExpectedCountComparative()`` - returns a string, e.g. ``<=`` used to
+ compare to actual count
+* ``getActualCount()`` - return actual calls made with given argument
+ constraints
+
+\Mockery\Exception\InvalidOrderException
+----------------------------------------
+
+The exception class is used when a method is called outside the expected order
+set using the ``ordered()`` and ``globally()`` expectation modifiers. It
+offers the following methods:
+
+* ``getMock()`` - return actual mock object
+* ``getMockName()`` - return the name of the mock object
+* ``getMethodName()`` - return the name of the method the failing expectation
+ is attached to
+* ``getExpectedOrder()`` - returns an integer represented the expected index
+ for which this call was expected
+* ``getActualOrder()`` - return the actual index at which this method call
+ occurred.
+
+\Mockery\Exception\NoMatchingExpectationException
+-------------------------------------------------
+
+The exception class is used when a method call does not match any known
+expectation. All expectations are uniquely identified in a mock object by the
+method name and the list of expected arguments. You can disable this exception
+and opt for returning NULL from all unexpected method calls by using the
+earlier mentioned shouldIgnoreMissing() behaviour modifier. This exception
+class offers the following methods:
+
+* ``getMock()`` - return actual mock object
+* ``getMockName()`` - return the name of the mock object
+* ``getMethodName()`` - return the name of the method the failing expectation
+ is attached to
+* ``getActualArguments()`` - return actual arguments used to search for a
+ matching expectation
diff --git a/vendor/mockery/mockery/docs/mockery/gotchas.rst b/vendor/mockery/mockery/docs/mockery/gotchas.rst
new file mode 100644
index 000000000..ebd690fb5
--- /dev/null
+++ b/vendor/mockery/mockery/docs/mockery/gotchas.rst
@@ -0,0 +1,48 @@
+.. index::
+ single: Mockery; Gotchas
+
+Gotchas!
+========
+
+Mocking objects in PHP has its limitations and gotchas. Some functionality
+can't be mocked or can't be mocked YET! If you locate such a circumstance,
+please please (pretty please with sugar on top) create a new issue on GitHub
+so it can be documented and resolved where possible. Here is a list to note:
+
+1. Classes containing public ``__wakeup()`` methods can be mocked but the
+ mocked ``__wakeup()`` method will perform no actions and cannot have
+ expectations set for it. This is necessary since Mockery must serialize and
+ unserialize objects to avoid some ``__construct()`` insanity and attempting
+ to mock a ``__wakeup()`` method as normal leads to a
+ ``BadMethodCallException`` being thrown.
+
+2. Classes using non-real methods, i.e. where a method call triggers a
+ ``__call()`` method, will throw an exception that the non-real method does
+ not exist unless you first define at least one expectation (a simple
+ ``shouldReceive()`` call would suffice). This is necessary since there is
+ no other way for Mockery to be aware of the method name.
+
+3. Mockery has two scenarios where real classes are replaced: Instance mocks
+ and alias mocks. Both will generate PHP fatal errors if the real class is
+ loaded, usually via a require or include statement. Only use these two mock
+ types where autoloading is in place and where classes are not explicitly
+ loaded on a per-file basis using ``require()``, ``require_once()``, etc.
+
+4. Internal PHP classes are not entirely capable of being fully analysed using
+ ``Reflection``. For example, ``Reflection`` cannot reveal details of
+ expected parameters to the methods of such internal classes. As a result,
+ there will be problems where a method parameter is defined to accept a
+ value by reference (Mockery cannot detect this condition and will assume a
+ pass by value on scalars and arrays). If references as internal class
+ method parameters are needed, you should use the
+ ``\Mockery\Configuration::setInternalClassMethodParamMap()`` method.
+
+5. Creating a mock implementing a certain interface with incorrect case in the
+ interface name, and then creating a second mock implementing the same
+ interface, but this time with the correct case, will have undefined behavior
+ due to PHP's ``class_exists`` and related functions being case insensitive.
+ Using the ``::class`` keyword in PHP can help you avoid these mistakes.
+
+The gotchas noted above are largely down to PHP's architecture and are assumed
+to be unavoidable. But - if you figure out a solution (or a better one than
+what may exist), let us know!
diff --git a/vendor/mockery/mockery/docs/mockery/index.rst b/vendor/mockery/mockery/docs/mockery/index.rst
new file mode 100644
index 000000000..b698d6cb3
--- /dev/null
+++ b/vendor/mockery/mockery/docs/mockery/index.rst
@@ -0,0 +1,12 @@
+Mockery
+=======
+
+.. toctree::
+ :hidden:
+
+ configuration
+ exceptions
+ reserved_method_names
+ gotchas
+
+.. include:: map.rst.inc
diff --git a/vendor/mockery/mockery/docs/mockery/map.rst.inc b/vendor/mockery/mockery/docs/mockery/map.rst.inc
new file mode 100644
index 000000000..46ffa9759
--- /dev/null
+++ b/vendor/mockery/mockery/docs/mockery/map.rst.inc
@@ -0,0 +1,4 @@
+* :doc:`/mockery/configuration`
+* :doc:`/mockery/exceptions`
+* :doc:`/mockery/reserved_method_names`
+* :doc:`/mockery/gotchas`
diff --git a/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst b/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst
new file mode 100644
index 000000000..112d6f0a5
--- /dev/null
+++ b/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst
@@ -0,0 +1,20 @@
+.. index::
+ single: Reserved Method Names
+
+Reserved Method Names
+=====================
+
+As you may have noticed, Mockery uses a number of methods called directly on
+all mock objects, for example ``shouldReceive()``. Such methods are necessary
+in order to setup expectations on the given mock, and so they cannot be
+implemented on the classes or objects being mocked without creating a method
+name collision (reported as a PHP fatal error). The methods reserved by
+Mockery are:
+
+* ``shouldReceive()``
+* ``shouldBeStrict()``
+
+In addition, all mocks utilise a set of added methods and protected properties
+which cannot exist on the class or object being mocked. These are far less
+likely to cause collisions. All properties are prefixed with ``_mockery`` and
+all method names with ``mockery_``.
diff --git a/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst b/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst
new file mode 100644
index 000000000..78c1e83cb
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst
@@ -0,0 +1,91 @@
+.. index::
+ single: Alternative shouldReceive Syntax
+
+Alternative shouldReceive Syntax
+================================
+
+As of Mockery 1.0.0, we support calling methods as we would call any PHP method,
+and not as string arguments to Mockery ``should*`` methods.
+
+The two Mockery methods that enable this are ``allows()`` and ``expects()``.
+
+Allows
+------
+
+We use ``allows()`` when we create stubs for methods that return a predefined
+return value, but for these method stubs we don't care how many times, or if at
+all, were they called.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->allows([
+ 'name_of_method_1' => 'return value',
+ 'name_of_method_2' => 'return value',
+ ]);
+
+This is equivalent with the following ``shouldReceive`` syntax:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive([
+ 'name_of_method_1' => 'return value',
+ 'name_of_method_2' => 'return value',
+ ]);
+
+Note that with this format, we also tell Mockery that we don't care about the
+arguments to the stubbed methods.
+
+If we do care about the arguments, we would do it like so:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->allows()
+ ->name_of_method_1($arg1)
+ ->andReturn('return value');
+
+This is equivalent with the following ``shouldReceive`` syntax:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method_1')
+ ->with($arg1)
+ ->andReturn('return value');
+
+Expects
+-------
+
+We use ``expects()`` when we want to verify that a particular method was called:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->expects()
+ ->name_of_method_1($arg1)
+ ->andReturn('return value');
+
+This is equivalent with the following ``shouldReceive`` syntax:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method_1')
+ ->once()
+ ->with($arg1)
+ ->andReturn('return value');
+
+By default ``expects()`` sets up an expectation that the method should be called
+once and once only. If we expect more than one call to the method, we can change
+that expectation:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->expects()
+ ->name_of_method_1($arg1)
+ ->twice()
+ ->andReturn('return value');
+
diff --git a/vendor/mockery/mockery/docs/reference/argument_validation.rst b/vendor/mockery/mockery/docs/reference/argument_validation.rst
new file mode 100644
index 000000000..735407c0c
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/argument_validation.rst
@@ -0,0 +1,317 @@
+.. index::
+ single: Argument Validation
+
+Argument Validation
+===================
+
+The arguments passed to the ``with()`` declaration when setting up an
+expectation determine the criteria for matching method calls to expectations.
+Thus, we can setup up many expectations for a single method, each
+differentiated by the expected arguments. Such argument matching is done on a
+"best fit" basis. This ensures explicit matches take precedence over
+generalised matches.
+
+An explicit match is merely where the expected argument and the actual
+argument are easily equated (i.e. using ``===`` or ``==``). More generalised
+matches are possible using regular expressions, class hinting and the
+available generic matchers. The purpose of generalised matchers is to allow
+arguments be defined in non-explicit terms, e.g. ``Mockery::any()`` passed to
+``with()`` will match **any** argument in that position.
+
+Mockery's generic matchers do not cover all possibilities but offers optional
+support for the Hamcrest library of matchers. Hamcrest is a PHP port of the
+similarly named Java library (which has been ported also to Python, Erlang,
+etc). By using Hamcrest, Mockery does not need to duplicate Hamcrest's already
+impressive utility which itself promotes a natural English DSL.
+
+The examples below show Mockery matchers and their Hamcrest equivalent, if there
+is one. Hamcrest uses functions (no namespacing).
+
+.. note::
+
+ If you don't wish to use the global Hamcrest functions, they are all exposed
+ through the ``\Hamcrest\Matchers`` class as well, as static methods. Thus,
+ ``identicalTo($arg)`` is the same as ``\Hamcrest\Matchers::identicalTo($arg)``
+
+The most common matcher is the ``with()`` matcher:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(1):
+
+It tells mockery that it should receive a call to the ``foo`` method with the
+integer ``1`` as an argument. In cases like this, Mockery first tries to match
+the arguments using ``===`` (identical) comparison operator. If the argument is
+a primitive, and if it fails the identical comparison, Mockery does a fallback
+to the ``==`` (equals) comparison operator.
+
+When matching objects as arguments, Mockery only does the strict ``===``
+comparison, which means only the same ``$object`` will match:
+
+.. code-block:: php
+
+ $object = new stdClass();
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive("foo")
+ ->with($object);
+
+ // Hamcrest equivalent
+ $mock->shouldReceive("foo")
+ ->with(identicalTo($object));
+
+A different instance of ``stdClass`` will **not** match.
+
+.. note::
+
+ The ``Mockery\Matcher\MustBe`` matcher has been deprecated.
+
+If we need a loose comparison of objects, we can do that using Hamcrest's
+``equalTo`` matcher:
+
+.. code-block:: php
+
+ $mock->shouldReceive("foo")
+ ->with(equalTo(new stdClass));
+
+In cases when we don't care about the type, or the value of an argument, just
+that any argument is present, we use ``any()``:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive("foo")
+ ->with(\Mockery::any());
+
+ // Hamcrest equivalent
+ $mock->shouldReceive("foo")
+ ->with(anything())
+
+Anything and everything passed in this argument slot is passed unconstrained.
+
+Validating Types and Resources
+------------------------------
+
+The ``type()`` matcher accepts any string which can be attached to ``is_`` to
+form a valid type check.
+
+To match any PHP resource, we could do the following:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive("foo")
+ ->with(\Mockery::type('resource'));
+
+ // Hamcrest equivalents
+ $mock->shouldReceive("foo")
+ ->with(resourceValue());
+ $mock->shouldReceive("foo")
+ ->with(typeOf('resource'));
+
+It will return a ``true`` from an ``is_resource()`` call, if the provided
+argument to the method is a PHP resource. For example, ``\Mockery::type('float')``
+or Hamcrest's ``floatValue()`` and ``typeOf('float')`` checks use ``is_float()``,
+and ``\Mockery::type('callable')`` or Hamcrest's ``callable()`` uses
+``is_callable()``.
+
+The ``type()`` matcher also accepts a class or interface name to be used in an
+``instanceof`` evaluation of the actual argument. Hamcrest uses ``anInstanceOf()``.
+
+A full list of the type checkers is available at
+`php.net `_ or browse Hamcrest's function
+list in
+`the Hamcrest code `_.
+
+.. _argument-validation-complex-argument-validation:
+
+Complex Argument Validation
+---------------------------
+
+If we want to perform a complex argument validation, the ``on()`` matcher is
+invaluable. It accepts a closure (anonymous function) to which the actual
+argument will be passed.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive("foo")
+ ->with(\Mockery::on(closure));
+
+If the closure evaluates to (i.e. returns) boolean ``true`` then the argument is
+assumed to have matched the expectation.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::on(function ($argument) {
+ if ($argument % 2 == 0) {
+ return true;
+ }
+ return false;
+ }));
+
+ $mock->foo(4); // matches the expectation
+ $mock->foo(3); // throws a NoMatchingExpectationException
+
+.. note::
+
+ There is no Hamcrest version of the ``on()`` matcher.
+
+We can also perform argument validation by passing a closure to ``withArgs()``
+method. The closure will receive all arguments passed in the call to the expected
+method and if it evaluates (i.e. returns) to boolean ``true``, then the list of
+arguments is assumed to have matched the expectation:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive("foo")
+ ->withArgs(closure);
+
+The closure can also handle optional parameters, so if an optional parameter is
+missing in the call to the expected method, it doesn't necessary means that the
+list of arguments doesn't match the expectation.
+
+.. code-block:: php
+
+ $closure = function ($odd, $even, $sum = null) {
+ $result = ($odd % 2 != 0) && ($even % 2 == 0);
+ if (!is_null($sum)) {
+ return $result && ($odd + $even == $sum);
+ }
+ return $result;
+ };
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')->withArgs($closure);
+
+ $mock->foo(1, 2); // It matches the expectation: the optional argument is not needed
+ $mock->foo(1, 2, 3); // It also matches the expectation: the optional argument pass the validation
+ $mock->foo(1, 2, 4); // It doesn't match the expectation: the optional doesn't pass the validation
+
+.. note::
+
+ In previous versions, Mockery's ``with()`` would attempt to do a pattern
+ matching against the arguments, attempting to use the argument as a
+ regular expression. Over time this proved to be not such a great idea, so
+ we removed this functionality, and have introduced ``Mockery::pattern()``
+ instead.
+
+If we would like to match an argument against a regular expression, we can use
+the ``\Mockery::pattern()``:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::pattern('/^foo/'));
+
+ // Hamcrest equivalent
+ $mock->shouldReceive('foo')
+ with(matchesPattern('/^foo/'));
+
+The ``ducktype()`` matcher is an alternative to matching by class type:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::ducktype('foo', 'bar'));
+
+It matches any argument which is an object containing the provided list of
+methods to call.
+
+.. note::
+
+ There is no Hamcrest version of the ``ducktype()`` matcher.
+
+Additional Argument Matchers
+----------------------------
+
+The ``not()`` matcher matches any argument which is not equal or identical to
+the matcher's parameter:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::not(2));
+
+ // Hamcrest equivalent
+ $mock->shouldReceive('foo')
+ ->with(not(2));
+
+``anyOf()`` matches any argument which equals any one of the given parameters:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::anyOf(1, 2));
+
+ // Hamcrest equivalent
+ $mock->shouldReceive('foo')
+ ->with(anyOf(1,2));
+
+``notAnyOf()`` matches any argument which is not equal or identical to any of
+the given parameters:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::notAnyOf(1, 2));
+
+.. note::
+
+ There is no Hamcrest version of the ``notAnyOf()`` matcher.
+
+``subset()`` matches any argument which is any array containing the given array
+subset:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::subset(array(0 => 'foo')));
+
+This enforces both key naming and values, i.e. both the key and value of each
+actual element is compared.
+
+.. note::
+
+ There is no Hamcrest version of this functionality, though Hamcrest can check
+ a single entry using ``hasEntry()`` or ``hasKeyValuePair()``.
+
+``contains()`` matches any argument which is an array containing the listed
+values:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::contains(value1, value2));
+
+The naming of keys is ignored.
+
+``hasKey()`` matches any argument which is an array containing the given key
+name:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::hasKey(key));
+
+``hasValue()`` matches any argument which is an array containing the given
+value:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('foo')
+ ->with(\Mockery::hasValue(value));
diff --git a/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst b/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst
new file mode 100644
index 000000000..377812d88
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst
@@ -0,0 +1,419 @@
+.. index::
+ single: Reference; Creating Test Doubles
+
+Creating Test Doubles
+=====================
+
+Mockery's main goal is to help us create test doubles. It can create stubs,
+mocks, and spies.
+
+Stubs and mocks are created the same. The difference between the two is that a
+stub only returns a preset result when called, while a mock needs to have
+expectations set on the method calls it expects to receive.
+
+Spies are a type of test doubles that keep track of the calls they received, and
+allow us to inspect these calls after the fact.
+
+When creating a test double object, we can pass in an identifier as a name for
+our test double. If we pass it no identifier, the test double name will be
+unknown. Furthermore, the identifier must not be a class name. It is a
+good practice, and our recommendation, to always name the test doubles with the
+same name as the underlying class we are creating test doubles for.
+
+If the identifier we use for our test double is a name of an existing class,
+the test double will inherit the type of the class (via inheritance), i.e. the
+mock object will pass type hints or ``instanceof`` evaluations for the existing
+class. This is useful when a test double must be of a specific type, to satisfy
+the expectations our code has.
+
+Stubs and mocks
+---------------
+
+Stubs and mocks are created by calling the ``\Mockery::mock()`` method. The
+following example shows how to create a stub, or a mock, object named "foo":
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('foo');
+
+The mock object created like this is the loosest form of mocks possible, and is
+an instance of ``\Mockery\MockInterface``.
+
+.. note::
+
+ All test doubles created with Mockery are an instance of
+ ``\Mockery\MockInterface``, regardless are they a stub, mock or a spy.
+
+To create a stub or a mock object with no name, we can call the ``mock()``
+method with no parameters:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock();
+
+As we stated earlier, we don't recommend creating stub or mock objects without
+a name.
+
+Classes, abstracts, interfaces
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The recommended way to create a stub or a mock object is by using a name of
+an existing class we want to create a test double of:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+
+This stub or mock object will have the type of ``MyClass``, through inheritance.
+
+Stub or mock objects can be based on any concrete class, abstract class or even
+an interface. The primary purpose is to ensure the mock object inherits a
+specific type for type hinting.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyInterface');
+
+This stub or mock object will implement the ``MyInterface`` interface.
+
+.. note::
+
+ Classes marked final, or classes that have methods marked final cannot be
+ mocked fully. Mockery supports creating partial mocks for these cases.
+ Partial mocks will be explained later in the documentation.
+
+Mockery also supports creating stub or mock objects based on a single existing
+class, which must implement one or more interfaces. We can do this by providing
+a comma-separated list of the class and interfaces as the first argument to the
+``\Mockery::mock()`` method:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass, MyInterface, OtherInterface');
+
+This stub or mock object will now be of type ``MyClass`` and implement the
+``MyInterface`` and ``OtherInterface`` interfaces.
+
+.. note::
+
+ The class name doesn't need to be the first member of the list but it's a
+ friendly convention to use for readability.
+
+We can tell a mock to implement the desired interfaces by passing the list of
+interfaces as the second argument:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass', 'MyInterface, OtherInterface');
+
+For all intents and purposes, this is the same as the previous example.
+
+Spies
+-----
+
+The third type of test doubles Mockery supports are spies. The main difference
+between spies and mock objects is that with spies we verify the calls made
+against our test double after the calls were made. We would use a spy when we
+don't necessarily care about all of the calls that are going to be made to an
+object.
+
+A spy will return ``null`` for all method calls it receives. It is not possible
+to tell a spy what will be the return value of a method call. If we do that, then
+we would deal with a mock object, and not with a spy.
+
+We create a spy by calling the ``\Mockery::spy()`` method:
+
+.. code-block:: php
+
+ $spy = \Mockery::spy('MyClass');
+
+Just as with stubs or mocks, we can tell Mockery to base a spy on any concrete
+or abstract class, or to implement any number of interfaces:
+
+.. code-block:: php
+
+ $spy = \Mockery::spy('MyClass, MyInterface, OtherInterface');
+
+This spy will now be of type ``MyClass`` and implement the ``MyInterface`` and
+``OtherInterface`` interfaces.
+
+.. note::
+
+ The ``\Mockery::spy()`` method call is actually a shorthand for calling
+ ``\Mockery::mock()->shouldIgnoreMissing()``. The ``shouldIgnoreMissing``
+ method is a "behaviour modifier". We'll discuss them a bit later.
+
+Mocks vs. Spies
+---------------
+
+Let's try and illustrate the difference between mocks and spies with the
+following example:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $spy = \Mockery::spy('MyClass');
+
+ $mock->shouldReceive('foo')->andReturn(42);
+
+ $mockResult = $mock->foo();
+ $spyResult = $spy->foo();
+
+ $spy->shouldHaveReceived()->foo();
+
+ var_dump($mockResult); // int(42)
+ var_dump($spyResult); // null
+
+As we can see from this example, with a mock object we set the call expectations
+before the call itself, and we get the return result we expect it to return.
+With a spy object on the other hand, we verify the call has happened after the
+fact. The return result of a method call against a spy is always ``null``.
+
+We also have a dedicated chapter to :doc:`spies` only.
+
+.. _creating-test-doubles-partial-test-doubles:
+
+Partial Test Doubles
+--------------------
+
+Partial doubles are useful when we want to stub out, set expectations for, or
+spy on *some* methods of a class, but run the actual code for other methods.
+
+We differentiate between three types of partial test doubles:
+
+ * runtime partial test doubles,
+ * generated partial test doubles, and
+ * proxied partial test doubles.
+
+Runtime partial test doubles
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+What we call a runtime partial, involves creating a test double and then telling
+it to make itself partial. Any method calls that the double hasn't been told to
+allow or expect, will act as they would on a normal instance of the object.
+
+.. code-block:: php
+
+ class Foo {
+ function foo() { return 123; }
+ function bar() { return $this->foo(); }
+ }
+
+ $foo = mock(Foo::class)->makePartial();
+ $foo->foo(); // int(123);
+
+We can then tell the test double to allow or expect calls as with any other
+Mockery double.
+
+.. code-block:: php
+
+ $foo->shouldReceive('foo')->andReturn(456);
+ $foo->bar(); // int(456)
+
+See the cookbook entry on :doc:`../cookbook/big_parent_class` for an example
+usage of runtime partial test doubles.
+
+Generated partial test doubles
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The second type of partial double we can create is what we call a generated
+partial. With generated partials, we specifically tell Mockery which methods
+we want to be able to allow or expect calls to. All other methods will run the
+actual code *directly*, so stubs and expectations on these methods will not
+work.
+
+.. code-block:: php
+
+ class Foo {
+ function foo() { return 123; }
+ function bar() { return $this->foo(); }
+ }
+
+ $foo = mock("Foo[foo]");
+
+ $foo->foo(); // error, no expectation set
+
+ $foo->shouldReceive('foo')->andReturn(456);
+ $foo->foo(); // int(456)
+
+ // setting an expectation for this has no effect
+ $foo->shouldReceive('bar')->andReturn(999);
+ $foo->bar(); // int(456)
+
+.. note::
+
+ Even though we support generated partial test doubles, we do not recommend
+ using them.
+
+ One of the reasons why is because a generated partial will call the original
+ constructor of the mocked class. This can have unwanted side-effects during
+ testing application code.
+
+ See :doc:`../cookbook/not_calling_the_constructor` for more details.
+
+Proxied partial test doubles
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A proxied partial mock is a partial of last resort. We may encounter a class
+which is simply not capable of being mocked because it has been marked as
+final. Similarly, we may find a class with methods marked as final. In such a
+scenario, we cannot simply extend the class and override methods to mock - we
+need to get creative.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock(new MyClass);
+
+Yes, the new mock is a Proxy. It intercepts calls and reroutes them to the
+proxied object (which we construct and pass in) for methods which are not
+subject to any expectations. Indirectly, this allows us to mock methods
+marked final since the Proxy is not subject to those limitations. The tradeoff
+should be obvious - a proxied partial will fail any typehint checks for the
+class being mocked since it cannot extend that class.
+
+.. _creating-test-doubles-aliasing:
+
+Aliasing
+--------
+
+Prefixing the valid name of a class (which is NOT currently loaded) with
+"alias:" will generate an "alias mock". Alias mocks create a class alias with
+the given classname to stdClass and are generally used to enable the mocking
+of public static methods. Expectations set on the new mock object which refer
+to static methods will be used by all static calls to this class.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('alias:MyClass');
+
+
+.. note::
+
+ Even though aliasing classes is supported, we do not recommend it.
+
+Overloading
+-----------
+
+Prefixing the valid name of a class (which is NOT currently loaded) with
+"overload:" will generate an alias mock (as with "alias:") except that created
+new instances of that class will import any expectations set on the origin
+mock (``$mock``). The origin mock is never verified since it's used an
+expectation store for new instances. For this purpose we use the term "instance
+mock" to differentiate it from the simpler "alias mock".
+
+In other words, an instance mock will "intercept" when a new instance of the
+mocked class is created, then the mock will be used instead. This is useful
+especially when mocking hard dependencies which will be discussed later.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('overload:MyClass');
+
+.. note::
+
+ Using alias/instance mocks across more than one test will generate a fatal
+ error since we can't have two classes of the same name. To avoid this,
+ run each test of this kind in a separate PHP process (which is supported
+ out of the box by both PHPUnit and PHPT).
+
+
+.. _creating-test-doubles-named-mocks:
+
+Named Mocks
+-----------
+
+The ``namedMock()`` method will generate a class called by the first argument,
+so in this example ``MyClassName``. The rest of the arguments are treated in the
+same way as the ``mock`` method:
+
+.. code-block:: php
+
+ $mock = \Mockery::namedMock('MyClassName', 'DateTime');
+
+This example would create a class called ``MyClassName`` that extends
+``DateTime``.
+
+Named mocks are quite an edge case, but they can be useful when code depends
+on the ``__CLASS__`` magic constant, or when we need two derivatives of an
+abstract type, that are actually different classes.
+
+See the cookbook entry on :doc:`../cookbook/class_constants` for an example
+usage of named mocks.
+
+.. note::
+
+ We can only create a named mock once, any subsequent calls to
+ ``namedMock``, with different arguments are likely to cause exceptions.
+
+.. _creating-test-doubles-constructor-arguments:
+
+Constructor Arguments
+---------------------
+
+Sometimes the mocked class has required constructor arguments. We can pass these
+to Mockery as an indexed array, as the 2nd argument:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass', [$constructorArg1, $constructorArg2]);
+
+or if we need the ``MyClass`` to implement an interface as well, as the 3rd
+argument:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass', 'MyInterface', [$constructorArg1, $constructorArg2]);
+
+Mockery now knows to pass in ``$constructorArg1`` and ``$constructorArg2`` as
+arguments to the constructor.
+
+.. _creating-test-doubles-behavior-modifiers:
+
+Behavior Modifiers
+------------------
+
+When creating a mock object, we may wish to use some commonly preferred
+behaviours that are not the default in Mockery.
+
+The use of the ``shouldIgnoreMissing()`` behaviour modifier will label this
+mock object as a Passive Mock:
+
+.. code-block:: php
+
+ \Mockery::mock('MyClass')->shouldIgnoreMissing();
+
+In such a mock object, calls to methods which are not covered by expectations
+will return ``null`` instead of the usual error about there being no expectation
+matching the call.
+
+On PHP >= 7.0.0, methods with missing expectations that have a return type
+will return either a mock of the object (if return type is a class) or a
+"falsy" primitive value, e.g. empty string, empty array, zero for ints and
+floats, false for bools, or empty closures.
+
+On PHP >= 7.1.0, methods with missing expectations and nullable return type
+will return null.
+
+We can optionally prefer to return an object of type ``\Mockery\Undefined``
+(i.e. a ``null`` object) (which was the 0.7.2 behaviour) by using an
+additional modifier:
+
+.. code-block:: php
+
+ \Mockery::mock('MyClass')->shouldIgnoreMissing()->asUndefined();
+
+The returned object is nothing more than a placeholder so if, by some act of
+fate, it's erroneously used somewhere it shouldn't it will likely not pass a
+logic check.
+
+We have encountered the ``makePartial()`` method before, as it is the method we
+use to create runtime partial test doubles:
+
+.. code-block:: php
+
+ \Mockery::mock('MyClass')->makePartial();
+
+This form of mock object will defer all methods not subject to an expectation to
+the parent class of the mock, i.e. ``MyClass``. Whereas the previous
+``shouldIgnoreMissing()`` returned ``null``, this behaviour simply calls the
+parent's matching method.
diff --git a/vendor/mockery/mockery/docs/reference/demeter_chains.rst b/vendor/mockery/mockery/docs/reference/demeter_chains.rst
new file mode 100644
index 000000000..1dad5effe
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/demeter_chains.rst
@@ -0,0 +1,38 @@
+.. index::
+ single: Mocking; Demeter Chains
+
+Mocking Demeter Chains And Fluent Interfaces
+============================================
+
+Both of these terms refer to the growing practice of invoking statements
+similar to:
+
+.. code-block:: php
+
+ $object->foo()->bar()->zebra()->alpha()->selfDestruct();
+
+The long chain of method calls isn't necessarily a bad thing, assuming they
+each link back to a local object the calling class knows. As a fun example,
+Mockery's long chains (after the first ``shouldReceive()`` method) all call to
+the same instance of ``\Mockery\Expectation``. However, sometimes this is not
+the case and the chain is constantly crossing object boundaries.
+
+In either case, mocking such a chain can be a horrible task. To make it easier
+Mockery supports demeter chain mocking. Essentially, we shortcut through the
+chain and return a defined value from the final call. For example, let's
+assume ``selfDestruct()`` returns the string "Ten!" to $object (an instance of
+``CaptainsConsole``). Here's how we could mock it.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('CaptainsConsole');
+ $mock->shouldReceive('foo->bar->zebra->alpha->selfDestruct')->andReturn('Ten!');
+
+The above expectation can follow any previously seen format or expectation,
+except that the method name is simply the string of all expected chain calls
+separated by ``->``. Mockery will automatically setup the chain of expected
+calls with its final return values, regardless of whatever intermediary object
+might be used in the real implementation.
+
+Arguments to all members of the chain (except the final call) are ignored in
+this process.
diff --git a/vendor/mockery/mockery/docs/reference/expectations.rst b/vendor/mockery/mockery/docs/reference/expectations.rst
new file mode 100644
index 000000000..fb1d736d4
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/expectations.rst
@@ -0,0 +1,465 @@
+.. index::
+ single: Expectations
+
+Expectation Declarations
+========================
+
+.. note::
+
+ In order for our expectations to work we MUST call ``Mockery::close()``,
+ preferably in a callback method such as ``tearDown`` or ``_before``
+ (depending on whether or not we're integrating Mockery with another
+ framework). This static call cleans up the Mockery container used by the
+ current test, and run any verification tasks needed for our expectations.
+
+Once we have created a mock object, we'll often want to start defining how
+exactly it should behave (and how it should be called). This is where the
+Mockery expectation declarations take over.
+
+Declaring Method Call Expectations
+----------------------------------
+
+To tell our test double to expect a call for a method with a given name, we use
+the ``shouldReceive`` method:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method');
+
+This is the starting expectation upon which all other expectations and
+constraints are appended.
+
+We can declare more than one method call to be expected:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method_1', 'name_of_method_2');
+
+All of these will adopt any chained expectations or constraints.
+
+It is possible to declare the expectations for the method calls, along with
+their return values:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive([
+ 'name_of_method_1' => 'return value 1',
+ 'name_of_method_2' => 'return value 2',
+ ]);
+
+There's also a shorthand way of setting up method call expectations and their
+return values:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass', ['name_of_method_1' => 'return value 1', 'name_of_method_2' => 'return value 2']);
+
+All of these will adopt any additional chained expectations or constraints.
+
+We can declare that a test double should not expect a call to the given method
+name:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldNotReceive('name_of_method');
+
+This method is a convenience method for calling ``shouldReceive()->never()``.
+
+Declaring Method Argument Expectations
+--------------------------------------
+
+For every method we declare expectation for, we can add constraints that the
+defined expectations apply only to the method calls that match the expected
+argument list:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->with($arg1, $arg2, ...);
+ // or
+ $mock->shouldReceive('name_of_method')
+ ->withArgs([$arg1, $arg2, ...]);
+
+We can add a lot more flexibility to argument matching using the built in
+matcher classes (see later). For example, ``\Mockery::any()`` matches any
+argument passed to that position in the ``with()`` parameter list. Mockery also
+allows Hamcrest library matchers - for example, the Hamcrest function
+``anything()`` is equivalent to ``\Mockery::any()``.
+
+It's important to note that this means all expectations attached only apply to
+the given method when it is called with these exact arguments:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+
+ $mock->shouldReceive('foo')->with('Hello');
+
+ $mock->foo('Goodbye'); // throws a NoMatchingExpectationException
+
+This allows for setting up differing expectations based on the arguments
+provided to expected calls.
+
+Argument matching with closures
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Instead of providing a built-in matcher for each argument, we can provide a
+closure that matches all passed arguments at once:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->withArgs(closure);
+
+The given closure receives all the arguments passed in the call to the expected
+method. In this way, this expectation only applies to method calls where passed
+arguments make the closure evaluate to true:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+
+ $mock->shouldReceive('foo')->withArgs(function ($arg) {
+ if ($arg % 2 == 0) {
+ return true;
+ }
+ return false;
+ });
+
+ $mock->foo(4); // matches the expectation
+ $mock->foo(3); // throws a NoMatchingExpectationException
+
+Any, or no arguments
+^^^^^^^^^^^^^^^^^^^^
+
+We can declare that the expectation matches a method call regardless of what
+arguments are passed:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->withAnyArgs();
+
+This is set by default unless otherwise specified.
+
+We can declare that the expectation matches method calls with zero arguments:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->withNoArgs();
+
+Declaring Return Value Expectations
+-----------------------------------
+
+For mock objects, we can tell Mockery what return values to return from the
+expected method calls.
+
+For that we can use the ``andReturn()`` method:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andReturn($value);
+
+This sets a value to be returned from the expected method call.
+
+It is possible to set up expectation for multiple return values. By providing
+a sequence of return values, we tell Mockery what value to return on every
+subsequent call to the method:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andReturn($value1, $value2, ...)
+
+The first call will return ``$value1`` and the second call will return ``$value2``.
+
+If we call the method more times than the number of return values we declared,
+Mockery will return the final value for any subsequent method call:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+
+ $mock->shouldReceive('foo')->andReturn(1, 2, 3);
+
+ $mock->foo(); // int(1)
+ $mock->foo(); // int(2)
+ $mock->foo(); // int(3)
+ $mock->foo(); // int(3)
+
+The same can be achieved using the alternative syntax:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andReturnValues([$value1, $value2, ...])
+
+It accepts a simple array instead of a list of parameters. The order of return
+is determined by the numerical index of the given array with the last array
+member being returned on all calls once previous return values are exhausted.
+
+The following two options are primarily for communication with test readers:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andReturnNull();
+ // or
+ $mock->shouldReceive('name_of_method')
+ ->andReturn([null]);
+
+They mark the mock object method call as returning ``null`` or nothing.
+
+Sometimes we want to calculate the return results of the method calls, based on
+the arguments passed to the method. We can do that with the ``andReturnUsing()``
+method which accepts one or more closure:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andReturnUsing(closure, ...);
+
+Closures can be queued by passing them as extra parameters as for ``andReturn()``.
+
+.. note::
+
+ We cannot currently mix ``andReturnUsing()`` with ``andReturn()``.
+
+If we are mocking fluid interfaces, the following method will be helpful:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andReturnSelf();
+
+It sets the return value to the mocked class name.
+
+Throwing Exceptions
+-------------------
+
+We can tell the method of mock objects to throw exceptions:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andThrow(Exception);
+
+It will throw the given ``Exception`` object when called.
+
+Rather than an object, we can pass in the ``Exception`` class and message to
+use when throwing an ``Exception`` from the mocked method:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andThrow(exception_name, message);
+
+.. _expectations-setting-public-properties:
+
+Setting Public Properties
+-------------------------
+
+Used with an expectation so that when a matching method is called, we can cause
+a mock object's public property to be set to a specified value, by using
+``andSet()`` or ``set()``:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->andSet($property, $value);
+ // or
+ $mock->shouldReceive('name_of_method')
+ ->set($property, $value);
+
+In cases where we want to call the real method of the class that was mocked and
+return its result, the ``passthru()`` method tells the expectation to bypass
+a return queue:
+
+.. code-block:: php
+
+ passthru()
+
+It allows expectation matching and call count validation to be applied against
+real methods while still calling the real class method with the expected
+arguments.
+
+Declaring Call Count Expectations
+---------------------------------
+
+Besides setting expectations on the arguments of the method calls, and the
+return values of those same calls, we can set expectations on how many times
+should any method be called.
+
+When a call count expectation is not met, a
+``\Mockery\Expectation\InvalidCountException`` will be thrown.
+
+.. note::
+
+ It is absolutely required to call ``\Mockery::close()`` at the end of our
+ tests, for example in the ``tearDown()`` method of PHPUnit. Otherwise
+ Mockery will not verify the calls made against our mock objects.
+
+We can declare that the expected method may be called zero or more times:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->zeroOrMoreTimes();
+
+This is the default for all methods unless otherwise set.
+
+To tell Mockery to expect an exact number of calls to a method, we can use the
+following:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->times($n);
+
+where ``$n`` is the number of times the method should be called.
+
+A couple of most common cases got their shorthand methods.
+
+To declare that the expected method must be called one time only:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->once();
+
+To declare that the expected method must be called two times:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->twice();
+
+To declare that the expected method must never be called:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->never();
+
+Call count modifiers
+^^^^^^^^^^^^^^^^^^^^
+
+The call count expectations can have modifiers set.
+
+If we want to tell Mockery the minimum number of times a method should be called,
+we use ``atLeast()``:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->atLeast()
+ ->times(3);
+
+``atLeast()->times(3)`` means the call must be called at least three times
+(given matching method args) but never less than three times.
+
+Similarly, we can tell Mockery the maximum number of times a method should be
+called, using ``atMost()``:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->atMost()
+ ->times(3);
+
+``atMost()->times(3)`` means the call must be called no more than three times.
+If the method gets no calls at all, the expectation will still be met.
+
+We can also set a range of call counts, using ``between()``:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass');
+ $mock->shouldReceive('name_of_method')
+ ->between($min, $max);
+
+This is actually identical to using ``atLeast()->times($min)->atMost()->times($max)``
+but is provided as a shorthand. It may be followed by a ``times()`` call with no
+parameter to preserve the APIs natural language readability.
+
+Expectation Declaration Utilities
+---------------------------------
+
+Declares that this method is expected to be called in a specific order in
+relation to similarly marked methods.
+
+.. code-block:: php
+
+ ordered()
+
+The order is dictated by the order in which this modifier is actually used when
+setting up mocks.
+
+Declares the method as belonging to an order group (which can be named or
+numbered). Methods within a group can be called in any order, but the ordered
+calls from outside the group are ordered in relation to the group:
+
+.. code-block:: php
+
+ ordered(group)
+
+We can set up so that method1 is called before group1 which is in turn called
+before method2.
+
+When called prior to ``ordered()`` or ``ordered(group)``, it declares this
+ordering to apply across all mock objects (not just the current mock):
+
+.. code-block:: php
+
+ globally()
+
+This allows for dictating order expectations across multiple mocks.
+
+The ``byDefault()`` marks an expectation as a default. Default expectations are
+applied unless a non-default expectation is created:
+
+.. code-block:: php
+
+ byDefault()
+
+These later expectations immediately replace the previously defined default.
+This is useful so we can setup default mocks in our unit test ``setup()`` and
+later tweak them in specific tests as needed.
+
+Returns the current mock object from an expectation chain:
+
+.. code-block:: php
+
+ getMock()
+
+Useful where we prefer to keep mock setups as a single statement, e.g.:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('foo')->shouldReceive('foo')->andReturn(1)->getMock();
diff --git a/vendor/mockery/mockery/docs/reference/final_methods_classes.rst b/vendor/mockery/mockery/docs/reference/final_methods_classes.rst
new file mode 100644
index 000000000..3b2c443f7
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/final_methods_classes.rst
@@ -0,0 +1,28 @@
+.. index::
+ single: Mocking; Final Classes/Methods
+
+Dealing with Final Classes/Methods
+==================================
+
+One of the primary restrictions of mock objects in PHP, is that mocking
+classes or methods marked final is hard. The final keyword prevents methods so
+marked from being replaced in subclasses (subclassing is how mock objects can
+inherit the type of the class or object being mocked).
+
+The simplest solution is to not mark classes or methods as final!
+
+However, in a compromise between mocking functionality and type safety,
+Mockery does allow creating "proxy mocks" from classes marked final, or from
+classes with methods marked final. This offers all the usual mock object
+goodness but the resulting mock will not inherit the class type of the object
+being mocked, i.e. it will not pass any instanceof comparison. Methods marked
+as final will be proxied to the original method, i.e., final methods can't be
+mocked.
+
+We can create a proxy mock by passing the instantiated object we wish to
+mock into ``\Mockery::mock()``, i.e. Mockery will then generate a Proxy to the
+real object and selectively intercept method calls for the purposes of setting
+and meeting expectations.
+
+See the :ref:`creating-test-doubles-partial-test-doubles` chapter, the subsection
+about proxied partial test doubles.
diff --git a/vendor/mockery/mockery/docs/reference/index.rst b/vendor/mockery/mockery/docs/reference/index.rst
new file mode 100644
index 000000000..1e5bf0481
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/index.rst
@@ -0,0 +1,22 @@
+Reference
+=========
+
+.. toctree::
+ :hidden:
+
+ creating_test_doubles
+ expectations
+ argument_validation
+ alternative_should_receive_syntax
+ spies
+ partial_mocks
+ protected_methods
+ public_properties
+ public_static_properties
+ pass_by_reference_behaviours
+ demeter_chains
+ final_methods_classes
+ magic_methods
+ phpunit_integration
+
+.. include:: map.rst.inc
diff --git a/vendor/mockery/mockery/docs/reference/instance_mocking.rst b/vendor/mockery/mockery/docs/reference/instance_mocking.rst
new file mode 100644
index 000000000..9d1aa283e
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/instance_mocking.rst
@@ -0,0 +1,22 @@
+.. index::
+ single: Mocking; Instance
+
+Instance Mocking
+================
+
+Instance mocking means that a statement like:
+
+.. code-block:: php
+
+ $obj = new \MyNamespace\Foo;
+
+...will actually generate a mock object. This is done by replacing the real
+class with an instance mock (similar to an alias mock), as with mocking public
+methods. The alias will import its expectations from the original mock of
+that type (note that the original is never verified and should be ignored
+after its expectations are setup). This lets you intercept instantiation where
+you can't simply inject a replacement object.
+
+As before, this does not prevent a require statement from including the real
+class and triggering a fatal PHP error. It's intended for use where
+autoloading is the primary class loading mechanism.
diff --git a/vendor/mockery/mockery/docs/reference/magic_methods.rst b/vendor/mockery/mockery/docs/reference/magic_methods.rst
new file mode 100644
index 000000000..39591cff4
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/magic_methods.rst
@@ -0,0 +1,16 @@
+.. index::
+ single: Mocking; Magic Methods
+
+PHP Magic Methods
+=================
+
+PHP magic methods which are prefixed with a double underscore, e.g.
+``__set()``, pose a particular problem in mocking and unit testing in general.
+It is strongly recommended that unit tests and mock objects do not directly
+refer to magic methods. Instead, refer only to the virtual methods and
+properties these magic methods simulate.
+
+Following this piece of advice will ensure we are testing the real API of
+classes and also ensures there is no conflict should Mockery override these
+magic methods, which it will inevitably do in order to support its role in
+intercepting method calls and properties.
diff --git a/vendor/mockery/mockery/docs/reference/map.rst.inc b/vendor/mockery/mockery/docs/reference/map.rst.inc
new file mode 100644
index 000000000..883bc3caf
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/map.rst.inc
@@ -0,0 +1,14 @@
+* :doc:`/reference/creating_test_doubles`
+* :doc:`/reference/expectations`
+* :doc:`/reference/argument_validation`
+* :doc:`/reference/alternative_should_receive_syntax`
+* :doc:`/reference/spies`
+* :doc:`/reference/partial_mocks`
+* :doc:`/reference/protected_methods`
+* :doc:`/reference/public_properties`
+* :doc:`/reference/public_static_properties`
+* :doc:`/reference/pass_by_reference_behaviours`
+* :doc:`/reference/demeter_chains`
+* :doc:`/reference/final_methods_classes`
+* :doc:`/reference/magic_methods`
+* :doc:`/reference/phpunit_integration`
diff --git a/vendor/mockery/mockery/docs/reference/partial_mocks.rst b/vendor/mockery/mockery/docs/reference/partial_mocks.rst
new file mode 100644
index 000000000..457eb8deb
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/partial_mocks.rst
@@ -0,0 +1,108 @@
+.. index::
+ single: Mocking; Partial Mocks
+
+Creating Partial Mocks
+======================
+
+Partial mocks are useful when we only need to mock several methods of an
+object leaving the remainder free to respond to calls normally (i.e. as
+implemented). Mockery implements three distinct strategies for creating
+partials. Each has specific advantages and disadvantages so which strategy we
+use will depend on our own preferences and the source code in need of
+mocking.
+
+We have previously talked a bit about :ref:`creating-test-doubles-partial-test-doubles`,
+but we'd like to expand on the subject a bit here.
+
+#. Runtime partial test doubles
+#. Generated partial test doubles
+#. Proxied Partial Mock
+
+Runtime partial test doubles
+----------------------------
+
+A runtime partial test double, also known as a passive partial mock, is a kind
+of a default state of being for a mocked object.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass')->makePartial();
+
+With a runtime partial, we assume that all methods will simply defer to the
+parent class (``MyClass``) original methods unless a method call matches a
+known expectation. If we have no matching expectation for a specific method
+call, that call is deferred to the class being mocked. Since the division
+between mocked and unmocked calls depends entirely on the expectations we
+define, there is no need to define which methods to mock in advance.
+
+See the cookbook entry on :doc:`../cookbook/big_parent_class` for an example
+usage of runtime partial test doubles.
+
+Generated Partial Test Doubles
+------------------------------
+
+A generated partial test double, also known as a traditional partial mock,
+defines ahead of time which methods of a class are to be mocked and which are
+to be left unmocked (i.e. callable as normal). The syntax for creating
+traditional mocks is:
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyClass[foo,bar]');
+
+In the above example, the ``foo()`` and ``bar()`` methods of MyClass will be
+mocked but no other MyClass methods are touched. We will need to define
+expectations for the ``foo()`` and ``bar()`` methods to dictate their mocked
+behaviour.
+
+Don't forget that we can pass in constructor arguments since unmocked methods
+may rely on those!
+
+.. code-block:: php
+
+ $mock = \Mockery::mock('MyNamespace\MyClass[foo]', array($arg1, $arg2));
+
+See the :ref:`creating-test-doubles-constructor-arguments` section to read up
+on them.
+
+.. note::
+
+ Even though we support generated partial test doubles, we do not recommend
+ using them.
+
+Proxied Partial Mock
+--------------------
+
+A proxied partial mock is a partial of last resort. We may encounter a class
+which is simply not capable of being mocked because it has been marked as
+final. Similarly, we may find a class with methods marked as final. In such a
+scenario, we cannot simply extend the class and override methods to mock - we
+need to get creative.
+
+.. code-block:: php
+
+ $mock = \Mockery::mock(new MyClass);
+
+Yes, the new mock is a Proxy. It intercepts calls and reroutes them to the
+proxied object (which we construct and pass in) for methods which are not
+subject to any expectations. Indirectly, this allows us to mock methods
+marked final since the Proxy is not subject to those limitations. The tradeoff
+should be obvious - a proxied partial will fail any typehint checks for the
+class being mocked since it cannot extend that class.
+
+Special Internal Cases
+----------------------
+
+All mock objects, with the exception of Proxied Partials, allows us to make
+any expectation call to the underlying real class method using the ``passthru()``
+expectation call. This will return values from the real call and bypass any
+mocked return queue (which can simply be omitted obviously).
+
+There is a fourth kind of partial mock reserved for internal use. This is
+automatically generated when we attempt to mock a class containing methods
+marked final. Since we cannot override such methods, they are simply left
+unmocked. Typically, we don't need to worry about this but if we really
+really must mock a final method, the only possible means is through a Proxied
+Partial Mock. SplFileInfo, for example, is a common class subject to this form
+of automatic internal partial since it contains public final methods used
+internally.
diff --git a/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst b/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst
new file mode 100644
index 000000000..5e2e457f6
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst
@@ -0,0 +1,130 @@
+.. index::
+ single: Pass-By-Reference Method Parameter Behaviour
+
+Preserving Pass-By-Reference Method Parameter Behaviour
+=======================================================
+
+PHP Class method may accept parameters by reference. In this case, changes
+made to the parameter (a reference to the original variable passed to the
+method) are reflected in the original variable. An example:
+
+.. code-block:: php
+
+ class Foo
+ {
+
+ public function bar(&$a)
+ {
+ $a++;
+ }
+
+ }
+
+ $baz = 1;
+ $foo = new Foo;
+ $foo->bar($baz);
+
+ echo $baz; // will echo the integer 2
+
+In the example above, the variable ``$baz`` is passed by reference to
+``Foo::bar()`` (notice the ``&`` symbol in front of the parameter?). Any
+change ``bar()`` makes to the parameter reference is reflected in the original
+variable, ``$baz``.
+
+Mockery handles references correctly for all methods where it can analyse
+the parameter (using ``Reflection``) to see if it is passed by reference. To
+mock how a reference is manipulated by the class method, we can use a closure
+argument matcher to manipulate it, i.e. ``\Mockery::on()`` - see the
+:ref:`argument-validation-complex-argument-validation` chapter.
+
+There is an exception for internal PHP classes where Mockery cannot analyse
+method parameters using ``Reflection`` (a limitation in PHP). To work around
+this, we can explicitly declare method parameters for an internal class using
+``\Mockery\Configuration::setInternalClassMethodParamMap()``.
+
+Here's an example using ``MongoCollection::insert()``. ``MongoCollection`` is
+an internal class offered by the mongo extension from PECL. Its ``insert()``
+method accepts an array of data as the first parameter, and an optional
+options array as the second parameter. The original data array is updated
+(i.e. when a ``insert()`` pass-by-reference parameter) to include a new
+``_id`` field. We can mock this behaviour using a configured parameter map (to
+tell Mockery to expect a pass by reference parameter) and a ``Closure``
+attached to the expected method parameter to be updated.
+
+Here's a PHPUnit unit test verifying that this pass-by-reference behaviour is
+preserved:
+
+.. code-block:: php
+
+ public function testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs()
+ {
+ \Mockery::getConfiguration()->setInternalClassMethodParamMap(
+ 'MongoCollection',
+ 'insert',
+ array('&$data', '$options = array()')
+ );
+ $m = \Mockery::mock('MongoCollection');
+ $m->shouldReceive('insert')->with(
+ \Mockery::on(function(&$data) {
+ if (!is_array($data)) return false;
+ $data['_id'] = 123;
+ return true;
+ }),
+ \Mockery::any()
+ );
+
+ $data = array('a'=>1,'b'=>2);
+ $m->insert($data);
+
+ $this->assertTrue(isset($data['_id']));
+ $this->assertEquals(123, $data['_id']);
+
+ \Mockery::resetContainer();
+ }
+
+Protected Methods
+-----------------
+
+When dealing with protected methods, and trying to preserve pass by reference
+behavior for them, a different approach is required.
+
+.. code-block:: php
+
+ class Model
+ {
+ public function test(&$data)
+ {
+ return $this->doTest($data);
+ }
+
+ protected function doTest(&$data)
+ {
+ $data['something'] = 'wrong';
+ return $this;
+ }
+ }
+
+ class Test extends \PHPUnit\Framework\TestCase
+ {
+ public function testModel()
+ {
+ $mock = \Mockery::mock('Model[test]')->shouldAllowMockingProtectedMethods();
+
+ $mock->shouldReceive('test')
+ ->with(\Mockery::on(function(&$data) {
+ $data['something'] = 'wrong';
+ return true;
+ }));
+
+ $data = array('foo' => 'bar');
+
+ $mock->test($data);
+ $this->assertTrue(isset($data['something']));
+ $this->assertEquals('wrong', $data['something']);
+ }
+ }
+
+This is quite an edge case, so we need to change the original code a little bit,
+by creating a public method that will call our protected method, and then mock
+that, instead of the protected method. This new public method will act as a
+proxy to our protected method.
diff --git a/vendor/mockery/mockery/docs/reference/phpunit_integration.rst b/vendor/mockery/mockery/docs/reference/phpunit_integration.rst
new file mode 100644
index 000000000..7528b5aae
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/phpunit_integration.rst
@@ -0,0 +1,151 @@
+.. index::
+ single: PHPUnit Integration
+
+PHPUnit Integration
+===================
+
+Mockery was designed as a simple-to-use *standalone* mock object framework, so
+its need for integration with any testing framework is entirely optional. To
+integrate Mockery, we need to define a ``tearDown()`` method for our tests
+containing the following (we may use a shorter ``\Mockery`` namespace
+alias):
+
+.. code-block:: php
+
+ public function tearDown() {
+ \Mockery::close();
+ }
+
+This static call cleans up the Mockery container used by the current test, and
+run any verification tasks needed for our expectations.
+
+For some added brevity when it comes to using Mockery, we can also explicitly
+use the Mockery namespace with a shorter alias. For example:
+
+.. code-block:: php
+
+ use \Mockery as m;
+
+ class SimpleTest extends \PHPUnit\Framework\TestCase
+ {
+ public function testSimpleMock() {
+ $mock = m::mock('simplemock');
+ $mock->shouldReceive('foo')->with(5, m::any())->once()->andReturn(10);
+
+ $this->assertEquals(10, $mock->foo(5));
+ }
+
+ public function tearDown() {
+ m::close();
+ }
+ }
+
+Mockery ships with an autoloader so we don't need to litter our tests with
+``require_once()`` calls. To use it, ensure Mockery is on our
+``include_path`` and add the following to our test suite's ``Bootstrap.php``
+or ``TestHelper.php`` file:
+
+.. code-block:: php
+
+ require_once 'Mockery/Loader.php';
+ require_once 'Hamcrest/Hamcrest.php';
+
+ $loader = new \Mockery\Loader;
+ $loader->register();
+
+If we are using Composer, we can simplify this to including the Composer
+generated autoloader file:
+
+.. code-block:: php
+
+ require __DIR__ . '/../vendor/autoload.php'; // assuming vendor is one directory up
+
+.. caution::
+
+ Prior to Hamcrest 1.0.0, the ``Hamcrest.php`` file name had a small "h"
+ (i.e. ``hamcrest.php``). If upgrading Hamcrest to 1.0.0 remember to check
+ the file name is updated for all your projects.)
+
+To integrate Mockery into PHPUnit and avoid having to call the close method
+and have Mockery remove itself from code coverage reports, have your test case
+extends the ``\Mockery\Adapter\Phpunit\MockeryTestCase``:
+
+.. code-block:: php
+
+ class MyTest extends \Mockery\Adapter\Phpunit\MockeryTestCase
+ {
+
+ }
+
+An alternative is to use the supplied trait:
+
+.. code-block:: php
+
+ class MyTest extends \PHPUnit\Framework\TestCase
+ {
+ use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
+ }
+
+Extending ``MockeryTestCase`` or using the ``MockeryPHPUnitIntegration``
+trait is **the recommended way** of integrating Mockery with PHPUnit,
+since Mockery 1.0.0.
+
+PHPUnit listener
+----------------
+
+Before the 1.0.0 release, Mockery provided a PHPUnit listener that would
+call ``Mockery::close()`` for us at the end of a test. This has changed
+significantly since the 1.0.0 version.
+
+Now, Mockery provides a PHPUnit listener that makes tests fail if
+``Mockery::close()`` has not been called. It can help identify tests where
+we've forgotten to include the trait or extend the ``MockeryTestCase``.
+
+If we are using PHPUnit's XML configuration approach, we can include the
+following to load the ``TestListener``:
+
+.. code-block:: xml
+
+
+
+
+
+Make sure Composer's or Mockery's autoloader is present in the bootstrap file
+or we will need to also define a "file" attribute pointing to the file of the
+``TestListener`` class.
+
+.. caution::
+
+ The ``TestListener`` will only work for PHPUnit 6+ versions.
+
+ For PHPUnit versions 5 and lower, the test listener does not work.
+
+If we are creating the test suite programmatically we may add the listener
+like this:
+
+.. code-block:: php
+
+ // Create the suite.
+ $suite = new PHPUnit\Framework\TestSuite();
+
+ // Create the listener and add it to the suite.
+ $result = new PHPUnit\Framework\TestResult();
+ $result->addListener(new \Mockery\Adapter\Phpunit\TestListener());
+
+ // Run the tests.
+ $suite->run($result);
+
+.. caution::
+
+ PHPUnit provides a functionality that allows
+ `tests to run in a separated process `_,
+ to ensure better isolation. Mockery verifies the mocks expectations using the
+ ``Mockery::close()`` method, and provides a PHPUnit listener, that automatically
+ calls this method for us after every test.
+
+ However, this listener is not called in the right process when using
+ PHPUnit's process isolation, resulting in expectations that might not be
+ respected, but without raising any ``Mockery\Exception``. To avoid this,
+ we cannot rely on the supplied Mockery PHPUnit ``TestListener``, and we need
+ to explicitly call ``Mockery::close``. The easiest solution to include this
+ call in the ``tearDown()`` method, as explained previously.
diff --git a/vendor/mockery/mockery/docs/reference/protected_methods.rst b/vendor/mockery/mockery/docs/reference/protected_methods.rst
new file mode 100644
index 000000000..ec4a5bad8
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/protected_methods.rst
@@ -0,0 +1,26 @@
+.. index::
+ single: Mocking; Protected Methods
+
+Mocking Protected Methods
+=========================
+
+By default, Mockery does not allow mocking protected methods. We do not recommend
+mocking protected methods, but there are cases when there is no other solution.
+
+For those cases we have the ``shouldAllowMockingProtectedMethods()`` method. It
+instructs Mockery to specifically allow mocking of protected methods, for that
+one class only:
+
+.. code-block:: php
+
+ class MyClass
+ {
+ protected function foo()
+ {
+ }
+ }
+
+ $mock = \Mockery::mock('MyClass')
+ ->shouldAllowMockingProtectedMethods();
+ $mock->shouldReceive('foo');
+
diff --git a/vendor/mockery/mockery/docs/reference/public_properties.rst b/vendor/mockery/mockery/docs/reference/public_properties.rst
new file mode 100644
index 000000000..316566831
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/public_properties.rst
@@ -0,0 +1,20 @@
+.. index::
+ single: Mocking; Public Properties
+
+Mocking Public Properties
+=========================
+
+Mockery allows us to mock properties in several ways. One way is that we can set
+a public property and its value on any mock object. The second is that we can
+use the expectation methods ``set()`` and ``andSet()`` to set property values if
+that expectation is ever met.
+
+You can read more about :ref:`expectations-setting-public-properties`.
+
+.. note::
+
+ In general, Mockery does not support mocking any magic methods since these
+ are generally not considered a public API (and besides it is a bit difficult
+ to differentiate them when you badly need them for mocking!). So please mock
+ virtual properties (those relying on ``__get()`` and ``__set()``) as if they
+ were actually declared on the class.
diff --git a/vendor/mockery/mockery/docs/reference/public_static_properties.rst b/vendor/mockery/mockery/docs/reference/public_static_properties.rst
new file mode 100644
index 000000000..2396efc7c
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/public_static_properties.rst
@@ -0,0 +1,15 @@
+.. index::
+ single: Mocking; Public Static Methods
+
+Mocking Public Static Methods
+=============================
+
+Static methods are not called on real objects, so normal mock objects can't
+mock them. Mockery supports class aliased mocks, mocks representing a class
+name which would normally be loaded (via autoloading or a require statement)
+in the system under test. These aliases block that loading (unless via a
+require statement - so please use autoloading!) and allow Mockery to intercept
+static method calls and add expectations for them.
+
+See the :ref:`creating-test-doubles-aliasing` section for more information on
+creating aliased mocks, for the purpose of mocking public static methods.
diff --git a/vendor/mockery/mockery/docs/reference/spies.rst b/vendor/mockery/mockery/docs/reference/spies.rst
new file mode 100644
index 000000000..77f37f3db
--- /dev/null
+++ b/vendor/mockery/mockery/docs/reference/spies.rst
@@ -0,0 +1,154 @@
+.. index::
+ single: Reference; Spies
+
+Spies
+=====
+
+Spies are a type of test doubles, but they differ from stubs or mocks in that,
+that the spies record any interaction between the spy and the System Under Test
+(SUT), and allow us to make assertions against those interactions after the fact.
+
+Creating a spy means we don't have to set up expectations for every method call
+the double might receive during the test, some of which may not be relevant to
+the current test. A spy allows us to make assertions about the calls we care
+about for this test only, reducing the chances of over-specification and making
+our tests more clear.
+
+Spies also allow us to follow the more familiar Arrange-Act-Assert or
+Given-When-Then style within our tests. With mocks, we have to follow a less
+familiar style, something along the lines of Arrange-Expect-Act-Assert, where
+we have to tell our mocks what to expect before we act on the sut, then assert
+that those expectations where met:
+
+.. code-block:: php
+
+ // arrange
+ $mock = \Mockery::mock('MyDependency');
+ $sut = new MyClass($mock);
+
+ // expect
+ $mock->shouldReceive('foo')
+ ->once()
+ ->with('bar');
+
+ // act
+ $sut->callFoo();
+
+ // assert
+ \Mockery::close();
+
+Spies allow us to skip the expect part and move the assertion to after we have
+acted on the SUT, usually making our tests more readable:
+
+.. code-block:: php
+
+ // arrange
+ $spy = \Mockery::spy('MyDependency');
+ $sut = new MyClass($spy);
+
+ // act
+ $sut->callFoo();
+
+ // assert
+ $spy->shouldHaveReceived()
+ ->foo()
+ ->with('bar');
+
+On the other hand, spies are far less restrictive than mocks, meaning tests are
+usually less precise, as they let us get away with more. This is usually a
+good thing, they should only be as precise as they need to be, but while spies
+make our tests more intent-revealing, they do tend to reveal less about the
+design of the SUT. If we're having to setup lots of expectations for a mock,
+in lots of different tests, our tests are trying to tell us something - the SUT
+is doing too much and probably should be refactored. We don't get this with
+spies, they simply ignore the calls that aren't relevant to them.
+
+Another downside to using spies is debugging. When a mock receives a call that
+it wasn't expecting, it immediately throws an exception (failing fast), giving
+us a nice stack trace or possibly even invoking our debugger. With spies, we're
+simply asserting calls were made after the fact, so if the wrong calls were made,
+we don't have quite the same just in time context we have with the mocks.
+
+Finally, if we need to define a return value for our test double, we can't do
+that with a spy, only with a mock object.
+
+.. note::
+
+ This documentation page is an adaption of the blog post titled
+ `"Mockery Spies" `_,
+ published by Dave Marshall on his blog. Dave is the original author of spies
+ in Mockery.
+
+Spies Reference
+---------------
+
+To verify that a method was called on a spy, we use the ``shouldHaveReceived()``
+method:
+
+.. code-block:: php
+
+ $spy->shouldHaveReceived('foo');
+
+To verify that a method was **not** called on a spy, we use the
+``shouldNotHaveReceived()`` method:
+
+.. code-block:: php
+
+ $spy->shouldNotHaveReceived('foo');
+
+We can also do argument matching with spies:
+
+.. code-block:: php
+
+ $spy->shouldHaveReceived('foo')
+ ->with('bar');
+
+Argument matching is also possible by passing in an array of arguments to
+match:
+
+.. code-block:: php
+
+ $spy->shouldHaveReceived('foo', ['bar']);
+
+Although when verifying a method was not called, the argument matching can only
+be done by supplying the array of arguments as the 2nd argument to the
+``shouldNotHaveReceived()`` method:
+
+.. code-block:: php
+
+ $spy->shouldNotHaveReceived('foo', ['bar']);
+
+This is due to Mockery's internals.
+
+Finally, when expecting calls that should have been received, we can also verify
+the number of calls:
+
+.. code-block:: php
+
+ $spy->shouldHaveReceived('foo')
+ ->with('bar')
+ ->twice();
+
+Alternative shouldReceive syntax
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+As of Mockery 1.0.0, we support calling methods as we would call any PHP method,
+and not as string arguments to Mockery ``should*`` methods.
+
+In cases of spies, this only applies to the ``shouldHaveReceived()`` method:
+
+.. code-block:: php
+
+ $spy->shouldHaveReceived()
+ ->foo('bar');
+
+We can set expectation on number of calls as well:
+
+.. code-block:: php
+
+ $spy->shouldHaveReceived()
+ ->foo('bar')
+ ->twice();
+
+Unfortunately, due to limitations we can't support the same syntax for the
+``shouldNotHaveReceived()`` method.
diff --git a/vendor/mockery/mockery/library/Mockery.php b/vendor/mockery/mockery/library/Mockery.php
new file mode 100644
index 000000000..8725f9199
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery.php
@@ -0,0 +1,950 @@
+= 0) {
+ $builtInTypes[] = 'object';
+ }
+
+ return $builtInTypes;
+ }
+
+ /**
+ * @param string $type
+ * @return bool
+ */
+ public static function isBuiltInType($type)
+ {
+ return in_array($type, \Mockery::builtInTypes());
+ }
+
+ /**
+ * Static shortcut to \Mockery\Container::mock().
+ *
+ * @param array ...$args
+ *
+ * @return \Mockery\MockInterface
+ */
+ public static function mock(...$args)
+ {
+ return call_user_func_array(array(self::getContainer(), 'mock'), $args);
+ }
+
+ /**
+ * Static and semantic shortcut for getting a mock from the container
+ * and applying the spy's expected behavior into it.
+ *
+ * @param array ...$args
+ *
+ * @return \Mockery\MockInterface
+ */
+ public static function spy(...$args)
+ {
+ if (count($args) && $args[0] instanceof \Closure) {
+ $args[0] = new ClosureWrapper($args[0]);
+ }
+
+ return call_user_func_array(array(self::getContainer(), 'mock'), $args)->shouldIgnoreMissing();
+ }
+
+ /**
+ * Static and Semantic shortcut to \Mockery\Container::mock().
+ *
+ * @param array ...$args
+ *
+ * @return \Mockery\MockInterface
+ */
+ public static function instanceMock(...$args)
+ {
+ return call_user_func_array(array(self::getContainer(), 'mock'), $args);
+ }
+
+ /**
+ * Static shortcut to \Mockery\Container::mock(), first argument names the mock.
+ *
+ * @param array ...$args
+ *
+ * @return \Mockery\MockInterface
+ */
+ public static function namedMock(...$args)
+ {
+ $name = array_shift($args);
+
+ $builder = new MockConfigurationBuilder();
+ $builder->setName($name);
+
+ array_unshift($args, $builder);
+
+ return call_user_func_array(array(self::getContainer(), 'mock'), $args);
+ }
+
+ /**
+ * Static shortcut to \Mockery\Container::self().
+ *
+ * @throws LogicException
+ *
+ * @return \Mockery\MockInterface
+ */
+ public static function self()
+ {
+ if (is_null(self::$_container)) {
+ throw new \LogicException('You have not declared any mocks yet');
+ }
+
+ return self::$_container->self();
+ }
+
+ /**
+ * Static shortcut to closing up and verifying all mocks in the global
+ * container, and resetting the container static variable to null.
+ *
+ * @return void
+ */
+ public static function close()
+ {
+ foreach (self::$_filesToCleanUp as $fileName) {
+ @unlink($fileName);
+ }
+ self::$_filesToCleanUp = [];
+
+ if (is_null(self::$_container)) {
+ return;
+ }
+
+ $container = self::$_container;
+ self::$_container = null;
+
+ $container->mockery_teardown();
+ $container->mockery_close();
+ }
+
+ /**
+ * Static fetching of a mock associated with a name or explicit class poser.
+ *
+ * @param string $name
+ *
+ * @return \Mockery\Mock
+ */
+ public static function fetchMock($name)
+ {
+ return self::$_container->fetchMock($name);
+ }
+
+ /**
+ * Lazy loader and getter for
+ * the container property.
+ *
+ * @return Mockery\Container
+ */
+ public static function getContainer()
+ {
+ if (is_null(self::$_container)) {
+ self::$_container = new Mockery\Container(self::getGenerator(), self::getLoader());
+ }
+
+ return self::$_container;
+ }
+
+ /**
+ * Setter for the $_generator static propery.
+ *
+ * @param \Mockery\Generator\Generator $generator
+ */
+ public static function setGenerator(Generator $generator)
+ {
+ self::$_generator = $generator;
+ }
+
+ /**
+ * Lazy loader method and getter for
+ * the generator property.
+ *
+ * @return Generator
+ */
+ public static function getGenerator()
+ {
+ if (is_null(self::$_generator)) {
+ self::$_generator = self::getDefaultGenerator();
+ }
+
+ return self::$_generator;
+ }
+
+ /**
+ * Creates and returns a default generator
+ * used inside this class.
+ *
+ * @return CachingGenerator
+ */
+ public static function getDefaultGenerator()
+ {
+ return new CachingGenerator(StringManipulationGenerator::withDefaultPasses());
+ }
+
+ /**
+ * Setter for the $_loader static property.
+ *
+ * @param Loader $loader
+ */
+ public static function setLoader(Loader $loader)
+ {
+ self::$_loader = $loader;
+ }
+
+ /**
+ * Lazy loader method and getter for
+ * the $_loader property.
+ *
+ * @return Loader
+ */
+ public static function getLoader()
+ {
+ if (is_null(self::$_loader)) {
+ self::$_loader = self::getDefaultLoader();
+ }
+
+ return self::$_loader;
+ }
+
+ /**
+ * Gets an EvalLoader to be used as default.
+ *
+ * @return EvalLoader
+ */
+ public static function getDefaultLoader()
+ {
+ return new EvalLoader();
+ }
+
+ /**
+ * Set the container.
+ *
+ * @param \Mockery\Container $container
+ *
+ * @return \Mockery\Container
+ */
+ public static function setContainer(Mockery\Container $container)
+ {
+ return self::$_container = $container;
+ }
+
+ /**
+ * Reset the container to null.
+ *
+ * @return void
+ */
+ public static function resetContainer()
+ {
+ self::$_container = null;
+ }
+
+ /**
+ * Return instance of ANY matcher.
+ *
+ * @return \Mockery\Matcher\Any
+ */
+ public static function any()
+ {
+ return new \Mockery\Matcher\Any();
+ }
+
+ /**
+ * Return instance of AndAnyOtherArgs matcher.
+ *
+ * An alternative name to `andAnyOtherArgs` so
+ * the API stays closer to `any` as well.
+ *
+ * @return \Mockery\Matcher\AndAnyOtherArgs
+ */
+ public static function andAnyOthers()
+ {
+ return new \Mockery\Matcher\AndAnyOtherArgs();
+ }
+
+ /**
+ * Return instance of AndAnyOtherArgs matcher.
+ *
+ * @return \Mockery\Matcher\AndAnyOtherArgs
+ */
+ public static function andAnyOtherArgs()
+ {
+ return new \Mockery\Matcher\AndAnyOtherArgs();
+ }
+
+ /**
+ * Return instance of TYPE matcher.
+ *
+ * @param mixed $expected
+ *
+ * @return \Mockery\Matcher\Type
+ */
+ public static function type($expected)
+ {
+ return new \Mockery\Matcher\Type($expected);
+ }
+
+ /**
+ * Return instance of DUCKTYPE matcher.
+ *
+ * @param array ...$args
+ *
+ * @return \Mockery\Matcher\Ducktype
+ */
+ public static function ducktype(...$args)
+ {
+ return new \Mockery\Matcher\Ducktype($args);
+ }
+
+ /**
+ * Return instance of SUBSET matcher.
+ *
+ * @param array $part
+ * @param bool $strict - (Optional) True for strict comparison, false for loose
+ *
+ * @return \Mockery\Matcher\Subset
+ */
+ public static function subset(array $part, $strict = true)
+ {
+ return new \Mockery\Matcher\Subset($part, $strict);
+ }
+
+ /**
+ * Return instance of CONTAINS matcher.
+ *
+ * @param array ...$args
+ *
+ * @return \Mockery\Matcher\Contains
+ */
+ public static function contains(...$args)
+ {
+ return new \Mockery\Matcher\Contains($args);
+ }
+
+ /**
+ * Return instance of HASKEY matcher.
+ *
+ * @param mixed $key
+ *
+ * @return \Mockery\Matcher\HasKey
+ */
+ public static function hasKey($key)
+ {
+ return new \Mockery\Matcher\HasKey($key);
+ }
+
+ /**
+ * Return instance of HASVALUE matcher.
+ *
+ * @param mixed $val
+ *
+ * @return \Mockery\Matcher\HasValue
+ */
+ public static function hasValue($val)
+ {
+ return new \Mockery\Matcher\HasValue($val);
+ }
+
+ /**
+ * Return instance of CLOSURE matcher.
+ *
+ * @param mixed $closure
+ *
+ * @return \Mockery\Matcher\Closure
+ */
+ public static function on($closure)
+ {
+ return new \Mockery\Matcher\Closure($closure);
+ }
+
+ /**
+ * Return instance of MUSTBE matcher.
+ *
+ * @param mixed $expected
+ *
+ * @return \Mockery\Matcher\MustBe
+ */
+ public static function mustBe($expected)
+ {
+ return new \Mockery\Matcher\MustBe($expected);
+ }
+
+ /**
+ * Return instance of NOT matcher.
+ *
+ * @param mixed $expected
+ *
+ * @return \Mockery\Matcher\Not
+ */
+ public static function not($expected)
+ {
+ return new \Mockery\Matcher\Not($expected);
+ }
+
+ /**
+ * Return instance of ANYOF matcher.
+ *
+ * @param array ...$args
+ *
+ * @return \Mockery\Matcher\AnyOf
+ */
+ public static function anyOf(...$args)
+ {
+ return new \Mockery\Matcher\AnyOf($args);
+ }
+
+ /**
+ * Return instance of NOTANYOF matcher.
+ *
+ * @param array ...$args
+ *
+ * @return \Mockery\Matcher\NotAnyOf
+ */
+ public static function notAnyOf(...$args)
+ {
+ return new \Mockery\Matcher\NotAnyOf($args);
+ }
+
+ /**
+ * Return instance of PATTERN matcher.
+ *
+ * @param mixed $expected
+ *
+ * @return \Mockery\Matcher\Pattern
+ */
+ public static function pattern($expected)
+ {
+ return new \Mockery\Matcher\Pattern($expected);
+ }
+
+ /**
+ * Lazy loader and Getter for the global
+ * configuration container.
+ *
+ * @return \Mockery\Configuration
+ */
+ public static function getConfiguration()
+ {
+ if (is_null(self::$_config)) {
+ self::$_config = new \Mockery\Configuration();
+ }
+
+ return self::$_config;
+ }
+
+ /**
+ * Utility method to format method name and arguments into a string.
+ *
+ * @param string $method
+ * @param array $arguments
+ *
+ * @return string
+ */
+ public static function formatArgs($method, array $arguments = null)
+ {
+ if (is_null($arguments)) {
+ return $method . '()';
+ }
+
+ $formattedArguments = array();
+ foreach ($arguments as $argument) {
+ $formattedArguments[] = self::formatArgument($argument);
+ }
+
+ return $method . '(' . implode(', ', $formattedArguments) . ')';
+ }
+
+ /**
+ * Gets the string representation
+ * of any passed argument.
+ *
+ * @param mixed $argument
+ * @param int $depth
+ *
+ * @return mixed
+ */
+ private static function formatArgument($argument, $depth = 0)
+ {
+ if ($argument instanceof MatcherAbstract) {
+ return (string) $argument;
+ }
+
+ if (is_object($argument)) {
+ return 'object(' . get_class($argument) . ')';
+ }
+
+ if (is_int($argument) || is_float($argument)) {
+ return $argument;
+ }
+
+ if (is_array($argument)) {
+ if ($depth === 1) {
+ $argument = '[...]';
+ } else {
+ $sample = array();
+ foreach ($argument as $key => $value) {
+ $key = is_int($key) ? $key : "'$key'";
+ $value = self::formatArgument($value, $depth + 1);
+ $sample[] = "$key => $value";
+ }
+
+ $argument = "[".implode(", ", $sample)."]";
+ }
+
+ return ((strlen($argument) > 1000) ? substr($argument, 0, 1000).'...]' : $argument);
+ }
+
+ if (is_bool($argument)) {
+ return $argument ? 'true' : 'false';
+ }
+
+ if (is_resource($argument)) {
+ return 'resource(...)';
+ }
+
+ if (is_null($argument)) {
+ return 'NULL';
+ }
+
+ return "'".(string) $argument."'";
+ }
+
+ /**
+ * Utility function to format objects to printable arrays.
+ *
+ * @param array $objects
+ *
+ * @return string
+ */
+ public static function formatObjects(array $objects = null)
+ {
+ static $formatting;
+
+ if ($formatting) {
+ return '[Recursion]';
+ }
+
+ if (is_null($objects)) {
+ return '';
+ }
+
+ $objects = array_filter($objects, 'is_object');
+ if (empty($objects)) {
+ return '';
+ }
+
+ $formatting = true;
+ $parts = array();
+
+ foreach ($objects as $object) {
+ $parts[get_class($object)] = self::objectToArray($object);
+ }
+
+ $formatting = false;
+
+ return 'Objects: ( ' . var_export($parts, true) . ')';
+ }
+
+ /**
+ * Utility function to turn public properties and public get* and is* method values into an array.
+ *
+ * @param object $object
+ * @param int $nesting
+ *
+ * @return array
+ */
+ private static function objectToArray($object, $nesting = 3)
+ {
+ if ($nesting == 0) {
+ return array('...');
+ }
+
+ return array(
+ 'class' => get_class($object),
+ 'properties' => self::extractInstancePublicProperties($object, $nesting)
+ );
+ }
+
+ /**
+ * Returns all public instance properties.
+ *
+ * @param mixed $object
+ * @param int $nesting
+ *
+ * @return array
+ */
+ private static function extractInstancePublicProperties($object, $nesting)
+ {
+ $reflection = new \ReflectionClass(get_class($object));
+ $properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC);
+ $cleanedProperties = array();
+
+ foreach ($properties as $publicProperty) {
+ if (!$publicProperty->isStatic()) {
+ $name = $publicProperty->getName();
+ $cleanedProperties[$name] = self::cleanupNesting($object->$name, $nesting);
+ }
+ }
+
+ return $cleanedProperties;
+ }
+
+ /**
+ * Utility method used for recursively generating
+ * an object or array representation.
+ *
+ * @param mixed $argument
+ * @param int $nesting
+ *
+ * @return mixed
+ */
+ private static function cleanupNesting($argument, $nesting)
+ {
+ if (is_object($argument)) {
+ $object = self::objectToArray($argument, $nesting - 1);
+ $object['class'] = get_class($argument);
+
+ return $object;
+ }
+
+ if (is_array($argument)) {
+ return self::cleanupArray($argument, $nesting - 1);
+ }
+
+ return $argument;
+ }
+
+ /**
+ * Utility method for recursively
+ * gerating a representation
+ * of the given array.
+ *
+ * @param array $argument
+ * @param int $nesting
+ *
+ * @return mixed
+ */
+ private static function cleanupArray($argument, $nesting = 3)
+ {
+ if ($nesting == 0) {
+ return '...';
+ }
+
+ foreach ($argument as $key => $value) {
+ if (is_array($value)) {
+ $argument[$key] = self::cleanupArray($value, $nesting - 1);
+ } elseif (is_object($value)) {
+ $argument[$key] = self::objectToArray($value, $nesting - 1);
+ }
+ }
+
+ return $argument;
+ }
+
+ /**
+ * Utility function to parse shouldReceive() arguments and generate
+ * expectations from such as needed.
+ *
+ * @param Mockery\MockInterface $mock
+ * @param array ...$args
+ * @param callable $add
+ * @return \Mockery\CompositeExpectation
+ */
+ public static function parseShouldReturnArgs(\Mockery\MockInterface $mock, $args, $add)
+ {
+ $composite = new \Mockery\CompositeExpectation();
+
+ foreach ($args as $arg) {
+ if (is_array($arg)) {
+ foreach ($arg as $k => $v) {
+ $expectation = self::buildDemeterChain($mock, $k, $add)->andReturn($v);
+ $composite->add($expectation);
+ }
+ } elseif (is_string($arg)) {
+ $expectation = self::buildDemeterChain($mock, $arg, $add);
+ $composite->add($expectation);
+ }
+ }
+
+ return $composite;
+ }
+
+ /**
+ * Sets up expectations on the members of the CompositeExpectation and
+ * builds up any demeter chain that was passed to shouldReceive.
+ *
+ * @param \Mockery\MockInterface $mock
+ * @param string $arg
+ * @param callable $add
+ * @throws Mockery\Exception
+ * @return \Mockery\ExpectationInterface
+ */
+ protected static function buildDemeterChain(\Mockery\MockInterface $mock, $arg, $add)
+ {
+ /** @var Mockery\Container $container */
+ $container = $mock->mockery_getContainer();
+ $methodNames = explode('->', $arg);
+ reset($methodNames);
+
+ if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()
+ && !$mock->mockery_isAnonymous()
+ && !in_array(current($methodNames), $mock->mockery_getMockableMethods())
+ ) {
+ throw new \Mockery\Exception(
+ 'Mockery\'s configuration currently forbids mocking the method '
+ . current($methodNames) . ' as it does not exist on the class or object '
+ . 'being mocked'
+ );
+ }
+
+ /** @var ExpectationInterface|null $expectations */
+ $expectations = null;
+
+ /** @var Callable $nextExp */
+ $nextExp = function ($method) use ($add) {
+ return $add($method);
+ };
+
+ $parent = get_class($mock);
+
+ while (true) {
+ $method = array_shift($methodNames);
+ $expectations = $mock->mockery_getExpectationsFor($method);
+
+ if (is_null($expectations) || self::noMoreElementsInChain($methodNames)) {
+ $expectations = $nextExp($method);
+ if (self::noMoreElementsInChain($methodNames)) {
+ break;
+ }
+
+ $mock = self::getNewDemeterMock($container, $parent, $method, $expectations);
+ } else {
+ $demeterMockKey = $container->getKeyOfDemeterMockFor($method, $parent);
+ if ($demeterMockKey) {
+ $mock = self::getExistingDemeterMock($container, $demeterMockKey);
+ }
+ }
+
+ $parent .= '->' . $method;
+
+ $nextExp = function ($n) use ($mock) {
+ return $mock->shouldReceive($n);
+ };
+ }
+
+ return $expectations;
+ }
+
+ /**
+ * Gets a new demeter configured
+ * mock from the container.
+ *
+ * @param \Mockery\Container $container
+ * @param string $parent
+ * @param string $method
+ * @param Mockery\ExpectationInterface $exp
+ *
+ * @return \Mockery\Mock
+ */
+ private static function getNewDemeterMock(
+ Mockery\Container $container,
+ $parent,
+ $method,
+ Mockery\ExpectationInterface $exp
+ ) {
+ $newMockName = 'demeter_' . md5($parent) . '_' . $method;
+
+ if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
+ $parRef = null;
+ $parRefMethod = null;
+ $parRefMethodRetType = null;
+
+ $parentMock = $exp->getMock();
+ if ($parentMock !== null) {
+ $parRef = new ReflectionObject($parentMock);
+ }
+
+ if ($parRef !== null && $parRef->hasMethod($method)) {
+ $parRefMethod = $parRef->getMethod($method);
+ $parRefMethodRetType = $parRefMethod->getReturnType();
+
+ if ($parRefMethodRetType !== null) {
+ $mock = self::namedMock($newMockName, (string) $parRefMethodRetType);
+ $exp->andReturn($mock);
+
+ return $mock;
+ }
+ }
+ }
+
+ $mock = $container->mock($newMockName);
+ $exp->andReturn($mock);
+
+ return $mock;
+ }
+
+ /**
+ * Gets an specific demeter mock from
+ * the ones kept by the container.
+ *
+ * @param \Mockery\Container $container
+ * @param string $demeterMockKey
+ *
+ * @return mixed
+ */
+ private static function getExistingDemeterMock(
+ Mockery\Container $container,
+ $demeterMockKey
+ ) {
+ $mocks = $container->getMocks();
+ $mock = $mocks[$demeterMockKey];
+
+ return $mock;
+ }
+
+ /**
+ * Checks if the passed array representing a demeter
+ * chain with the method names is empty.
+ *
+ * @param array $methodNames
+ *
+ * @return bool
+ */
+ private static function noMoreElementsInChain(array $methodNames)
+ {
+ return empty($methodNames);
+ }
+
+ public static function declareClass($fqn)
+ {
+ return static::declareType($fqn, "class");
+ }
+
+ public static function declareInterface($fqn)
+ {
+ return static::declareType($fqn, "interface");
+ }
+
+ private static function declareType($fqn, $type)
+ {
+ $targetCode = "trait = new TestListenerTrait();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function endTest(\PHPUnit_Framework_Test $test, $time)
+ {
+ $this->trait->endTest($test, $time);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
+ {
+ $this->trait->startTestSuite();
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerForV6.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerForV6.php
new file mode 100644
index 000000000..815b13c1a
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerForV6.php
@@ -0,0 +1,51 @@
+trait = new TestListenerTrait();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function endTest(Test $test, $time)
+ {
+ $this->trait->endTest($test, $time);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function startTestSuite(TestSuite $suite)
+ {
+ $this->trait->startTestSuite();
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerForV7.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerForV7.php
new file mode 100644
index 000000000..d590825ab
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerForV7.php
@@ -0,0 +1,55 @@
+trait = new TestListenerTrait();
+ }
+
+
+ /**
+ * {@inheritdoc}
+ */
+ public function endTest(Test $test, float $time): void
+ {
+ $this->trait->endTest($test, $time);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function startTestSuite(TestSuite $suite): void
+ {
+ $this->trait->startTestSuite();
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerTrait.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerTrait.php
new file mode 100644
index 000000000..08848b88a
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/Legacy/TestListenerTrait.php
@@ -0,0 +1,90 @@
+getStatus() !== BaseTestRunner::STATUS_PASSED) {
+ // If the test didn't pass there is no guarantee that
+ // verifyMockObjects and assertPostConditions have been called.
+ // And even if it did, the point here is to prevent false
+ // negatives, not to make failing tests fail for more reasons.
+ return;
+ }
+
+ try {
+ // The self() call is used as a sentinel. Anything that throws if
+ // the container is closed already will do.
+ \Mockery::self();
+ } catch (\LogicException $_) {
+ return;
+ }
+
+ $e = new ExpectationFailedException(
+ \sprintf(
+ "Mockery's expectations have not been verified. Make sure that \Mockery::close() is called at the end of the test. Consider using %s\MockeryPHPUnitIntegration or extending %s\MockeryTestCase.",
+ __NAMESPACE__,
+ __NAMESPACE__
+ )
+ );
+
+ /** @var \PHPUnit\Framework\TestResult $result */
+ $result = $test->getTestResultObject();
+
+ if ($result !== null) {
+ $result->addFailure($test, $e, $time);
+ }
+ }
+
+ public function startTestSuite()
+ {
+ Blacklist::$blacklistedClassNames[\Mockery::class] = 1;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php
new file mode 100644
index 000000000..9d3429355
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php
@@ -0,0 +1,88 @@
+addMockeryExpectationsToAssertionCount();
+ $this->checkMockeryExceptions();
+ $this->closeMockery();
+
+ parent::assertPostConditions();
+ }
+
+ protected function addMockeryExpectationsToAssertionCount()
+ {
+ $this->addToAssertionCount(Mockery::getContainer()->mockery_getExpectationCount());
+ }
+
+ protected function checkMockeryExceptions()
+ {
+ if (!method_exists($this, "markAsRisky")) {
+ return;
+ }
+
+ foreach (Mockery::getContainer()->mockery_thrownExceptions() as $e) {
+ if (!$e->dismissed()) {
+ $this->markAsRisky();
+ }
+ }
+ }
+
+ protected function closeMockery()
+ {
+ Mockery::close();
+ $this->mockeryOpen = false;
+ }
+
+ /**
+ * @before
+ */
+ protected function startMockery()
+ {
+ $this->mockeryOpen = true;
+ }
+
+ /**
+ * @after
+ */
+ protected function purgeMockeryContainer()
+ {
+ if ($this->mockeryOpen) {
+ // post conditions wasn't called, so test probably failed
+ Mockery::close();
+ }
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php
new file mode 100644
index 000000000..f4e9a86a6
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php
@@ -0,0 +1,26 @@
+closure = $closure;
+ }
+
+ public function __invoke()
+ {
+ return call_user_func_array($this->closure, func_get_args());
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php b/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php
new file mode 100644
index 000000000..86e390454
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php
@@ -0,0 +1,154 @@
+_expectations[] = $expectation;
+ }
+
+ /**
+ * @param mixed ...$args
+ */
+ public function andReturn(...$args)
+ {
+ return $this->__call(__FUNCTION__, $args);
+ }
+
+ /**
+ * Set a return value, or sequential queue of return values
+ *
+ * @param mixed ...$args
+ * @return self
+ */
+ public function andReturns(...$args)
+ {
+ return call_user_func_array([$this, 'andReturn'], $args);
+ }
+
+ /**
+ * Intercept any expectation calls and direct against all expectations
+ *
+ * @param string $method
+ * @param array $args
+ * @return self
+ */
+ public function __call($method, array $args)
+ {
+ foreach ($this->_expectations as $expectation) {
+ call_user_func_array(array($expectation, $method), $args);
+ }
+ return $this;
+ }
+
+ /**
+ * Return order number of the first expectation
+ *
+ * @return int
+ */
+ public function getOrderNumber()
+ {
+ reset($this->_expectations);
+ $first = current($this->_expectations);
+ return $first->getOrderNumber();
+ }
+
+ /**
+ * Return the parent mock of the first expectation
+ *
+ * @return \Mockery\MockInterface
+ */
+ public function getMock()
+ {
+ reset($this->_expectations);
+ $first = current($this->_expectations);
+ return $first->getMock();
+ }
+
+ /**
+ * Mockery API alias to getMock
+ *
+ * @return \Mockery\MockInterface
+ */
+ public function mock()
+ {
+ return $this->getMock();
+ }
+
+ /**
+ * Starts a new expectation addition on the first mock which is the primary
+ * target outside of a demeter chain
+ *
+ * @param mixed ...$args
+ * @return \Mockery\Expectation
+ */
+ public function shouldReceive(...$args)
+ {
+ reset($this->_expectations);
+ $first = current($this->_expectations);
+ return call_user_func_array(array($first->getMock(), 'shouldReceive'), $args);
+ }
+
+ /**
+ * Starts a new expectation addition on the first mock which is the primary
+ * target outside of a demeter chain
+ *
+ * @param mixed ...$args
+ * @return \Mockery\Expectation
+ */
+ public function shouldNotReceive(...$args)
+ {
+ reset($this->_expectations);
+ $first = current($this->_expectations);
+ return call_user_func_array(array($first->getMock(), 'shouldNotReceive'), $args);
+ }
+
+ /**
+ * Return the string summary of this composite expectation
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = '[';
+ $parts = array();
+ foreach ($this->_expectations as $exp) {
+ $parts[] = (string) $exp;
+ }
+ $return .= implode(', ', $parts) . ']';
+ return $return;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Configuration.php b/vendor/mockery/mockery/library/Mockery/Configuration.php
new file mode 100644
index 000000000..eaf7ffe41
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Configuration.php
@@ -0,0 +1,190 @@
+_allowMockingNonExistentMethod = (bool) $flag;
+ }
+
+ /**
+ * Return flag indicating whether mocking non-existent methods allowed
+ *
+ * @return bool
+ */
+ public function mockingNonExistentMethodsAllowed()
+ {
+ return $this->_allowMockingNonExistentMethod;
+ }
+
+ /**
+ * @deprecated
+ *
+ * Set boolean to allow/prevent unnecessary mocking of methods
+ *
+ * @param bool $flag
+ */
+ public function allowMockingMethodsUnnecessarily($flag = true)
+ {
+ trigger_error(sprintf("The %s method is deprecated and will be removed in a future version of Mockery", __METHOD__), E_USER_DEPRECATED);
+
+ $this->_allowMockingMethodsUnnecessarily = (bool) $flag;
+ }
+
+ /**
+ * Return flag indicating whether mocking non-existent methods allowed
+ *
+ * @return bool
+ */
+ public function mockingMethodsUnnecessarilyAllowed()
+ {
+ trigger_error(sprintf("The %s method is deprecated and will be removed in a future version of Mockery", __METHOD__), E_USER_DEPRECATED);
+
+ return $this->_allowMockingMethodsUnnecessarily;
+ }
+
+ /**
+ * Set a parameter map (array of param signature strings) for the method
+ * of an internal PHP class.
+ *
+ * @param string $class
+ * @param string $method
+ * @param array $map
+ */
+ public function setInternalClassMethodParamMap($class, $method, array $map)
+ {
+ if (!isset($this->_internalClassParamMap[strtolower($class)])) {
+ $this->_internalClassParamMap[strtolower($class)] = array();
+ }
+ $this->_internalClassParamMap[strtolower($class)][strtolower($method)] = $map;
+ }
+
+ /**
+ * Remove all overriden parameter maps from internal PHP classes.
+ */
+ public function resetInternalClassMethodParamMaps()
+ {
+ $this->_internalClassParamMap = array();
+ }
+
+ /**
+ * Get the parameter map of an internal PHP class method
+ *
+ * @return array
+ */
+ public function getInternalClassMethodParamMap($class, $method)
+ {
+ if (isset($this->_internalClassParamMap[strtolower($class)][strtolower($method)])) {
+ return $this->_internalClassParamMap[strtolower($class)][strtolower($method)];
+ }
+ }
+
+ public function getInternalClassMethodParamMaps()
+ {
+ return $this->_internalClassParamMap;
+ }
+
+ public function setConstantsMap(array $map)
+ {
+ $this->_constantsMap = $map;
+ }
+
+ public function getConstantsMap()
+ {
+ return $this->_constantsMap;
+ }
+
+ /**
+ * Disable reflection caching
+ *
+ * It should be always enabled, except when using
+ * PHPUnit's --static-backup option.
+ *
+ * @see https://github.com/mockery/mockery/issues/268
+ */
+ public function disableReflectionCache()
+ {
+ $this->_reflectionCacheEnabled = false;
+ }
+
+ /**
+ * Enable reflection caching
+ *
+ * It should be always enabled, except when using
+ * PHPUnit's --static-backup option.
+ *
+ * @see https://github.com/mockery/mockery/issues/268
+ */
+ public function enableReflectionCache()
+ {
+ $this->_reflectionCacheEnabled = true;
+ }
+
+ /**
+ * Is reflection cache enabled?
+ */
+ public function reflectionCacheEnabled()
+ {
+ return $this->_reflectionCacheEnabled;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Container.php b/vendor/mockery/mockery/library/Mockery/Container.php
new file mode 100644
index 000000000..5287ac4fb
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Container.php
@@ -0,0 +1,539 @@
+_generator = $generator ?: \Mockery::getDefaultGenerator();
+ $this->_loader = $loader ?: \Mockery::getDefaultLoader();
+ }
+
+ /**
+ * Generates a new mock object for this container
+ *
+ * I apologies in advance for this. A God Method just fits the API which
+ * doesn't require differentiating between classes, interfaces, abstracts,
+ * names or partials - just so long as it's something that can be mocked.
+ * I'll refactor it one day so it's easier to follow.
+ *
+ * @param array ...$args
+ *
+ * @return Mock
+ * @throws Exception\RuntimeException
+ */
+ public function mock(...$args)
+ {
+ $expectationClosure = null;
+ $quickdefs = array();
+ $constructorArgs = null;
+ $blocks = array();
+ $class = null;
+
+ if (count($args) > 1) {
+ $finalArg = end($args);
+ reset($args);
+ if (is_callable($finalArg) && is_object($finalArg)) {
+ $expectationClosure = array_pop($args);
+ }
+ }
+
+ $builder = new MockConfigurationBuilder();
+
+ foreach ($args as $k => $arg) {
+ if ($arg instanceof MockConfigurationBuilder) {
+ $builder = $arg;
+ unset($args[$k]);
+ }
+ }
+ reset($args);
+
+ $builder->setParameterOverrides(\Mockery::getConfiguration()->getInternalClassMethodParamMaps());
+ $builder->setConstantsMap(\Mockery::getConfiguration()->getConstantsMap());
+
+ while (count($args) > 0) {
+ $arg = current($args);
+ // check for multiple interfaces
+ if (is_string($arg) && strpos($arg, ',') && !strpos($arg, ']')) {
+ $interfaces = explode(',', str_replace(' ', '', $arg));
+ $builder->addTargets($interfaces);
+ array_shift($args);
+
+ continue;
+ } elseif (is_string($arg) && substr($arg, 0, 6) == 'alias:') {
+ $name = array_shift($args);
+ $name = str_replace('alias:', '', $name);
+ $builder->addTarget('stdClass');
+ $builder->setName($name);
+ continue;
+ } elseif (is_string($arg) && substr($arg, 0, 9) == 'overload:') {
+ $name = array_shift($args);
+ $name = str_replace('overload:', '', $name);
+ $builder->setInstanceMock(true);
+ $builder->addTarget('stdClass');
+ $builder->setName($name);
+ continue;
+ } elseif (is_string($arg) && substr($arg, strlen($arg)-1, 1) == ']') {
+ $parts = explode('[', $arg);
+ if (!class_exists($parts[0], true) && !interface_exists($parts[0], true)) {
+ throw new \Mockery\Exception('Can only create a partial mock from'
+ . ' an existing class or interface');
+ }
+ $class = $parts[0];
+ $parts[1] = str_replace(' ', '', $parts[1]);
+ $partialMethods = explode(',', strtolower(rtrim($parts[1], ']')));
+ $builder->addTarget($class);
+ $builder->setWhiteListedMethods($partialMethods);
+ array_shift($args);
+ continue;
+ } elseif (is_string($arg) && (class_exists($arg, true) || interface_exists($arg, true) || trait_exists($arg, true))) {
+ $class = array_shift($args);
+ $builder->addTarget($class);
+ continue;
+ } elseif (is_string($arg) && !\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() && (!class_exists($arg, true) && !interface_exists($arg, true))) {
+ throw new \Mockery\Exception("Mockery can't find '$arg' so can't mock it");
+ } elseif (is_string($arg)) {
+ if (!$this->isValidClassName($arg)) {
+ throw new \Mockery\Exception('Class name contains invalid characters');
+ }
+ $class = array_shift($args);
+ $builder->addTarget($class);
+ continue;
+ } elseif (is_object($arg)) {
+ $partial = array_shift($args);
+ $builder->addTarget($partial);
+ continue;
+ } elseif (is_array($arg) && !empty($arg) && array_keys($arg) !== range(0, count($arg) - 1)) {
+ // if associative array
+ if (array_key_exists(self::BLOCKS, $arg)) {
+ $blocks = $arg[self::BLOCKS];
+ }
+ unset($arg[self::BLOCKS]);
+ $quickdefs = array_shift($args);
+ continue;
+ } elseif (is_array($arg)) {
+ $constructorArgs = array_shift($args);
+ continue;
+ }
+
+ throw new \Mockery\Exception(
+ 'Unable to parse arguments sent to '
+ . get_class($this) . '::mock()'
+ );
+ }
+
+ $builder->addBlackListedMethods($blocks);
+
+ if (defined('HHVM_VERSION')
+ && ($class === 'Exception' || is_subclass_of($class, 'Exception'))) {
+ $builder->addBlackListedMethod("setTraceOptions");
+ $builder->addBlackListedMethod("getTraceOptions");
+ }
+
+ if (!is_null($constructorArgs)) {
+ $builder->addBlackListedMethod("__construct"); // we need to pass through
+ } else {
+ $builder->setMockOriginalDestructor(true);
+ }
+
+ if (!empty($partialMethods) && $constructorArgs === null) {
+ $constructorArgs = array();
+ }
+
+ $config = $builder->getMockConfiguration();
+
+ $this->checkForNamedMockClashes($config);
+
+ $def = $this->getGenerator()->generate($config);
+
+ if (class_exists($def->getClassName(), $attemptAutoload = false)) {
+ $rfc = new \ReflectionClass($def->getClassName());
+ if (!$rfc->implementsInterface("Mockery\MockInterface")) {
+ throw new \Mockery\Exception\RuntimeException("Could not load mock {$def->getClassName()}, class already exists");
+ }
+ }
+
+ $this->getLoader()->load($def);
+
+ $mock = $this->_getInstance($def->getClassName(), $constructorArgs);
+ $mock->mockery_init($this, $config->getTargetObject());
+
+ if (!empty($quickdefs)) {
+ $mock->shouldReceive($quickdefs)->byDefault();
+ }
+ if (!empty($expectationClosure)) {
+ $expectationClosure($mock);
+ }
+ $this->rememberMock($mock);
+ return $mock;
+ }
+
+ public function instanceMock()
+ {
+ }
+
+ public function getLoader()
+ {
+ return $this->_loader;
+ }
+
+ public function getGenerator()
+ {
+ return $this->_generator;
+ }
+
+ /**
+ * @param string $method
+ * @param string $parent
+ * @return string|null
+ */
+ public function getKeyOfDemeterMockFor($method, $parent)
+ {
+ $keys = array_keys($this->_mocks);
+ $match = preg_grep("/__demeter_" . md5($parent) . "_{$method}$/", $keys);
+ if (count($match) == 1) {
+ $res = array_values($match);
+ if (count($res) > 0) {
+ return $res[0];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return array
+ */
+ public function getMocks()
+ {
+ return $this->_mocks;
+ }
+
+ /**
+ * Tear down tasks for this container
+ *
+ * @throws \Exception
+ * @return void
+ */
+ public function mockery_teardown()
+ {
+ try {
+ $this->mockery_verify();
+ } catch (\Exception $e) {
+ $this->mockery_close();
+ throw $e;
+ }
+ }
+
+ /**
+ * Verify the container mocks
+ *
+ * @return void
+ */
+ public function mockery_verify()
+ {
+ foreach ($this->_mocks as $mock) {
+ $mock->mockery_verify();
+ }
+ }
+
+ /**
+ * Retrieves all exceptions thrown by mocks
+ *
+ * @return array
+ */
+ public function mockery_thrownExceptions()
+ {
+ $e = [];
+
+ foreach ($this->_mocks as $mock) {
+ $e = array_merge($e, $mock->mockery_thrownExceptions());
+ }
+
+ return $e;
+ }
+
+ /**
+ * Reset the container to its original state
+ *
+ * @return void
+ */
+ public function mockery_close()
+ {
+ foreach ($this->_mocks as $mock) {
+ $mock->mockery_teardown();
+ }
+ $this->_mocks = array();
+ }
+
+ /**
+ * Fetch the next available allocation order number
+ *
+ * @return int
+ */
+ public function mockery_allocateOrder()
+ {
+ $this->_allocatedOrder += 1;
+ return $this->_allocatedOrder;
+ }
+
+ /**
+ * Set ordering for a group
+ *
+ * @param mixed $group
+ * @param int $order
+ */
+ public function mockery_setGroup($group, $order)
+ {
+ $this->_groups[$group] = $order;
+ }
+
+ /**
+ * Fetch array of ordered groups
+ *
+ * @return array
+ */
+ public function mockery_getGroups()
+ {
+ return $this->_groups;
+ }
+
+ /**
+ * Set current ordered number
+ *
+ * @param int $order
+ * @return int The current order number that was set
+ */
+ public function mockery_setCurrentOrder($order)
+ {
+ $this->_currentOrder = $order;
+ return $this->_currentOrder;
+ }
+
+ /**
+ * Get current ordered number
+ *
+ * @return int
+ */
+ public function mockery_getCurrentOrder()
+ {
+ return $this->_currentOrder;
+ }
+
+ /**
+ * Validate the current mock's ordering
+ *
+ * @param string $method
+ * @param int $order
+ * @throws \Mockery\Exception
+ * @return void
+ */
+ public function mockery_validateOrder($method, $order, \Mockery\MockInterface $mock)
+ {
+ if ($order < $this->_currentOrder) {
+ $exception = new \Mockery\Exception\InvalidOrderException(
+ 'Method ' . $method . ' called out of order: expected order '
+ . $order . ', was ' . $this->_currentOrder
+ );
+ $exception->setMock($mock)
+ ->setMethodName($method)
+ ->setExpectedOrder($order)
+ ->setActualOrder($this->_currentOrder);
+ throw $exception;
+ }
+ $this->mockery_setCurrentOrder($order);
+ }
+
+ /**
+ * Gets the count of expectations on the mocks
+ *
+ * @return int
+ */
+ public function mockery_getExpectationCount()
+ {
+ $count = 0;
+ foreach ($this->_mocks as $mock) {
+ $count += $mock->mockery_getExpectationCount();
+ }
+ return $count;
+ }
+
+ /**
+ * Store a mock and set its container reference
+ *
+ * @param \Mockery\Mock $mock
+ * @return \Mockery\MockInterface
+ */
+ public function rememberMock(\Mockery\MockInterface $mock)
+ {
+ if (!isset($this->_mocks[get_class($mock)])) {
+ $this->_mocks[get_class($mock)] = $mock;
+ } else {
+ /**
+ * This condition triggers for an instance mock where origin mock
+ * is already remembered
+ */
+ $this->_mocks[] = $mock;
+ }
+ return $mock;
+ }
+
+ /**
+ * Retrieve the last remembered mock object, which is the same as saying
+ * retrieve the current mock being programmed where you have yet to call
+ * mock() to change it - thus why the method name is "self" since it will be
+ * be used during the programming of the same mock.
+ *
+ * @return \Mockery\Mock
+ */
+ public function self()
+ {
+ $mocks = array_values($this->_mocks);
+ $index = count($mocks) - 1;
+ return $mocks[$index];
+ }
+
+ /**
+ * Return a specific remembered mock according to the array index it
+ * was stored to in this container instance
+ *
+ * @return \Mockery\Mock
+ */
+ public function fetchMock($reference)
+ {
+ if (isset($this->_mocks[$reference])) {
+ return $this->_mocks[$reference];
+ }
+ }
+
+ protected function _getInstance($mockName, $constructorArgs = null)
+ {
+ if ($constructorArgs !== null) {
+ $r = new \ReflectionClass($mockName);
+ return $r->newInstanceArgs($constructorArgs);
+ }
+
+ try {
+ $instantiator = new Instantiator;
+ $instance = $instantiator->instantiate($mockName);
+ } catch (\Exception $ex) {
+ $internalMockName = $mockName . '_Internal';
+
+ if (!class_exists($internalMockName)) {
+ eval("class $internalMockName extends $mockName {" .
+ 'public function __construct() {}' .
+ '}');
+ }
+
+ $instance = new $internalMockName();
+ }
+
+ return $instance;
+ }
+
+ protected function checkForNamedMockClashes($config)
+ {
+ $name = $config->getName();
+
+ if (!$name) {
+ return;
+ }
+
+ $hash = $config->getHash();
+
+ if (isset($this->_namedMocks[$name])) {
+ if ($hash !== $this->_namedMocks[$name]) {
+ throw new \Mockery\Exception(
+ "The mock named '$name' has been already defined with a different mock configuration"
+ );
+ }
+ }
+
+ $this->_namedMocks[$name] = $hash;
+ }
+
+ /**
+ * see http://php.net/manual/en/language.oop5.basic.php
+ * @param string $className
+ * @return bool
+ */
+ public function isValidClassName($className)
+ {
+ $pos = strpos($className, '\\');
+ if ($pos === 0) {
+ $className = substr($className, 1); // remove the first backslash
+ }
+ // all the namespaces and class name should match the regex
+ $invalidNames = array_filter(explode('\\', $className), function ($name) {
+ return !preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name);
+ });
+ return empty($invalidNames);
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php
new file mode 100644
index 000000000..f6ac130e6
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php
@@ -0,0 +1,62 @@
+_limit > $n) {
+ $exception = new Mockery\Exception\InvalidCountException(
+ 'Method ' . (string) $this->_expectation
+ . ' from ' . $this->_expectation->getMock()->mockery_getName()
+ . ' should be called' . PHP_EOL
+ . ' at least ' . $this->_limit . ' times but called ' . $n
+ . ' times.'
+ );
+ $exception->setMock($this->_expectation->getMock())
+ ->setMethodName((string) $this->_expectation)
+ ->setExpectedCountComparative('>=')
+ ->setExpectedCount($this->_limit)
+ ->setActualCount($n);
+ throw $exception;
+ }
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php
new file mode 100644
index 000000000..4d23e28d2
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php
@@ -0,0 +1,51 @@
+_limit < $n) {
+ $exception = new Mockery\Exception\InvalidCountException(
+ 'Method ' . (string) $this->_expectation
+ . ' from ' . $this->_expectation->getMock()->mockery_getName()
+ . ' should be called' . PHP_EOL
+ . ' at most ' . $this->_limit . ' times but called ' . $n
+ . ' times.'
+ );
+ $exception->setMock($this->_expectation->getMock())
+ ->setMethodName((string) $this->_expectation)
+ ->setExpectedCountComparative('<=')
+ ->setExpectedCount($this->_limit)
+ ->setActualCount($n);
+ throw $exception;
+ }
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php b/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php
new file mode 100644
index 000000000..ae3b0bfef
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php
@@ -0,0 +1,69 @@
+_expectation = $expectation;
+ $this->_limit = $limit;
+ }
+
+ /**
+ * Checks if the validator can accept an additional nth call
+ *
+ * @param int $n
+ * @return bool
+ */
+ public function isEligible($n)
+ {
+ return ($n < $this->_limit);
+ }
+
+ /**
+ * Validate the call count against this validator
+ *
+ * @param int $n
+ * @return bool
+ */
+ abstract public function validate($n);
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php
new file mode 100644
index 000000000..504f080d4
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php
@@ -0,0 +1,54 @@
+_limit !== $n) {
+ $because = $this->_expectation->getExceptionMessage();
+
+ $exception = new Mockery\Exception\InvalidCountException(
+ 'Method ' . (string) $this->_expectation
+ . ' from ' . $this->_expectation->getMock()->mockery_getName()
+ . ' should be called' . PHP_EOL
+ . ' exactly ' . $this->_limit . ' times but called ' . $n
+ . ' times.'
+ . ($because ? ' Because ' . $this->_expectation->getExceptionMessage() : '')
+ );
+ $exception->setMock($this->_expectation->getMock())
+ ->setMethodName((string) $this->_expectation)
+ ->setExpectedCountComparative('=')
+ ->setExpectedCount($this->_limit)
+ ->setActualCount($n);
+ throw $exception;
+ }
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php
new file mode 100644
index 000000000..b43aad3ec
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php
@@ -0,0 +1,25 @@
+dismissed = true;
+
+ // we sometimes stack them
+ if ($this->getPrevious() && $this->getPrevious() instanceof BadMethodCallException) {
+ $this->getPrevious()->dismiss();
+ }
+ }
+
+ public function dismissed()
+ {
+ return $this->dismissed;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php b/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php
new file mode 100644
index 000000000..ccf5c76f9
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php
@@ -0,0 +1,25 @@
+mockObject = $mock;
+ return $this;
+ }
+
+ public function setMethodName($name)
+ {
+ $this->method = $name;
+ return $this;
+ }
+
+ public function setActualCount($count)
+ {
+ $this->actual = $count;
+ return $this;
+ }
+
+ public function setExpectedCount($count)
+ {
+ $this->expected = $count;
+ return $this;
+ }
+
+ public function setExpectedCountComparative($comp)
+ {
+ if (!in_array($comp, array('=', '>', '<', '>=', '<='))) {
+ throw new RuntimeException(
+ 'Illegal comparative for expected call counts set: ' . $comp
+ );
+ }
+ $this->expectedComparative = $comp;
+ return $this;
+ }
+
+ public function getMock()
+ {
+ return $this->mockObject;
+ }
+
+ public function getMethodName()
+ {
+ return $this->method;
+ }
+
+ public function getActualCount()
+ {
+ return $this->actual;
+ }
+
+ public function getExpectedCount()
+ {
+ return $this->expected;
+ }
+
+ public function getMockName()
+ {
+ return $this->getMock()->mockery_getName();
+ }
+
+ public function getExpectedCountComparative()
+ {
+ return $this->expectedComparative;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php b/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php
new file mode 100644
index 000000000..2134e093e
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php
@@ -0,0 +1,83 @@
+mockObject = $mock;
+ return $this;
+ }
+
+ public function setMethodName($name)
+ {
+ $this->method = $name;
+ return $this;
+ }
+
+ public function setActualOrder($count)
+ {
+ $this->actual = $count;
+ return $this;
+ }
+
+ public function setExpectedOrder($count)
+ {
+ $this->expected = $count;
+ return $this;
+ }
+
+ public function getMock()
+ {
+ return $this->mockObject;
+ }
+
+ public function getMethodName()
+ {
+ return $this->method;
+ }
+
+ public function getActualOrder()
+ {
+ return $this->actual;
+ }
+
+ public function getExpectedOrder()
+ {
+ return $this->expected;
+ }
+
+ public function getMockName()
+ {
+ return $this->getMock()->mockery_getName();
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php b/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php
new file mode 100644
index 000000000..16574036c
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php
@@ -0,0 +1,70 @@
+mockObject = $mock;
+ return $this;
+ }
+
+ public function setMethodName($name)
+ {
+ $this->method = $name;
+ return $this;
+ }
+
+ public function setActualArguments($count)
+ {
+ $this->actual = $count;
+ return $this;
+ }
+
+ public function getMock()
+ {
+ return $this->mockObject;
+ }
+
+ public function getMethodName()
+ {
+ return $this->method;
+ }
+
+ public function getActualArguments()
+ {
+ return $this->actual;
+ }
+
+ public function getMockName()
+ {
+ return $this->getMock()->mockery_getName();
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php b/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php
new file mode 100644
index 000000000..4b2f53c22
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php
@@ -0,0 +1,25 @@
+_mock = $mock;
+ $this->_name = $name;
+ $this->withAnyArgs();
+ }
+
+ /**
+ * Return a string with the method name and arguments formatted
+ *
+ * @param string $name Name of the expected method
+ * @param array $args List of arguments to the method
+ * @return string
+ */
+ public function __toString()
+ {
+ return \Mockery::formatArgs($this->_name, $this->_expectedArgs);
+ }
+
+ /**
+ * Verify the current call, i.e. that the given arguments match those
+ * of this expectation
+ *
+ * @param array $args
+ * @return mixed
+ */
+ public function verifyCall(array $args)
+ {
+ $this->validateOrder();
+ $this->_actualCount++;
+ if (true === $this->_passthru) {
+ return $this->_mock->mockery_callSubjectMethod($this->_name, $args);
+ }
+
+ $return = $this->_getReturnValue($args);
+ $this->throwAsNecessary($return);
+ $this->_setValues();
+
+ return $return;
+ }
+
+ /**
+ * Throws an exception if the expectation has been configured to do so
+ *
+ * @throws \Exception|\Throwable
+ * @return void
+ */
+ private function throwAsNecessary($return)
+ {
+ if (!$this->_throw) {
+ return;
+ }
+
+ $type = version_compare(PHP_VERSION, '7.0.0') >= 0
+ ? "\Throwable"
+ : "\Exception";
+
+ if ($return instanceof $type) {
+ throw $return;
+ }
+
+ return;
+ }
+
+ /**
+ * Sets public properties with queued values to the mock object
+ *
+ * @param array $args
+ * @return mixed
+ */
+ protected function _setValues()
+ {
+ $mockClass = get_class($this->_mock);
+ $container = $this->_mock->mockery_getContainer();
+ $mocks = $container->getMocks();
+ foreach ($this->_setQueue as $name => &$values) {
+ if (count($values) > 0) {
+ $value = array_shift($values);
+ foreach ($mocks as $mock) {
+ if (is_a($mock, $mockClass)) {
+ $mock->{$name} = $value;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Fetch the return value for the matching args
+ *
+ * @param array $args
+ * @return mixed
+ */
+ protected function _getReturnValue(array $args)
+ {
+ if (count($this->_closureQueue) > 1) {
+ return call_user_func_array(array_shift($this->_closureQueue), $args);
+ } elseif (count($this->_closureQueue) > 0) {
+ return call_user_func_array(current($this->_closureQueue), $args);
+ } elseif (count($this->_returnQueue) > 1) {
+ return array_shift($this->_returnQueue);
+ } elseif (count($this->_returnQueue) > 0) {
+ return current($this->_returnQueue);
+ }
+
+ return $this->_mock->mockery_returnValueForMethod($this->_name);
+ }
+
+ /**
+ * Checks if this expectation is eligible for additional calls
+ *
+ * @return bool
+ */
+ public function isEligible()
+ {
+ foreach ($this->_countValidators as $validator) {
+ if (!$validator->isEligible($this->_actualCount)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Check if there is a constraint on call count
+ *
+ * @return bool
+ */
+ public function isCallCountConstrained()
+ {
+ return (count($this->_countValidators) > 0);
+ }
+
+ /**
+ * Verify call order
+ *
+ * @return void
+ */
+ public function validateOrder()
+ {
+ if ($this->_orderNumber) {
+ $this->_mock->mockery_validateOrder((string) $this, $this->_orderNumber, $this->_mock);
+ }
+ if ($this->_globalOrderNumber) {
+ $this->_mock->mockery_getContainer()
+ ->mockery_validateOrder((string) $this, $this->_globalOrderNumber, $this->_mock);
+ }
+ }
+
+ /**
+ * Verify this expectation
+ *
+ * @return void
+ */
+ public function verify()
+ {
+ foreach ($this->_countValidators as $validator) {
+ $validator->validate($this->_actualCount);
+ }
+ }
+
+ /**
+ * Check if the registered expectation is an ArgumentListMatcher
+ * @return bool
+ */
+ private function isArgumentListMatcher()
+ {
+ return (count($this->_expectedArgs) === 1 && ($this->_expectedArgs[0] instanceof ArgumentListMatcher));
+ }
+
+ private function isAndAnyOtherArgumentsMatcher($expectedArg)
+ {
+ return $expectedArg instanceof AndAnyOtherArgs;
+ }
+
+ /**
+ * Check if passed arguments match an argument expectation
+ *
+ * @param array $args
+ * @return bool
+ */
+ public function matchArgs(array $args)
+ {
+ if ($this->isArgumentListMatcher()) {
+ return $this->_matchArg($this->_expectedArgs[0], $args);
+ }
+ $argCount = count($args);
+ if ($argCount !== count((array) $this->_expectedArgs)) {
+ $lastExpectedArgument = end($this->_expectedArgs);
+ reset($this->_expectedArgs);
+
+ if ($this->isAndAnyOtherArgumentsMatcher($lastExpectedArgument)) {
+ $argCountToSkipMatching = $argCount - count($this->_expectedArgs);
+ $args = array_slice($args, 0, $argCountToSkipMatching);
+ return $this->_matchArgs($args);
+ }
+
+ return false;
+ }
+
+ return $this->_matchArgs($args);
+ }
+
+ /**
+ * Check if the passed arguments match the expectations, one by one.
+ *
+ * @param array $args
+ * @return bool
+ */
+ protected function _matchArgs($args)
+ {
+ $argCount = count($args);
+ for ($i=0; $i<$argCount; $i++) {
+ $param =& $args[$i];
+ if (!$this->_matchArg($this->_expectedArgs[$i], $param)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Check if passed argument matches an argument expectation
+ *
+ * @param mixed $expected
+ * @param mixed $actual
+ * @return bool
+ */
+ protected function _matchArg($expected, &$actual)
+ {
+ if ($expected === $actual) {
+ return true;
+ }
+ if (!is_object($expected) && !is_object($actual) && $expected == $actual) {
+ return true;
+ }
+ if (is_string($expected) && is_object($actual)) {
+ $result = $actual instanceof $expected;
+ if ($result) {
+ return true;
+ }
+ }
+ if ($expected instanceof \Mockery\Matcher\MatcherAbstract) {
+ return $expected->match($actual);
+ }
+ if ($expected instanceof \Hamcrest\Matcher || $expected instanceof \Hamcrest_Matcher) {
+ return $expected->matches($actual);
+ }
+ return false;
+ }
+
+ /**
+ * Expected argument setter for the expectation
+ *
+ * @param mixed[] ...$args
+ * @return self
+ */
+ public function with(...$args)
+ {
+ return $this->withArgs($args);
+ }
+
+ /**
+ * Expected arguments for the expectation passed as an array
+ *
+ * @param array $arguments
+ * @return self
+ */
+ private function withArgsInArray(array $arguments)
+ {
+ if (empty($arguments)) {
+ return $this->withNoArgs();
+ }
+ $this->_expectedArgs = $arguments;
+ return $this;
+ }
+
+ /**
+ * Expected arguments have to be matched by the given closure.
+ *
+ * @param Closure $closure
+ * @return self
+ */
+ private function withArgsMatchedByClosure(Closure $closure)
+ {
+ $this->_expectedArgs = [new MultiArgumentClosure($closure)];
+ return $this;
+ }
+
+ /**
+ * Expected arguments for the expectation passed as an array or a closure that matches each passed argument on
+ * each function call.
+ *
+ * @param array|Closure $argsOrClosure
+ * @return self
+ */
+ public function withArgs($argsOrClosure)
+ {
+ if (is_array($argsOrClosure)) {
+ $this->withArgsInArray($argsOrClosure);
+ } elseif ($argsOrClosure instanceof Closure) {
+ $this->withArgsMatchedByClosure($argsOrClosure);
+ } else {
+ throw new \InvalidArgumentException(sprintf('Call to %s with an invalid argument (%s), only array and '.
+ 'closure are allowed', __METHOD__, $argsOrClosure));
+ }
+ return $this;
+ }
+
+ /**
+ * Set with() as no arguments expected
+ *
+ * @return self
+ */
+ public function withNoArgs()
+ {
+ $this->_expectedArgs = [new NoArgs()];
+ return $this;
+ }
+
+ /**
+ * Set expectation that any arguments are acceptable
+ *
+ * @return self
+ */
+ public function withAnyArgs()
+ {
+ $this->_expectedArgs = [new AnyArgs()];
+ return $this;
+ }
+
+ /**
+ * Set a return value, or sequential queue of return values
+ *
+ * @param mixed[] ...$args
+ * @return self
+ */
+ public function andReturn(...$args)
+ {
+ $this->_returnQueue = $args;
+ return $this;
+ }
+
+ /**
+ * Set a return value, or sequential queue of return values
+ *
+ * @param mixed[] ...$args
+ * @return self
+ */
+ public function andReturns(...$args)
+ {
+ return call_user_func_array([$this, 'andReturn'], $args);
+ }
+
+ /**
+ * Return this mock, like a fluent interface
+ *
+ * @return self
+ */
+ public function andReturnSelf()
+ {
+ return $this->andReturn($this->_mock);
+ }
+
+ /**
+ * Set a sequential queue of return values with an array
+ *
+ * @param array $values
+ * @return self
+ */
+ public function andReturnValues(array $values)
+ {
+ call_user_func_array(array($this, 'andReturn'), $values);
+ return $this;
+ }
+
+ /**
+ * Set a closure or sequence of closures with which to generate return
+ * values. The arguments passed to the expected method are passed to the
+ * closures as parameters.
+ *
+ * @param callable[] ...$args
+ * @return self
+ */
+ public function andReturnUsing(...$args)
+ {
+ $this->_closureQueue = $args;
+ return $this;
+ }
+
+ /**
+ * Return a self-returning black hole object.
+ *
+ * @return self
+ */
+ public function andReturnUndefined()
+ {
+ $this->andReturn(new \Mockery\Undefined);
+ return $this;
+ }
+
+ /**
+ * Return null. This is merely a language construct for Mock describing.
+ *
+ * @return self
+ */
+ public function andReturnNull()
+ {
+ return $this->andReturn(null);
+ }
+
+ public function andReturnFalse()
+ {
+ return $this->andReturn(false);
+ }
+
+ public function andReturnTrue()
+ {
+ return $this->andReturn(true);
+ }
+
+ /**
+ * Set Exception class and arguments to that class to be thrown
+ *
+ * @param string|\Exception $exception
+ * @param string $message
+ * @param int $code
+ * @param \Exception $previous
+ * @return self
+ */
+ public function andThrow($exception, $message = '', $code = 0, \Exception $previous = null)
+ {
+ $this->_throw = true;
+ if (is_object($exception)) {
+ $this->andReturn($exception);
+ } else {
+ $this->andReturn(new $exception($message, $code, $previous));
+ }
+ return $this;
+ }
+
+ public function andThrows($exception, $message = '', $code = 0, \Exception $previous = null)
+ {
+ return $this->andThrow($exception, $message, $code, $previous);
+ }
+
+ /**
+ * Set Exception classes to be thrown
+ *
+ * @param array $exceptions
+ * @return self
+ */
+ public function andThrowExceptions(array $exceptions)
+ {
+ $this->_throw = true;
+ foreach ($exceptions as $exception) {
+ if (!is_object($exception)) {
+ throw new Exception('You must pass an array of exception objects to andThrowExceptions');
+ }
+ }
+ return $this->andReturnValues($exceptions);
+ }
+
+ /**
+ * Register values to be set to a public property each time this expectation occurs
+ *
+ * @param string $name
+ * @param array ...$values
+ * @return self
+ */
+ public function andSet($name, ...$values)
+ {
+ $this->_setQueue[$name] = $values;
+ return $this;
+ }
+
+ /**
+ * Alias to andSet(). Allows the natural English construct
+ * - set('foo', 'bar')->andReturn('bar')
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return self
+ */
+ public function set($name, $value)
+ {
+ return call_user_func_array(array($this, 'andSet'), func_get_args());
+ }
+
+ /**
+ * Indicates this expectation should occur zero or more times
+ *
+ * @return self
+ */
+ public function zeroOrMoreTimes()
+ {
+ $this->atLeast()->never();
+ }
+
+ /**
+ * Indicates the number of times this expectation should occur
+ *
+ * @param int $limit
+ * @throws \InvalidArgumentException
+ * @return self
+ */
+ public function times($limit = null)
+ {
+ if (is_null($limit)) {
+ return $this;
+ }
+ if (!is_int($limit)) {
+ throw new \InvalidArgumentException('The passed Times limit should be an integer value');
+ }
+ $this->_countValidators[$this->_countValidatorClass] = new $this->_countValidatorClass($this, $limit);
+ $this->_countValidatorClass = 'Mockery\CountValidator\Exact';
+ return $this;
+ }
+
+ /**
+ * Indicates that this expectation is never expected to be called
+ *
+ * @return self
+ */
+ public function never()
+ {
+ return $this->times(0);
+ }
+
+ /**
+ * Indicates that this expectation is expected exactly once
+ *
+ * @return self
+ */
+ public function once()
+ {
+ return $this->times(1);
+ }
+
+ /**
+ * Indicates that this expectation is expected exactly twice
+ *
+ * @return self
+ */
+ public function twice()
+ {
+ return $this->times(2);
+ }
+
+ /**
+ * Sets next count validator to the AtLeast instance
+ *
+ * @return self
+ */
+ public function atLeast()
+ {
+ $this->_countValidatorClass = 'Mockery\CountValidator\AtLeast';
+ return $this;
+ }
+
+ /**
+ * Sets next count validator to the AtMost instance
+ *
+ * @return self
+ */
+ public function atMost()
+ {
+ $this->_countValidatorClass = 'Mockery\CountValidator\AtMost';
+ return $this;
+ }
+
+ /**
+ * Shorthand for setting minimum and maximum constraints on call counts
+ *
+ * @param int $minimum
+ * @param int $maximum
+ */
+ public function between($minimum, $maximum)
+ {
+ return $this->atLeast()->times($minimum)->atMost()->times($maximum);
+ }
+
+
+ /**
+ * Set the exception message
+ *
+ * @param string $message
+ * @return $this
+ */
+ public function because($message)
+ {
+ $this->_because = $message;
+ return $this;
+ }
+
+ /**
+ * Indicates that this expectation must be called in a specific given order
+ *
+ * @param string $group Name of the ordered group
+ * @return self
+ */
+ public function ordered($group = null)
+ {
+ if ($this->_globally) {
+ $this->_globalOrderNumber = $this->_defineOrdered($group, $this->_mock->mockery_getContainer());
+ } else {
+ $this->_orderNumber = $this->_defineOrdered($group, $this->_mock);
+ }
+ $this->_globally = false;
+ return $this;
+ }
+
+ /**
+ * Indicates call order should apply globally
+ *
+ * @return self
+ */
+ public function globally()
+ {
+ $this->_globally = true;
+ return $this;
+ }
+
+ /**
+ * Setup the ordering tracking on the mock or mock container
+ *
+ * @param string $group
+ * @param object $ordering
+ * @return int
+ */
+ protected function _defineOrdered($group, $ordering)
+ {
+ $groups = $ordering->mockery_getGroups();
+ if (is_null($group)) {
+ $result = $ordering->mockery_allocateOrder();
+ } elseif (isset($groups[$group])) {
+ $result = $groups[$group];
+ } else {
+ $result = $ordering->mockery_allocateOrder();
+ $ordering->mockery_setGroup($group, $result);
+ }
+ return $result;
+ }
+
+ /**
+ * Return order number
+ *
+ * @return int
+ */
+ public function getOrderNumber()
+ {
+ return $this->_orderNumber;
+ }
+
+ /**
+ * Mark this expectation as being a default
+ *
+ * @return self
+ */
+ public function byDefault()
+ {
+ $director = $this->_mock->mockery_getExpectationsFor($this->_name);
+ if (!empty($director)) {
+ $director->makeExpectationDefault($this);
+ }
+ return $this;
+ }
+
+ /**
+ * Return the parent mock of the expectation
+ *
+ * @return \Mockery\MockInterface
+ */
+ public function getMock()
+ {
+ return $this->_mock;
+ }
+
+ /**
+ * Flag this expectation as calling the original class method with the
+ * any provided arguments instead of using a return value queue.
+ *
+ * @return self
+ */
+ public function passthru()
+ {
+ if ($this->_mock instanceof Mock) {
+ throw new Exception(
+ 'Mock Objects not created from a loaded/existing class are '
+ . 'incapable of passing method calls through to a parent class'
+ );
+ }
+ $this->_passthru = true;
+ return $this;
+ }
+
+ /**
+ * Cloning logic
+ *
+ */
+ public function __clone()
+ {
+ $newValidators = array();
+ $countValidators = $this->_countValidators;
+ foreach ($countValidators as $validator) {
+ $newValidators[] = clone $validator;
+ }
+ $this->_countValidators = $newValidators;
+ }
+
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ public function getExceptionMessage()
+ {
+ return $this->_because;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php b/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php
new file mode 100644
index 000000000..d9bb6fbaa
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php
@@ -0,0 +1,218 @@
+_name = $name;
+ $this->_mock = $mock;
+ }
+
+ /**
+ * Add a new expectation to the director
+ *
+ * @param \Mockery\Expectation $expectation
+ */
+ public function addExpectation(\Mockery\Expectation $expectation)
+ {
+ $this->_expectations[] = $expectation;
+ }
+
+ /**
+ * Handle a method call being directed by this instance
+ *
+ * @param array $args
+ * @return mixed
+ */
+ public function call(array $args)
+ {
+ $expectation = $this->findExpectation($args);
+ if (is_null($expectation)) {
+ $exception = new \Mockery\Exception\NoMatchingExpectationException(
+ 'No matching handler found for '
+ . $this->_mock->mockery_getName() . '::'
+ . \Mockery::formatArgs($this->_name, $args)
+ . '. Either the method was unexpected or its arguments matched'
+ . ' no expected argument list for this method'
+ . PHP_EOL . PHP_EOL
+ . \Mockery::formatObjects($args)
+ );
+ $exception->setMock($this->_mock)
+ ->setMethodName($this->_name)
+ ->setActualArguments($args);
+ throw $exception;
+ }
+ return $expectation->verifyCall($args);
+ }
+
+ /**
+ * Verify all expectations of the director
+ *
+ * @throws \Mockery\CountValidator\Exception
+ * @return void
+ */
+ public function verify()
+ {
+ if (!empty($this->_expectations)) {
+ foreach ($this->_expectations as $exp) {
+ $exp->verify();
+ }
+ } else {
+ foreach ($this->_defaults as $exp) {
+ $exp->verify();
+ }
+ }
+ }
+
+ /**
+ * Attempt to locate an expectation matching the provided args
+ *
+ * @param array $args
+ * @return mixed
+ */
+ public function findExpectation(array $args)
+ {
+ $expectation = null;
+
+ if (!empty($this->_expectations)) {
+ $expectation = $this->_findExpectationIn($this->_expectations, $args);
+ }
+
+ if ($expectation === null && !empty($this->_defaults)) {
+ $expectation = $this->_findExpectationIn($this->_defaults, $args);
+ }
+
+ return $expectation;
+ }
+
+ /**
+ * Make the given expectation a default for all others assuming it was
+ * correctly created last
+ *
+ * @param \Mockery\Expectation $expectation
+ */
+ public function makeExpectationDefault(\Mockery\Expectation $expectation)
+ {
+ $last = end($this->_expectations);
+ if ($last === $expectation) {
+ array_pop($this->_expectations);
+ array_unshift($this->_defaults, $expectation);
+ } else {
+ throw new \Mockery\Exception(
+ 'Cannot turn a previously defined expectation into a default'
+ );
+ }
+ }
+
+ /**
+ * Search current array of expectations for a match
+ *
+ * @param array $expectations
+ * @param array $args
+ * @return mixed
+ */
+ protected function _findExpectationIn(array $expectations, array $args)
+ {
+ foreach ($expectations as $exp) {
+ if ($exp->isEligible() && $exp->matchArgs($args)) {
+ return $exp;
+ }
+ }
+ foreach ($expectations as $exp) {
+ if ($exp->matchArgs($args)) {
+ return $exp;
+ }
+ }
+ }
+
+ /**
+ * Return all expectations assigned to this director
+ *
+ * @return array
+ */
+ public function getExpectations()
+ {
+ return $this->_expectations;
+ }
+
+ /**
+ * Return all expectations assigned to this director
+ *
+ * @return array
+ */
+ public function getDefaultExpectations()
+ {
+ return $this->_defaults;
+ }
+
+ /**
+ * Return the number of expectations assigned to this director.
+ *
+ * @return int
+ */
+ public function getExpectationCount()
+ {
+ return count($this->getExpectations()) ?: count($this->getDefaultExpectations());
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php b/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php
new file mode 100644
index 000000000..7d0b53686
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php
@@ -0,0 +1,46 @@
+once();
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php b/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php
new file mode 100644
index 000000000..6497e8853
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php
@@ -0,0 +1,45 @@
+generator = $generator;
+ }
+
+ public function generate(MockConfiguration $config)
+ {
+ $hash = $config->getHash();
+ if (isset($this->cache[$hash])) {
+ return $this->cache[$hash];
+ }
+
+ $definition = $this->generator->generate($config);
+ $this->cache[$hash] = $definition;
+
+ return $definition;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php b/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php
new file mode 100644
index 000000000..663b22547
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php
@@ -0,0 +1,108 @@
+rfc = $rfc;
+ }
+
+ public static function factory($name)
+ {
+ return new self(new \ReflectionClass($name));
+ }
+
+ public function getName()
+ {
+ return $this->rfc->getName();
+ }
+
+ public function isAbstract()
+ {
+ return $this->rfc->isAbstract();
+ }
+
+ public function isFinal()
+ {
+ return $this->rfc->isFinal();
+ }
+
+ public function getMethods()
+ {
+ return array_map(function ($method) {
+ return new Method($method);
+ }, $this->rfc->getMethods());
+ }
+
+ public function getInterfaces()
+ {
+ $class = __CLASS__;
+ return array_map(function ($interface) use ($class) {
+ return new $class($interface);
+ }, $this->rfc->getInterfaces());
+ }
+
+ public function __toString()
+ {
+ return $this->getName();
+ }
+
+ public function getNamespaceName()
+ {
+ return $this->rfc->getNamespaceName();
+ }
+
+ public function inNamespace()
+ {
+ return $this->rfc->inNamespace();
+ }
+
+ public function getShortName()
+ {
+ return $this->rfc->getShortName();
+ }
+
+ public function implementsInterface($interface)
+ {
+ return $this->rfc->implementsInterface($interface);
+ }
+
+ public function hasInternalAncestor()
+ {
+ if ($this->rfc->isInternal()) {
+ return true;
+ }
+
+ $child = $this->rfc;
+ while ($parent = $child->getParentClass()) {
+ if ($parent->isInternal()) {
+ return true;
+ }
+ $child = $parent;
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Generator.php b/vendor/mockery/mockery/library/Mockery/Generator/Generator.php
new file mode 100644
index 000000000..459a93ccc
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/Generator.php
@@ -0,0 +1,27 @@
+method = $method;
+ }
+
+ public function __call($method, $args)
+ {
+ return call_user_func_array(array($this->method, $method), $args);
+ }
+
+ public function getParameters()
+ {
+ return array_map(function ($parameter) {
+ return new Parameter($parameter);
+ }, $this->method->getParameters());
+ }
+
+ public function getReturnType()
+ {
+ if (defined('HHVM_VERSION') && method_exists($this->method, 'getReturnTypeText') && $this->method->hasReturnType()) {
+ // Available in HHVM
+ $returnType = $this->method->getReturnTypeText();
+
+ // Remove tuple, ImmVector<>, ImmSet<>, ImmMap<>, array<>, anything with <>, void, mixed which cause eval() errors
+ if (preg_match('/(\w+<.*>)|(\(.+\))|(HH\\\\(void|mixed|this))/', $returnType)) {
+ return '';
+ }
+
+ // return directly without going through php logic.
+ return $returnType;
+ }
+
+ if (version_compare(PHP_VERSION, '7.0.0-dev') >= 0 && $this->method->hasReturnType()) {
+ $returnType = (string) $this->method->getReturnType();
+
+ if ('self' === $returnType) {
+ $returnType = "\\".$this->method->getDeclaringClass()->getName();
+ } elseif (!\Mockery::isBuiltInType($returnType)) {
+ $returnType = '\\'.$returnType;
+ }
+
+ if (version_compare(PHP_VERSION, '7.1.0-dev') >= 0 && $this->method->getReturnType()->allowsNull()) {
+ $returnType = '?'.$returnType;
+ }
+
+ return $returnType;
+ }
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php b/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php
new file mode 100644
index 000000000..529311893
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php
@@ -0,0 +1,579 @@
+addTargets($targets);
+ $this->blackListedMethods = $blackListedMethods;
+ $this->whiteListedMethods = $whiteListedMethods;
+ $this->name = $name;
+ $this->instanceMock = $instanceMock;
+ $this->parameterOverrides = $parameterOverrides;
+ $this->mockOriginalDestructor = $mockOriginalDestructor;
+ $this->constantsMap = $constantsMap;
+ }
+
+ /**
+ * Attempt to create a hash of the configuration, in order to allow caching
+ *
+ * @TODO workout if this will work
+ *
+ * @return string
+ */
+ public function getHash()
+ {
+ $vars = array(
+ 'targetClassName' => $this->targetClassName,
+ 'targetInterfaceNames' => $this->targetInterfaceNames,
+ 'targetTraitNames' => $this->targetTraitNames,
+ 'name' => $this->name,
+ 'blackListedMethods' => $this->blackListedMethods,
+ 'whiteListedMethod' => $this->whiteListedMethods,
+ 'instanceMock' => $this->instanceMock,
+ 'parameterOverrides' => $this->parameterOverrides,
+ 'mockOriginalDestructor' => $this->mockOriginalDestructor
+ );
+
+ return md5(serialize($vars));
+ }
+
+ /**
+ * Gets a list of methods from the classes, interfaces and objects and
+ * filters them appropriately. Lot's of filtering going on, perhaps we could
+ * have filter classes to iterate through
+ */
+ public function getMethodsToMock()
+ {
+ $methods = $this->getAllMethods();
+
+ foreach ($methods as $key => $method) {
+ if ($method->isFinal()) {
+ unset($methods[$key]);
+ }
+ }
+
+ /**
+ * Whitelist trumps everything else
+ */
+ if (count($this->getWhiteListedMethods())) {
+ $whitelist = array_map('strtolower', $this->getWhiteListedMethods());
+ $methods = array_filter($methods, function ($method) use ($whitelist) {
+ return $method->isAbstract() || in_array(strtolower($method->getName()), $whitelist);
+ });
+
+ return $methods;
+ }
+
+ /**
+ * Remove blacklisted methods
+ */
+ if (count($this->getBlackListedMethods())) {
+ $blacklist = array_map('strtolower', $this->getBlackListedMethods());
+ $methods = array_filter($methods, function ($method) use ($blacklist) {
+ return !in_array(strtolower($method->getName()), $blacklist);
+ });
+ }
+
+ /**
+ * Internal objects can not be instantiated with newInstanceArgs and if
+ * they implement Serializable, unserialize will have to be called. As
+ * such, we can't mock it and will need a pass to add a dummy
+ * implementation
+ */
+ if ($this->getTargetClass()
+ && $this->getTargetClass()->implementsInterface("Serializable")
+ && $this->getTargetClass()->hasInternalAncestor()) {
+ $methods = array_filter($methods, function ($method) {
+ return $method->getName() !== "unserialize";
+ });
+ }
+
+ return array_values($methods);
+ }
+
+ /**
+ * We declare the __call method to handle undefined stuff, if the class
+ * we're mocking has also defined it, we need to comply with their interface
+ */
+ public function requiresCallTypeHintRemoval()
+ {
+ foreach ($this->getAllMethods() as $method) {
+ if ("__call" === $method->getName()) {
+ $params = $method->getParameters();
+ return !$params[1]->isArray();
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * We declare the __callStatic method to handle undefined stuff, if the class
+ * we're mocking has also defined it, we need to comply with their interface
+ */
+ public function requiresCallStaticTypeHintRemoval()
+ {
+ foreach ($this->getAllMethods() as $method) {
+ if ("__callStatic" === $method->getName()) {
+ $params = $method->getParameters();
+ return !$params[1]->isArray();
+ }
+ }
+
+ return false;
+ }
+
+ public function rename($className)
+ {
+ $targets = array();
+
+ if ($this->targetClassName) {
+ $targets[] = $this->targetClassName;
+ }
+
+ if ($this->targetInterfaceNames) {
+ $targets = array_merge($targets, $this->targetInterfaceNames);
+ }
+
+ if ($this->targetTraitNames) {
+ $targets = array_merge($targets, $this->targetTraitNames);
+ }
+
+ if ($this->targetObject) {
+ $targets[] = $this->targetObject;
+ }
+
+ return new self(
+ $targets,
+ $this->blackListedMethods,
+ $this->whiteListedMethods,
+ $className,
+ $this->instanceMock,
+ $this->parameterOverrides,
+ $this->mockOriginalDestructor,
+ $this->constantsMap
+ );
+ }
+
+ protected function addTarget($target)
+ {
+ if (is_object($target)) {
+ $this->setTargetObject($target);
+ $this->setTargetClassName(get_class($target));
+ return $this;
+ }
+
+ if ($target[0] !== "\\") {
+ $target = "\\" . $target;
+ }
+
+ if (class_exists($target)) {
+ $this->setTargetClassName($target);
+ return $this;
+ }
+
+ if (interface_exists($target)) {
+ $this->addTargetInterfaceName($target);
+ return $this;
+ }
+
+ if (trait_exists($target)) {
+ $this->addTargetTraitName($target);
+ return $this;
+ }
+
+ /**
+ * Default is to set as class, or interface if class already set
+ *
+ * Don't like this condition, can't remember what the default
+ * targetClass is for
+ */
+ if ($this->getTargetClassName()) {
+ $this->addTargetInterfaceName($target);
+ return $this;
+ }
+
+ $this->setTargetClassName($target);
+ }
+
+ protected function addTargets($interfaces)
+ {
+ foreach ($interfaces as $interface) {
+ $this->addTarget($interface);
+ }
+ }
+
+ public function getTargetClassName()
+ {
+ return $this->targetClassName;
+ }
+
+ public function getTargetClass()
+ {
+ if ($this->targetClass) {
+ return $this->targetClass;
+ }
+
+ if (!$this->targetClassName) {
+ return null;
+ }
+
+ if (class_exists($this->targetClassName)) {
+ $dtc = DefinedTargetClass::factory($this->targetClassName);
+
+ if ($this->getTargetObject() == false && $dtc->isFinal()) {
+ throw new \Mockery\Exception(
+ 'The class ' . $this->targetClassName . ' is marked final and its methods'
+ . ' cannot be replaced. Classes marked final can be passed in'
+ . ' to \Mockery::mock() as instantiated objects to create a'
+ . ' partial mock, but only if the mock is not subject to type'
+ . ' hinting checks.'
+ );
+ }
+
+ $this->targetClass = $dtc;
+ } else {
+ $this->targetClass = UndefinedTargetClass::factory($this->targetClassName);
+ }
+
+ return $this->targetClass;
+ }
+
+ public function getTargetTraits()
+ {
+ if (!empty($this->targetTraits)) {
+ return $this->targetTraits;
+ }
+
+ foreach ($this->targetTraitNames as $targetTrait) {
+ $this->targetTraits[] = DefinedTargetClass::factory($targetTrait);
+ }
+
+ $this->targetTraits = array_unique($this->targetTraits); // just in case
+ return $this->targetTraits;
+ }
+
+ public function getTargetInterfaces()
+ {
+ if (!empty($this->targetInterfaces)) {
+ return $this->targetInterfaces;
+ }
+
+ foreach ($this->targetInterfaceNames as $targetInterface) {
+ if (!interface_exists($targetInterface)) {
+ $this->targetInterfaces[] = UndefinedTargetClass::factory($targetInterface);
+ return;
+ }
+
+ $dtc = DefinedTargetClass::factory($targetInterface);
+ $extendedInterfaces = array_keys($dtc->getInterfaces());
+ $extendedInterfaces[] = $targetInterface;
+
+ $traversableFound = false;
+ $iteratorShiftedToFront = false;
+ foreach ($extendedInterfaces as $interface) {
+ if (!$traversableFound && preg_match("/^\\?Iterator(|Aggregate)$/i", $interface)) {
+ break;
+ }
+
+ if (preg_match("/^\\\\?IteratorAggregate$/i", $interface)) {
+ $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate");
+ $iteratorShiftedToFront = true;
+ } elseif (preg_match("/^\\\\?Iterator$/i", $interface)) {
+ $this->targetInterfaces[] = DefinedTargetClass::factory("\\Iterator");
+ $iteratorShiftedToFront = true;
+ } elseif (preg_match("/^\\\\?Traversable$/i", $interface)) {
+ $traversableFound = true;
+ }
+ }
+
+ if ($traversableFound && !$iteratorShiftedToFront) {
+ $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate");
+ }
+
+ /**
+ * We never straight up implement Traversable
+ */
+ if (!preg_match("/^\\\\?Traversable$/i", $targetInterface)) {
+ $this->targetInterfaces[] = $dtc;
+ }
+ }
+ $this->targetInterfaces = array_unique($this->targetInterfaces); // just in case
+ return $this->targetInterfaces;
+ }
+
+ public function getTargetObject()
+ {
+ return $this->targetObject;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Generate a suitable name based on the config
+ */
+ public function generateName()
+ {
+ $name = 'Mockery_' . static::$mockCounter++;
+
+ if ($this->getTargetObject()) {
+ $name .= "_" . str_replace("\\", "_", get_class($this->getTargetObject()));
+ }
+
+ if ($this->getTargetClass()) {
+ $name .= "_" . str_replace("\\", "_", $this->getTargetClass()->getName());
+ }
+
+ if ($this->getTargetInterfaces()) {
+ $name .= array_reduce($this->getTargetInterfaces(), function ($tmpname, $i) {
+ $tmpname .= '_' . str_replace("\\", "_", $i->getName());
+ return $tmpname;
+ }, '');
+ }
+
+ return $name;
+ }
+
+ public function getShortName()
+ {
+ $parts = explode("\\", $this->getName());
+ return array_pop($parts);
+ }
+
+ public function getNamespaceName()
+ {
+ $parts = explode("\\", $this->getName());
+ array_pop($parts);
+
+ if (count($parts)) {
+ return implode("\\", $parts);
+ }
+
+ return "";
+ }
+
+ public function getBlackListedMethods()
+ {
+ return $this->blackListedMethods;
+ }
+
+ public function getWhiteListedMethods()
+ {
+ return $this->whiteListedMethods;
+ }
+
+ public function isInstanceMock()
+ {
+ return $this->instanceMock;
+ }
+
+ public function getParameterOverrides()
+ {
+ return $this->parameterOverrides;
+ }
+
+ public function isMockOriginalDestructor()
+ {
+ return $this->mockOriginalDestructor;
+ }
+
+ protected function setTargetClassName($targetClassName)
+ {
+ $this->targetClassName = $targetClassName;
+ }
+
+ protected function getAllMethods()
+ {
+ if ($this->allMethods) {
+ return $this->allMethods;
+ }
+
+ $classes = $this->getTargetInterfaces();
+
+ if ($this->getTargetClass()) {
+ $classes[] = $this->getTargetClass();
+ }
+
+ $methods = array();
+ foreach ($classes as $class) {
+ $methods = array_merge($methods, $class->getMethods());
+ }
+
+ foreach ($this->getTargetTraits() as $trait) {
+ foreach ($trait->getMethods() as $method) {
+ if ($method->isAbstract()) {
+ $methods[] = $method;
+ }
+ }
+ }
+
+ $names = array();
+ $methods = array_filter($methods, function ($method) use (&$names) {
+ if (in_array($method->getName(), $names)) {
+ return false;
+ }
+
+ $names[] = $method->getName();
+ return true;
+ });
+
+ // In HHVM, class methods can be annotated with the built-in
+ // <<__Memoize>> attribute (similar to a Python decorator),
+ // which builds an LRU cache of method arguments and their
+ // return values.
+ // https://docs.hhvm.com/hack/attributes/special#__memoize
+ //
+ // HHVM implements this behavior by inserting a private helper
+ // method into the class at runtime which is named as the
+ // method to be memoized, suffixed by `$memoize_impl`.
+ // https://github.com/facebook/hhvm/blob/6aa46f1e8c2351b97d65e67b73e26f274a7c3f2e/hphp/runtime/vm/func.cpp#L364
+ //
+ // Ordinarily, PHP does not all allow the `$` token in method
+ // names, but since the memoization helper is inserted at
+ // runtime (and not in userland), HHVM allows it.
+ //
+ // We use code generation and eval() for some types of mocks,
+ // so to avoid syntax errors from these memoization helpers,
+ // we must filter them from our list of class methods.
+ //
+ // This effectively disables the memoization behavior in HHVM,
+ // but that's preferable to failing catastrophically when
+ // attempting to mock a class using the attribute.
+ if (defined('HHVM_VERSION')) {
+ $methods = array_filter($methods, function ($method) {
+ return strpos($method->getName(), '$memoize_impl') === false;
+ });
+ }
+
+ return $this->allMethods = $methods;
+ }
+
+ /**
+ * If we attempt to implement Traversable, we must ensure we are also
+ * implementing either Iterator or IteratorAggregate, and that whichever one
+ * it is comes before Traversable in the list of implements.
+ */
+ protected function addTargetInterfaceName($targetInterface)
+ {
+ $this->targetInterfaceNames[] = $targetInterface;
+ }
+
+ protected function addTargetTraitName($targetTraitName)
+ {
+ $this->targetTraitNames[] = $targetTraitName;
+ }
+
+ protected function setTargetObject($object)
+ {
+ $this->targetObject = $object;
+ }
+
+ public function getConstantsMap()
+ {
+ return $this->constantsMap;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php b/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php
new file mode 100644
index 000000000..817049296
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php
@@ -0,0 +1,176 @@
+= 0) {
+ $this->blackListedMethods = array_diff($this->blackListedMethods, $this->php7SemiReservedKeywords);
+ }
+ }
+
+ public function addTarget($target)
+ {
+ $this->targets[] = $target;
+
+ return $this;
+ }
+
+ public function addTargets($targets)
+ {
+ foreach ($targets as $target) {
+ $this->addTarget($target);
+ }
+
+ return $this;
+ }
+
+ public function setName($name)
+ {
+ $this->name = $name;
+ return $this;
+ }
+
+ public function addBlackListedMethod($blackListedMethod)
+ {
+ $this->blackListedMethods[] = $blackListedMethod;
+ return $this;
+ }
+
+ public function addBlackListedMethods(array $blackListedMethods)
+ {
+ foreach ($blackListedMethods as $method) {
+ $this->addBlackListedMethod($method);
+ }
+ return $this;
+ }
+
+ public function setBlackListedMethods(array $blackListedMethods)
+ {
+ $this->blackListedMethods = $blackListedMethods;
+ return $this;
+ }
+
+ public function addWhiteListedMethod($whiteListedMethod)
+ {
+ $this->whiteListedMethods[] = $whiteListedMethod;
+ return $this;
+ }
+
+ public function addWhiteListedMethods(array $whiteListedMethods)
+ {
+ foreach ($whiteListedMethods as $method) {
+ $this->addWhiteListedMethod($method);
+ }
+ return $this;
+ }
+
+ public function setWhiteListedMethods(array $whiteListedMethods)
+ {
+ $this->whiteListedMethods = $whiteListedMethods;
+ return $this;
+ }
+
+ public function setInstanceMock($instanceMock)
+ {
+ $this->instanceMock = (bool) $instanceMock;
+ }
+
+ public function setParameterOverrides(array $overrides)
+ {
+ $this->parameterOverrides = $overrides;
+ }
+
+ public function setMockOriginalDestructor($mockDestructor)
+ {
+ $this->mockOriginalDestructor = $mockDestructor;
+ return $this;
+ }
+
+ public function setConstantsMap(array $map)
+ {
+ $this->constantsMap = $map;
+ }
+
+ public function getMockConfiguration()
+ {
+ return new MockConfiguration(
+ $this->targets,
+ $this->blackListedMethods,
+ $this->whiteListedMethods,
+ $this->name,
+ $this->instanceMock,
+ $this->parameterOverrides,
+ $this->mockOriginalDestructor,
+ $this->constantsMap
+ );
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php b/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php
new file mode 100644
index 000000000..fd6a9fa2a
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php
@@ -0,0 +1,51 @@
+getName()) {
+ throw new \InvalidArgumentException("MockConfiguration must contain a name");
+ }
+ $this->config = $config;
+ $this->code = $code;
+ }
+
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ public function getClassName()
+ {
+ return $this->config->getName();
+ }
+
+ public function getCode()
+ {
+ return $this->code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php b/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php
new file mode 100644
index 000000000..a5338c0c6
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php
@@ -0,0 +1,110 @@
+rfp = $rfp;
+ }
+
+ public function __call($method, array $args)
+ {
+ return call_user_func_array(array($this->rfp, $method), $args);
+ }
+
+ public function getClass()
+ {
+ return new DefinedTargetClass($this->rfp->getClass());
+ }
+
+ public function getTypeHintAsString()
+ {
+ if (method_exists($this->rfp, 'getTypehintText')) {
+ // Available in HHVM
+ $typehint = $this->rfp->getTypehintText();
+
+ // not exhaustive, but will do for now
+ if (in_array($typehint, array('int', 'integer', 'float', 'string', 'bool', 'boolean'))) {
+ return '';
+ }
+
+ return $typehint;
+ }
+
+ if ($this->rfp->isArray()) {
+ return 'array';
+ }
+
+ /*
+ * PHP < 5.4.1 has some strange behaviour with a typehint of self and
+ * subclass signatures, so we risk the regexp instead
+ */
+ if ((version_compare(PHP_VERSION, '5.4.1') >= 0)) {
+ try {
+ if ($this->rfp->getClass()) {
+ return $this->rfp->getClass()->getName();
+ }
+ } catch (\ReflectionException $re) {
+ // noop
+ }
+ }
+
+ if (version_compare(PHP_VERSION, '7.0.0-dev') >= 0 && $this->rfp->hasType()) {
+ return (string) $this->rfp->getType();
+ }
+
+ if (preg_match('/^Parameter #[0-9]+ \[ \<(required|optional)\> (?\S+ )?.*\$' . $this->rfp->getName() . ' .*\]$/', $this->rfp->__toString(), $typehintMatch)) {
+ if (!empty($typehintMatch['typehint'])) {
+ return $typehintMatch['typehint'];
+ }
+ }
+
+ return '';
+ }
+
+ /**
+ * Some internal classes have funny looking definitions...
+ */
+ public function getName()
+ {
+ $name = $this->rfp->getName();
+ if (!$name || $name == '...') {
+ $name = 'arg' . static::$parameterCounter++;
+ }
+
+ return $name;
+ }
+
+
+ /**
+ * Variadics only introduced in 5.6
+ */
+ public function isVariadic()
+ {
+ return $this->rfp->isVariadic();
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php
new file mode 100644
index 000000000..fd00264ca
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php
@@ -0,0 +1,47 @@
+requiresCallTypeHintRemoval()) {
+ $code = str_replace(
+ 'public function __call($method, array $args)',
+ 'public function __call($method, $args)',
+ $code
+ );
+ }
+
+ if ($config->requiresCallStaticTypeHintRemoval()) {
+ $code = str_replace(
+ 'public static function __callStatic($method, array $args)',
+ 'public static function __callStatic($method, $args)',
+ $code
+ );
+ }
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php
new file mode 100644
index 000000000..b5a31098e
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php
@@ -0,0 +1,49 @@
+getNamespaceName();
+
+ $namespace = ltrim($namespace, "\\");
+
+ $className = $config->getShortName();
+
+ $code = str_replace(
+ 'namespace Mockery;',
+ $namespace ? 'namespace ' . $namespace . ';' : '',
+ $code
+ );
+
+ $code = str_replace(
+ 'class Mock',
+ 'class ' . $className,
+ $code
+ );
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php
new file mode 100644
index 000000000..91ccfabfa
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php
@@ -0,0 +1,52 @@
+getTargetClass();
+
+ if (!$target) {
+ return $code;
+ }
+
+ if ($target->isFinal()) {
+ return $code;
+ }
+
+ $className = ltrim($target->getName(), "\\");
+ if (!class_exists($className)) {
+ \Mockery::declareClass($className);
+ }
+
+ $code = str_replace(
+ "implements MockInterface",
+ "extends \\" . $className . " implements MockInterface",
+ $code
+ );
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php
new file mode 100644
index 000000000..28f5cdff3
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php
@@ -0,0 +1,33 @@
+getConstantsMap();
+ if (empty($cm)) {
+ return $code;
+ }
+
+ if (!isset($cm[$config->getName()])) {
+ return $code;
+ }
+
+ $cm = $cm[$config->getName()];
+
+ $constantsCode = '';
+ foreach ($cm as $constant => $value) {
+ $constantsCode .= sprintf("\n const %s = '%s';\n", $constant, $value);
+ }
+
+ $i = strrpos($code, '}');
+ $code = substr_replace($code, $constantsCode, $i);
+ $code .= "}\n";
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php
new file mode 100644
index 000000000..627914757
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php
@@ -0,0 +1,83 @@
+_mockery_ignoreVerification = false;
+ \$associatedRealObject = \Mockery::fetchMock(__CLASS__);
+
+ foreach (get_object_vars(\$this) as \$attr => \$val) {
+ if (\$attr !== "_mockery_ignoreVerification" && \$attr !== "_mockery_expectations") {
+ \$this->\$attr = \$associatedRealObject->\$attr;
+ }
+ }
+
+ \$directors = \$associatedRealObject->mockery_getExpectations();
+ foreach (\$directors as \$method=>\$director) {
+ // get the director method needed
+ \$existingDirector = \$this->mockery_getExpectationsFor(\$method);
+ if (!\$existingDirector) {
+ \$existingDirector = new \Mockery\ExpectationDirector(\$method, \$this);
+ \$this->mockery_setExpectationsFor(\$method, \$existingDirector);
+ }
+ \$expectations = \$director->getExpectations();
+ foreach (\$expectations as \$expectation) {
+ \$clonedExpectation = clone \$expectation;
+ \$existingDirector->addExpectation(\$clonedExpectation);
+ }
+ \$defaultExpectations = \$director->getDefaultExpectations();
+ foreach (array_reverse(\$defaultExpectations) as \$expectation) {
+ \$clonedExpectation = clone \$expectation;
+ \$existingDirector->addExpectation(\$clonedExpectation);
+ \$existingDirector->makeExpectationDefault(\$clonedExpectation);
+ }
+ }
+ \Mockery::getContainer()->rememberMock(\$this);
+
+ \$this->_mockery_constructorCalled(func_get_args());
+ }
+MOCK;
+
+ public function apply($code, MockConfiguration $config)
+ {
+ if ($config->isInstanceMock()) {
+ $code = $this->appendToClass($code, static::INSTANCE_MOCK_CODE);
+ }
+
+ return $code;
+ }
+
+ protected function appendToClass($class, $code)
+ {
+ $lastBrace = strrpos($class, "}");
+ $class = substr($class, 0, $lastBrace) . $code . "\n }\n";
+ return $class;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php
new file mode 100644
index 000000000..982956e5c
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php
@@ -0,0 +1,48 @@
+getTargetInterfaces() as $i) {
+ $name = ltrim($i->getName(), "\\");
+ if (!interface_exists($name)) {
+ \Mockery::declareInterface($name);
+ }
+ }
+
+ $interfaces = array_reduce((array) $config->getTargetInterfaces(), function ($code, $i) {
+ return $code . ", \\" . ltrim($i->getName(), "\\");
+ }, "");
+
+ $code = str_replace(
+ "implements MockInterface",
+ "implements MockInterface" . $interfaces,
+ $code
+ );
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php
new file mode 100644
index 000000000..4a457b348
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php
@@ -0,0 +1,208 @@
+getMagicMethods($config->getTargetClass());
+ foreach ($config->getTargetInterfaces() as $interface) {
+ $magicMethods = array_merge($magicMethods, $this->getMagicMethods($interface));
+ }
+
+ foreach ($magicMethods as $method) {
+ $code = $this->applyMagicTypeHints($code, $method);
+ }
+
+ return $code;
+ }
+
+ /**
+ * Returns the magic methods within the
+ * passed DefinedTargetClass.
+ *
+ * @param TargetClassInterface $class
+ * @return array
+ */
+ public function getMagicMethods(
+ TargetClassInterface $class = null
+ ) {
+ if (is_null($class)) {
+ return array();
+ }
+ return array_filter($class->getMethods(), function (Method $method) {
+ return in_array($method->getName(), $this->mockMagicMethods);
+ });
+ }
+
+ /**
+ * Applies type hints of magic methods from
+ * class to the passed code.
+ *
+ * @param int $code
+ * @param Method $method
+ * @return string
+ */
+ private function applyMagicTypeHints($code, Method $method)
+ {
+ if ($this->isMethodWithinCode($code, $method)) {
+ $namedParameters = $this->getOriginalParameters(
+ $code,
+ $method
+ );
+ $code = preg_replace(
+ $this->getDeclarationRegex($method->getName()),
+ $this->getMethodDeclaration($method, $namedParameters),
+ $code
+ );
+ }
+ return $code;
+ }
+
+ /**
+ * Checks if the method is declared withing code.
+ *
+ * @param int $code
+ * @param Method $method
+ * @return boolean
+ */
+ private function isMethodWithinCode($code, Method $method)
+ {
+ return preg_match(
+ $this->getDeclarationRegex($method->getName()),
+ $code
+ ) == 1;
+ }
+
+ /**
+ * Returns the method original parameters, as they're
+ * described in the $code string.
+ *
+ * @param int $code
+ * @param Method $method
+ * @return array
+ */
+ private function getOriginalParameters($code, Method $method)
+ {
+ $matches = [];
+ $parameterMatches = [];
+
+ preg_match(
+ $this->getDeclarationRegex($method->getName()),
+ $code,
+ $matches
+ );
+
+ if (count($matches) > 0) {
+ preg_match_all(
+ '/(?<=\$)(\w+)+/i',
+ $matches[0],
+ $parameterMatches
+ );
+ }
+
+ $groupMatches = end($parameterMatches);
+ $parameterNames = is_array($groupMatches) ?
+ $groupMatches :
+ array($groupMatches);
+
+ return $parameterNames;
+ }
+
+ /**
+ * Gets the declaration code, as a string, for the passed method.
+ *
+ * @param Method $method
+ * @param array $namedParameters
+ * @return string
+ */
+ private function getMethodDeclaration(
+ Method $method,
+ array $namedParameters
+ ) {
+ $declaration = 'public';
+ $declaration .= $method->isStatic() ? ' static' : '';
+ $declaration .= ' function '.$method->getName().'(';
+
+ foreach ($method->getParameters() as $index => $parameter) {
+ $declaration .= $parameter->getTypeHintAsString().' ';
+ $name = isset($namedParameters[$index]) ?
+ $namedParameters[$index] :
+ $parameter->getName();
+ $declaration .= '$'.$name;
+ $declaration .= ',';
+ }
+ $declaration = rtrim($declaration, ',');
+ $declaration .= ') ';
+
+ $returnType = $method->getReturnType();
+ if (!empty($returnType)) {
+ $declaration .= ': '.$returnType;
+ }
+
+ return $declaration;
+ }
+
+ /**
+ * Returns a regex string used to match the
+ * declaration of some method.
+ *
+ * @param string $methodName
+ * @return string
+ */
+ private function getDeclarationRegex($methodName)
+ {
+ return "/public\s+(?:static\s+)?function\s+$methodName\s*\(.*\)\s*(?=\{)/i";
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php
new file mode 100644
index 000000000..c83ecf8cd
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php
@@ -0,0 +1,175 @@
+getMethodsToMock() as $method) {
+ if ($method->isPublic()) {
+ $methodDef = 'public';
+ } elseif ($method->isProtected()) {
+ $methodDef = 'protected';
+ } else {
+ $methodDef = 'private';
+ }
+
+ if ($method->isStatic()) {
+ $methodDef .= ' static';
+ }
+
+ $methodDef .= ' function ';
+ $methodDef .= $method->returnsReference() ? ' & ' : '';
+ $methodDef .= $method->getName();
+ $methodDef .= $this->renderParams($method, $config);
+ $methodDef .= $this->renderReturnType($method);
+ $methodDef .= $this->renderMethodBody($method, $config);
+
+ $code = $this->appendToClass($code, $methodDef);
+ }
+
+ return $code;
+ }
+
+ protected function renderParams(Method $method, $config)
+ {
+ $class = $method->getDeclaringClass();
+ if ($class->isInternal()) {
+ $overrides = $config->getParameterOverrides();
+
+ if (isset($overrides[strtolower($class->getName())][$method->getName()])) {
+ return '(' . implode(',', $overrides[strtolower($class->getName())][$method->getName()]) . ')';
+ }
+ }
+
+ $methodParams = array();
+ $params = $method->getParameters();
+ foreach ($params as $param) {
+ $paramDef = $this->renderTypeHint($param);
+ $paramDef .= $param->isPassedByReference() ? '&' : '';
+ $paramDef .= $param->isVariadic() ? '...' : '';
+ $paramDef .= '$' . $param->getName();
+
+ if (!$param->isVariadic()) {
+ if (false !== $param->isDefaultValueAvailable()) {
+ $paramDef .= ' = ' . var_export($param->getDefaultValue(), true);
+ } elseif ($param->isOptional()) {
+ $paramDef .= ' = null';
+ }
+ }
+
+ $methodParams[] = $paramDef;
+ }
+ return '(' . implode(', ', $methodParams) . ')';
+ }
+
+ protected function renderReturnType(Method $method)
+ {
+ $type = $method->getReturnType();
+ return $type ? sprintf(': %s', $type) : '';
+ }
+
+ protected function appendToClass($class, $code)
+ {
+ $lastBrace = strrpos($class, "}");
+ $class = substr($class, 0, $lastBrace) . $code . "\n }\n";
+ return $class;
+ }
+
+ protected function renderTypeHint(Parameter $param)
+ {
+ $typeHint = trim($param->getTypeHintAsString());
+
+ if (!empty($typeHint)) {
+ if (!\Mockery::isBuiltInType($typeHint)) {
+ $typeHint = '\\'.$typeHint;
+ }
+
+ if (version_compare(PHP_VERSION, '7.1.0-dev') >= 0 && $param->allowsNull()) {
+ $typeHint = "?".$typeHint;
+ }
+ }
+
+ return $typeHint .= ' ';
+ }
+
+ private function renderMethodBody($method, $config)
+ {
+ $invoke = $method->isStatic() ? 'static::_mockery_handleStaticMethodCall' : '$this->_mockery_handleMethodCall';
+ $body = <<getDeclaringClass();
+ $class_name = strtolower($class->getName());
+ $overrides = $config->getParameterOverrides();
+ if (isset($overrides[$class_name][$method->getName()])) {
+ $params = array_values($overrides[$class_name][$method->getName()]);
+ $paramCount = count($params);
+ for ($i = 0; $i < $paramCount; ++$i) {
+ $param = $params[$i];
+ if (strpos($param, '&') !== false) {
+ $body .= << $i) {
+ \$argv[$i] = {$param};
+}
+
+BODY;
+ }
+ }
+ } else {
+ $params = array_values($method->getParameters());
+ $paramCount = count($params);
+ for ($i = 0; $i < $paramCount; ++$i) {
+ $param = $params[$i];
+ if (!$param->isPassedByReference()) {
+ continue;
+ }
+ $body .= << $i) {
+ \$argv[$i] =& \${$param->getName()};
+}
+
+BODY;
+ }
+ }
+
+ $body .= "\$ret = {$invoke}(__FUNCTION__, \$argv);\n";
+
+ if ($method->getReturnType() !== "void") {
+ $body .= "return \$ret;\n";
+ }
+
+ $body .= "}\n";
+ return $body;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php
new file mode 100644
index 000000000..f7b72c9fa
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php
@@ -0,0 +1,28 @@
+ '/public function __wakeup\(\)\s+\{.*?\}/sm',
+ );
+
+ public function apply($code, MockConfiguration $config)
+ {
+ $target = $config->getTargetClass();
+
+ if (!$target) {
+ return $code;
+ }
+
+ foreach ($target->getMethods() as $method) {
+ if ($method->isFinal() && isset($this->methods[$method->getName()])) {
+ $code = preg_replace($this->methods[$method->getName()], '', $code);
+ }
+ }
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php
new file mode 100644
index 000000000..ed5a4206b
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php
@@ -0,0 +1,45 @@
+
+ */
+
+namespace Mockery\Generator\StringManipulation\Pass;
+
+use Mockery\Generator\MockConfiguration;
+
+/**
+ * Remove mock's empty destructor if we tend to use original class destructor
+ */
+class RemoveDestructorPass
+{
+ public function apply($code, MockConfiguration $config)
+ {
+ $target = $config->getTargetClass();
+
+ if (!$target) {
+ return $code;
+ }
+
+ if (!$config->isMockOriginalDestructor()) {
+ $code = preg_replace('/public function __destruct\(\)\s+\{.*?\}/sm', '', $code);
+ }
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php
new file mode 100644
index 000000000..840fe9986
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php
@@ -0,0 +1,58 @@
+getTargetClass();
+
+ if (!$target) {
+ return $code;
+ }
+
+ if (!$target->hasInternalAncestor() || !$target->implementsInterface("Serializable")) {
+ return $code;
+ }
+
+ $code = $this->appendToClass($code, self::DUMMY_METHOD_DEFINITION);
+
+ return $code;
+ }
+
+ protected function appendToClass($class, $code)
+ {
+ $lastBrace = strrpos($class, "}");
+ $class = substr($class, 0, $lastBrace) . $code . "\n }\n";
+ return $class;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php
new file mode 100644
index 000000000..13343c334
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php
@@ -0,0 +1,47 @@
+getTargetTraits();
+
+ if (empty($traits)) {
+ return $code;
+ }
+
+ $useStatements = array_map(function ($trait) {
+ return "use \\\\".ltrim($trait->getName(), "\\").";";
+ }, $traits);
+
+ $code = preg_replace(
+ '/^{$/m',
+ "{\n ".implode("\n ", $useStatements)."\n",
+ $code
+ );
+
+ return $code;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php
new file mode 100644
index 000000000..544bb88ff
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php
@@ -0,0 +1,87 @@
+passes = $passes;
+ }
+
+ public function generate(MockConfiguration $config)
+ {
+ $code = file_get_contents(__DIR__ . '/../Mock.php');
+ $className = $config->getName() ?: $config->generateName();
+
+ $namedConfig = $config->rename($className);
+
+ foreach ($this->passes as $pass) {
+ $code = $pass->apply($code, $namedConfig);
+ }
+
+ return new MockDefinition($namedConfig, $code);
+ }
+
+ public function addPass(Pass $pass)
+ {
+ $this->passes[] = $pass;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php b/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php
new file mode 100644
index 000000000..772441242
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php
@@ -0,0 +1,107 @@
+name = $name;
+ }
+
+ public static function factory($name)
+ {
+ return new self($name);
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function isAbstract()
+ {
+ return false;
+ }
+
+ public function isFinal()
+ {
+ return false;
+ }
+
+ public function getMethods()
+ {
+ return array();
+ }
+
+ public function getInterfaces()
+ {
+ return array();
+ }
+
+ public function getNamespaceName()
+ {
+ $parts = explode("\\", ltrim($this->getName(), "\\"));
+ array_pop($parts);
+ return implode("\\", $parts);
+ }
+
+ public function inNamespace()
+ {
+ return $this->getNamespaceName() !== '';
+ }
+
+ public function getShortName()
+ {
+ $parts = explode("\\", $this->getName());
+ return array_pop($parts);
+ }
+
+ public function implementsInterface($interface)
+ {
+ return false;
+ }
+
+ public function hasInternalAncestor()
+ {
+ return false;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php b/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php
new file mode 100644
index 000000000..1c13c8985
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php
@@ -0,0 +1,49 @@
+mock = $mock;
+ $this->method = $method;
+ }
+
+ /**
+ * @return \Mockery\Expectation
+ */
+ public function __call($method, $args)
+ {
+ if ($this->method === 'shouldNotHaveReceived') {
+ return $this->mock->{$this->method}($method, $args);
+ }
+
+ $expectation = $this->mock->{$this->method}($method);
+ return $expectation->withArgs($args);
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Instantiator.php b/vendor/mockery/mockery/library/Mockery/Instantiator.php
new file mode 100644
index 000000000..0e2c46476
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Instantiator.php
@@ -0,0 +1,209 @@
+.
+ */
+
+namespace Mockery;
+
+use Closure;
+use ReflectionClass;
+use UnexpectedValueException;
+use InvalidArgumentException;
+
+/**
+ * This is a trimmed down version of https://github.com/doctrine/instantiator,
+ * basically without the caching
+ *
+ * @author Marco Pivetta
+ */
+final class Instantiator
+{
+ /**
+ * Markers used internally by PHP to define whether {@see \unserialize} should invoke
+ * the method {@see \Serializable::unserialize()} when dealing with classes implementing
+ * the {@see \Serializable} interface.
+ */
+ const SERIALIZATION_FORMAT_USE_UNSERIALIZER = 'C';
+ const SERIALIZATION_FORMAT_AVOID_UNSERIALIZER = 'O';
+
+ /**
+ * {@inheritDoc}
+ */
+ public function instantiate($className)
+ {
+ $factory = $this->buildFactory($className);
+ $instance = $factory();
+
+ return $instance;
+ }
+
+ /**
+ * @internal
+ * @private
+ *
+ * Builds a {@see \Closure} capable of instantiating the given $className without
+ * invoking its constructor.
+ * This method is only exposed as public because of PHP 5.3 compatibility. Do not
+ * use this method in your own code
+ *
+ * @param string $className
+ *
+ * @return Closure
+ */
+ public function buildFactory($className)
+ {
+ $reflectionClass = $this->getReflectionClass($className);
+
+ if ($this->isInstantiableViaReflection($reflectionClass)) {
+ return function () use ($reflectionClass) {
+ return $reflectionClass->newInstanceWithoutConstructor();
+ };
+ }
+
+ $serializedString = sprintf(
+ '%s:%d:"%s":0:{}',
+ $this->getSerializationFormat($reflectionClass),
+ strlen($className),
+ $className
+ );
+
+ $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString);
+
+ return function () use ($serializedString) {
+ return unserialize($serializedString);
+ };
+ }
+
+ /**
+ * @param string $className
+ *
+ * @return ReflectionClass
+ *
+ * @throws InvalidArgumentException
+ */
+ private function getReflectionClass($className)
+ {
+ if (! class_exists($className)) {
+ throw new InvalidArgumentException("Class:$className does not exist");
+ }
+
+ $reflection = new ReflectionClass($className);
+
+ if ($reflection->isAbstract()) {
+ throw new InvalidArgumentException("Class:$className is an abstract class");
+ }
+
+ return $reflection;
+ }
+
+ /**
+ * @param ReflectionClass $reflectionClass
+ * @param string $serializedString
+ *
+ * @throws UnexpectedValueException
+ *
+ * @return void
+ */
+ private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString)
+ {
+ set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) {
+ $msg = sprintf(
+ 'Could not produce an instance of "%s" via un-serialization, since an error was triggered in file "%s" at line "%d"',
+ $reflectionClass->getName(),
+ $file,
+ $line
+ );
+
+ $error = new UnexpectedValueException($msg, 0, new \Exception($message, $code));
+ });
+
+ try {
+ unserialize($serializedString);
+ } catch (\Exception $exception) {
+ restore_error_handler();
+
+ throw new UnexpectedValueException("An exception was raised while trying to instantiate an instance of \"{$reflectionClass->getName()}\" via un-serialization", 0, $exception);
+ }
+
+ restore_error_handler();
+
+ if ($error) {
+ throw $error;
+ }
+ }
+
+ /**
+ * @param ReflectionClass $reflectionClass
+ *
+ * @return bool
+ */
+ private function isInstantiableViaReflection(ReflectionClass $reflectionClass)
+ {
+ return ! ($reflectionClass->isInternal() && $reflectionClass->isFinal());
+ }
+
+ /**
+ * Verifies whether the given class is to be considered internal
+ *
+ * @param ReflectionClass $reflectionClass
+ *
+ * @return bool
+ */
+ private function hasInternalAncestors(ReflectionClass $reflectionClass)
+ {
+ do {
+ if ($reflectionClass->isInternal()) {
+ return true;
+ }
+ } while ($reflectionClass = $reflectionClass->getParentClass());
+
+ return false;
+ }
+
+ /**
+ * Verifies if the given PHP version implements the `Serializable` interface serialization
+ * with an incompatible serialization format. If that's the case, use serialization marker
+ * "C" instead of "O".
+ *
+ * @link http://news.php.net/php.internals/74654
+ *
+ * @param ReflectionClass $reflectionClass
+ *
+ * @return string the serialization format marker, either self::SERIALIZATION_FORMAT_USE_UNSERIALIZER
+ * or self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER
+ */
+ private function getSerializationFormat(ReflectionClass $reflectionClass)
+ {
+ if ($this->isPhpVersionWithBrokenSerializationFormat()
+ && $reflectionClass->implementsInterface('Serializable')
+ ) {
+ return self::SERIALIZATION_FORMAT_USE_UNSERIALIZER;
+ }
+
+ return self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER;
+ }
+
+ /**
+ * Checks whether the current PHP runtime uses an incompatible serialization format
+ *
+ * @return bool
+ */
+ private function isPhpVersionWithBrokenSerializationFormat()
+ {
+ return PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php b/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php
new file mode 100644
index 000000000..e5f78a200
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php
@@ -0,0 +1,36 @@
+getClassName(), false)) {
+ return;
+ }
+
+ eval("?>" . $definition->getCode());
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Loader/Loader.php b/vendor/mockery/mockery/library/Mockery/Loader/Loader.php
new file mode 100644
index 000000000..170ffb6e9
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Loader/Loader.php
@@ -0,0 +1,28 @@
+path = realpath($path) ?: sys_get_temp_dir();
+ }
+
+ public function load(MockDefinition $definition)
+ {
+ if (class_exists($definition->getClassName(), false)) {
+ return;
+ }
+
+ $tmpfname = $this->path.DIRECTORY_SEPARATOR."Mockery_".uniqid().".php";
+ file_put_contents($tmpfname, $definition->getCode());
+
+ require $tmpfname;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php
new file mode 100644
index 000000000..e3c3b9439
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php
@@ -0,0 +1,45 @@
+';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Any.php b/vendor/mockery/mockery/library/Mockery/Matcher/Any.php
new file mode 100644
index 000000000..1ff440b1b
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Any.php
@@ -0,0 +1,45 @@
+';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php
new file mode 100644
index 000000000..9663a76d4
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php
@@ -0,0 +1,40 @@
+';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php
new file mode 100644
index 000000000..bcce4b745
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php
@@ -0,0 +1,46 @@
+_expected, true);
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php b/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php
new file mode 100644
index 000000000..04408f569
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php
@@ -0,0 +1,25 @@
+_expected;
+ $result = $closure($actual);
+ return $result === true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php b/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php
new file mode 100644
index 000000000..79afb73a7
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php
@@ -0,0 +1,64 @@
+_expected as $exp) {
+ $match = false;
+ foreach ($values as $val) {
+ if ($exp === $val || $exp == $val) {
+ $match = true;
+ break;
+ }
+ }
+ if ($match === false) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = '_expected as $v) {
+ $elements[] = (string) $v;
+ }
+ $return .= implode(', ', $elements) . ']>';
+ return $return;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php b/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php
new file mode 100644
index 000000000..291f42208
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php
@@ -0,0 +1,53 @@
+_expected as $method) {
+ if (!method_exists($actual, $method)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '_expected) . ']>';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php
new file mode 100644
index 000000000..fa983eaf7
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php
@@ -0,0 +1,45 @@
+_expected, $actual);
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return "_expected]>";
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php
new file mode 100644
index 000000000..8ca6afd13
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php
@@ -0,0 +1,46 @@
+_expected, $actual);
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = '_expected . ']>';
+ return $return;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php b/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php
new file mode 100644
index 000000000..3233079ec
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php
@@ -0,0 +1,58 @@
+_expected = $expected;
+ }
+
+ /**
+ * Check if the actual value matches the expected.
+ * Actual passed by reference to preserve reference trail (where applicable)
+ * back to the original method parameter.
+ *
+ * @param mixed $actual
+ * @return bool
+ */
+ abstract public function match(&$actual);
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ abstract public function __toString();
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php b/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php
new file mode 100644
index 000000000..8f00a8933
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php
@@ -0,0 +1,49 @@
+_expected;
+ return true === call_user_func_array($closure, $actual);
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php b/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php
new file mode 100644
index 000000000..27b5ec562
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php
@@ -0,0 +1,52 @@
+_expected === $actual;
+ }
+
+ return $this->_expected == $actual;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php
new file mode 100644
index 000000000..5e9e4189e
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php
@@ -0,0 +1,40 @@
+';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Not.php b/vendor/mockery/mockery/library/Mockery/Matcher/Not.php
new file mode 100644
index 000000000..756ccaa5b
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Not.php
@@ -0,0 +1,46 @@
+_expected;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php
new file mode 100644
index 000000000..cd8270157
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php
@@ -0,0 +1,51 @@
+_expected as $exp) {
+ if ($actual === $exp || $actual == $exp) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/PHPUnitConstraint.php b/vendor/mockery/mockery/library/Mockery/Matcher/PHPUnitConstraint.php
new file mode 100644
index 000000000..a9aaf4c47
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/PHPUnitConstraint.php
@@ -0,0 +1,76 @@
+constraint = $constraint;
+ $this->rethrow = $rethrow;
+ }
+
+ /**
+ * @param mixed $actual
+ * @return bool
+ */
+ public function match(&$actual)
+ {
+ try {
+ $this->constraint->evaluate($actual);
+ return true;
+ } catch (\PHPUnit_Framework_AssertionFailedError $e) {
+ if ($this->rethrow) {
+ throw $e;
+ }
+ return false;
+ } catch (\PHPUnit\Framework\AssertionFailedError $e) {
+ if ($this->rethrow) {
+ throw $e;
+ }
+ return false;
+ }
+ }
+
+ /**
+ *
+ */
+ public function __toString()
+ {
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php b/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php
new file mode 100644
index 000000000..362c366fd
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php
@@ -0,0 +1,45 @@
+_expected, (string) $actual) >= 1;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php b/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php
new file mode 100644
index 000000000..5e706c81f
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php
@@ -0,0 +1,92 @@
+expected = $expected;
+ $this->strict = $strict;
+ }
+
+ /**
+ * @param array $expected Expected subset of data
+ *
+ * @return Subset
+ */
+ public static function strict(array $expected)
+ {
+ return new static($expected, true);
+ }
+
+ /**
+ * @param array $expected Expected subset of data
+ *
+ * @return Subset
+ */
+ public static function loose(array $expected)
+ {
+ return new static($expected, false);
+ }
+
+ /**
+ * Check if the actual value matches the expected.
+ *
+ * @param mixed $actual
+ * @return bool
+ */
+ public function match(&$actual)
+ {
+ if (!is_array($actual)) {
+ return false;
+ }
+
+ if ($this->strict) {
+ return $actual === array_replace_recursive($actual, $this->expected);
+ }
+
+ return $actual == array_replace_recursive($actual, $this->expected);
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $return = 'expected as $k=>$v) {
+ $elements[] = $k . '=' . (string) $v;
+ }
+ $return .= implode(', ', $elements) . ']>';
+ return $return;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Type.php b/vendor/mockery/mockery/library/Mockery/Matcher/Type.php
new file mode 100644
index 000000000..dc189ab0a
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Matcher/Type.php
@@ -0,0 +1,52 @@
+_expected);
+ if (function_exists($function)) {
+ return $function($actual);
+ } elseif (is_string($this->_expected)
+ && (class_exists($this->_expected) || interface_exists($this->_expected))) {
+ return $actual instanceof $this->_expected;
+ }
+ return false;
+ }
+
+ /**
+ * Return a string representation of this Matcher
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '<' . ucfirst($this->_expected) . '>';
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/MethodCall.php b/vendor/mockery/mockery/library/Mockery/MethodCall.php
new file mode 100644
index 000000000..db68fd81f
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/MethodCall.php
@@ -0,0 +1,43 @@
+method = $method;
+ $this->args = $args;
+ }
+
+ public function getMethod()
+ {
+ return $this->method;
+ }
+
+ public function getArgs()
+ {
+ return $this->args;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Mock.php b/vendor/mockery/mockery/library/Mockery/Mock.php
new file mode 100644
index 000000000..cf0aa13d7
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Mock.php
@@ -0,0 +1,935 @@
+_mockery_container = $container;
+ if (!is_null($partialObject)) {
+ $this->_mockery_partial = $partialObject;
+ }
+
+ if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()) {
+ foreach ($this->mockery_getMethods() as $method) {
+ if ($method->isPublic() && !$method->isStatic()) {
+ $this->_mockery_mockableMethods[] = $method->getName();
+ }
+ }
+ }
+ }
+
+ /**
+ * Set expected method calls
+ *
+ * @param array ...$methodNames one or many methods that are expected to be called in this mock
+ *
+ * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage
+ */
+ public function shouldReceive(...$methodNames)
+ {
+ if (count($methodNames) === 0) {
+ return new HigherOrderMessage($this, "shouldReceive");
+ }
+
+ foreach ($methodNames as $method) {
+ if ("" == $method) {
+ throw new \InvalidArgumentException("Received empty method name");
+ }
+ }
+
+ $self = $this;
+ $allowMockingProtectedMethods = $this->_mockery_allowMockingProtectedMethods;
+
+ $lastExpectation = \Mockery::parseShouldReturnArgs(
+ $this, $methodNames, function ($method) use ($self, $allowMockingProtectedMethods) {
+ $rm = $self->mockery_getMethod($method);
+ if ($rm) {
+ if ($rm->isPrivate()) {
+ throw new \InvalidArgumentException("$method() cannot be mocked as it is a private method");
+ }
+ if (!$allowMockingProtectedMethods && $rm->isProtected()) {
+ throw new \InvalidArgumentException("$method() cannot be mocked as it is a protected method and mocking protected methods is not enabled for the currently used mock object. Use shouldAllowMockingProtectedMethods() to enable mocking of protected methods.");
+ }
+ }
+
+ $director = $self->mockery_getExpectationsFor($method);
+ if (!$director) {
+ $director = new \Mockery\ExpectationDirector($method, $self);
+ $self->mockery_setExpectationsFor($method, $director);
+ }
+ $expectation = new \Mockery\Expectation($self, $method);
+ $director->addExpectation($expectation);
+ return $expectation;
+ }
+ );
+ return $lastExpectation;
+ }
+
+ /**
+ * @param mixed $something String method name or map of method => return
+ * @return self|\Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage
+ */
+ public function allows($something = [])
+ {
+ if (is_string($something)) {
+ return $this->shouldReceive($something);
+ }
+
+ if (empty($something)) {
+ return $this->shouldReceive();
+ }
+
+ foreach ($something as $method => $returnValue) {
+ $this->shouldReceive($method)->andReturn($returnValue);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param mixed $something String method name (optional)
+ * @return \Mockery\ExpectationInterface|\Mockery\Expectation|ExpectsHigherOrderMessage
+ */
+ public function expects($something = null)
+ {
+ if (is_string($something)) {
+ return $this->shouldReceive($something)->once();
+ }
+
+ return new ExpectsHigherOrderMessage($this);
+ }
+
+ /**
+ * Shortcut method for setting an expectation that a method should not be called.
+ *
+ * @param array ...$methodNames one or many methods that are expected not to be called in this mock
+ * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage
+ */
+ public function shouldNotReceive(...$methodNames)
+ {
+ if (count($methodNames) === 0) {
+ return new HigherOrderMessage($this, "shouldNotReceive");
+ }
+
+ $expectation = call_user_func_array(array($this, 'shouldReceive'), $methodNames);
+ $expectation->never();
+ return $expectation;
+ }
+
+ /**
+ * Allows additional methods to be mocked that do not explicitly exist on mocked class
+ * @param String $method name of the method to be mocked
+ * @return Mock
+ */
+ public function shouldAllowMockingMethod($method)
+ {
+ $this->_mockery_mockableMethods[] = $method;
+ return $this;
+ }
+
+ /**
+ * Set mock to ignore unexpected methods and return Undefined class
+ * @param mixed $returnValue the default return value for calls to missing functions on this mock
+ * @return Mock
+ */
+ public function shouldIgnoreMissing($returnValue = null)
+ {
+ $this->_mockery_ignoreMissing = true;
+ $this->_mockery_defaultReturnValue = $returnValue;
+ return $this;
+ }
+
+ public function asUndefined()
+ {
+ $this->_mockery_ignoreMissing = true;
+ $this->_mockery_defaultReturnValue = new \Mockery\Undefined;
+ return $this;
+ }
+
+ /**
+ * @return Mock
+ */
+ public function shouldAllowMockingProtectedMethods()
+ {
+ $this->_mockery_allowMockingProtectedMethods = true;
+ return $this;
+ }
+
+
+ /**
+ * Set mock to defer unexpected methods to it's parent
+ *
+ * This is particularly useless for this class, as it doesn't have a parent,
+ * but included for completeness
+ *
+ * @deprecated 2.0.0 Please use makePartial() instead
+ *
+ * @return Mock
+ */
+ public function shouldDeferMissing()
+ {
+ return $this->makePartial();
+ }
+
+ /**
+ * Set mock to defer unexpected methods to it's parent
+ *
+ * It was an alias for shouldDeferMissing(), which will be removed
+ * in 2.0.0.
+ *
+ * @return Mock
+ */
+ public function makePartial()
+ {
+ $this->_mockery_deferMissing = true;
+ return $this;
+ }
+
+ /**
+ * In the event shouldReceive() accepting one or more methods/returns,
+ * this method will switch them from normal expectations to default
+ * expectations
+ *
+ * @return self
+ */
+ public function byDefault()
+ {
+ foreach ($this->_mockery_expectations as $director) {
+ $exps = $director->getExpectations();
+ foreach ($exps as $exp) {
+ $exp->byDefault();
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Capture calls to this mock
+ */
+ public function __call($method, array $args)
+ {
+ return $this->_mockery_handleMethodCall($method, $args);
+ }
+
+ public static function __callStatic($method, array $args)
+ {
+ return self::_mockery_handleStaticMethodCall($method, $args);
+ }
+
+ /**
+ * Forward calls to this magic method to the __call method
+ */
+ public function __toString()
+ {
+ return $this->__call('__toString', array());
+ }
+
+ /**
+ * Iterate across all expectation directors and validate each
+ *
+ * @throws \Mockery\CountValidator\Exception
+ * @return void
+ */
+ public function mockery_verify()
+ {
+ if ($this->_mockery_verified) {
+ return;
+ }
+ if (isset($this->_mockery_ignoreVerification)
+ && $this->_mockery_ignoreVerification == true) {
+ return;
+ }
+ $this->_mockery_verified = true;
+ foreach ($this->_mockery_expectations as $director) {
+ $director->verify();
+ }
+ }
+
+ /**
+ * Gets a list of exceptions thrown by this mock
+ *
+ * @return array
+ */
+ public function mockery_thrownExceptions()
+ {
+ return $this->_mockery_thrownExceptions;
+ }
+
+ /**
+ * Tear down tasks for this mock
+ *
+ * @return void
+ */
+ public function mockery_teardown()
+ {
+ }
+
+ /**
+ * Fetch the next available allocation order number
+ *
+ * @return int
+ */
+ public function mockery_allocateOrder()
+ {
+ $this->_mockery_allocatedOrder += 1;
+ return $this->_mockery_allocatedOrder;
+ }
+
+ /**
+ * Set ordering for a group
+ *
+ * @param mixed $group
+ * @param int $order
+ */
+ public function mockery_setGroup($group, $order)
+ {
+ $this->_mockery_groups[$group] = $order;
+ }
+
+ /**
+ * Fetch array of ordered groups
+ *
+ * @return array
+ */
+ public function mockery_getGroups()
+ {
+ return $this->_mockery_groups;
+ }
+
+ /**
+ * Set current ordered number
+ *
+ * @param int $order
+ */
+ public function mockery_setCurrentOrder($order)
+ {
+ $this->_mockery_currentOrder = $order;
+ return $this->_mockery_currentOrder;
+ }
+
+ /**
+ * Get current ordered number
+ *
+ * @return int
+ */
+ public function mockery_getCurrentOrder()
+ {
+ return $this->_mockery_currentOrder;
+ }
+
+ /**
+ * Validate the current mock's ordering
+ *
+ * @param string $method
+ * @param int $order
+ * @throws \Mockery\Exception
+ * @return void
+ */
+ public function mockery_validateOrder($method, $order)
+ {
+ if ($order < $this->_mockery_currentOrder) {
+ $exception = new \Mockery\Exception\InvalidOrderException(
+ 'Method ' . __CLASS__ . '::' . $method . '()'
+ . ' called out of order: expected order '
+ . $order . ', was ' . $this->_mockery_currentOrder
+ );
+ $exception->setMock($this)
+ ->setMethodName($method)
+ ->setExpectedOrder($order)
+ ->setActualOrder($this->_mockery_currentOrder);
+ throw $exception;
+ }
+ $this->mockery_setCurrentOrder($order);
+ }
+
+ /**
+ * Gets the count of expectations for this mock
+ *
+ * @return int
+ */
+ public function mockery_getExpectationCount()
+ {
+ $count = $this->_mockery_expectations_count;
+ foreach ($this->_mockery_expectations as $director) {
+ $count += $director->getExpectationCount();
+ }
+ return $count;
+ }
+
+ /**
+ * Return the expectations director for the given method
+ *
+ * @var string $method
+ * @return \Mockery\ExpectationDirector|null
+ */
+ public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director)
+ {
+ $this->_mockery_expectations[$method] = $director;
+ }
+
+ /**
+ * Return the expectations director for the given method
+ *
+ * @var string $method
+ * @return \Mockery\ExpectationDirector|null
+ */
+ public function mockery_getExpectationsFor($method)
+ {
+ if (isset($this->_mockery_expectations[$method])) {
+ return $this->_mockery_expectations[$method];
+ }
+ }
+
+ /**
+ * Find an expectation matching the given method and arguments
+ *
+ * @var string $method
+ * @var array $args
+ * @return \Mockery\Expectation|null
+ */
+ public function mockery_findExpectation($method, array $args)
+ {
+ if (!isset($this->_mockery_expectations[$method])) {
+ return null;
+ }
+ $director = $this->_mockery_expectations[$method];
+
+ return $director->findExpectation($args);
+ }
+
+ /**
+ * Return the container for this mock
+ *
+ * @return \Mockery\Container
+ */
+ public function mockery_getContainer()
+ {
+ return $this->_mockery_container;
+ }
+
+ /**
+ * Return the name for this mock
+ *
+ * @return string
+ */
+ public function mockery_getName()
+ {
+ return __CLASS__;
+ }
+
+ /**
+ * @return array
+ */
+ public function mockery_getMockableProperties()
+ {
+ return $this->_mockery_mockableProperties;
+ }
+
+ public function __isset($name)
+ {
+ if (false === stripos($name, '_mockery_') && method_exists(get_parent_class($this), '__isset')) {
+ return parent::__isset($name);
+ }
+
+ return false;
+ }
+
+ public function mockery_getExpectations()
+ {
+ return $this->_mockery_expectations;
+ }
+
+ /**
+ * Calls a parent class method and returns the result. Used in a passthru
+ * expectation where a real return value is required while still taking
+ * advantage of expectation matching and call count verification.
+ *
+ * @param string $name
+ * @param array $args
+ * @return mixed
+ */
+ public function mockery_callSubjectMethod($name, array $args)
+ {
+ return call_user_func_array('parent::' . $name, $args);
+ }
+
+ /**
+ * @return string[]
+ */
+ public function mockery_getMockableMethods()
+ {
+ return $this->_mockery_mockableMethods;
+ }
+
+ /**
+ * @return bool
+ */
+ public function mockery_isAnonymous()
+ {
+ $rfc = new \ReflectionClass($this);
+
+ // HHVM has a Stringish interface
+ $interfaces = array_filter($rfc->getInterfaces(), function ($i) {
+ return $i->getName() !== "Stringish";
+ });
+ $onlyImplementsMock = 1 == count($interfaces);
+
+ return (false === $rfc->getParentClass()) && $onlyImplementsMock;
+ }
+
+ public function __wakeup()
+ {
+ /**
+ * This does not add __wakeup method support. It's a blind method and any
+ * expected __wakeup work will NOT be performed. It merely cuts off
+ * annoying errors where a __wakeup exists but is not essential when
+ * mocking
+ */
+ }
+
+ public function __destruct()
+ {
+ /**
+ * Overrides real class destructor in case if class was created without original constructor
+ */
+ }
+
+ public function mockery_getMethod($name)
+ {
+ foreach ($this->mockery_getMethods() as $method) {
+ if ($method->getName() == $name) {
+ return $method;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param string $name Method name.
+ *
+ * @return mixed Generated return value based on the declared return value of the named method.
+ */
+ public function mockery_returnValueForMethod($name)
+ {
+ if (version_compare(PHP_VERSION, '7.0.0-dev') < 0) {
+ return;
+ }
+
+ $rm = $this->mockery_getMethod($name);
+ if (!$rm || !$rm->hasReturnType()) {
+ return;
+ }
+
+ $returnType = $rm->getReturnType();
+
+ // Default return value for methods with nullable type is null
+ if ($returnType->allowsNull()) {
+ return null;
+ }
+
+ $type = (string) $returnType;
+ switch ($type) {
+ case '': return;
+ case 'string': return '';
+ case 'int': return 0;
+ case 'float': return 0.0;
+ case 'bool': return false;
+ case 'array': return [];
+
+ case 'callable':
+ case 'Closure':
+ return function () {
+ };
+
+ case 'Traversable':
+ case 'Generator':
+ // Remove eval() when minimum version >=5.5
+ $generator = eval('return function () { yield; };');
+ return $generator();
+
+ case 'self':
+ return \Mockery::mock($rm->getDeclaringClass()->getName());
+
+ case 'void':
+ return null;
+
+ case 'object':
+ if (version_compare(PHP_VERSION, '7.2.0-dev') >= 0) {
+ return \Mockery::mock();
+ }
+
+ default:
+ return \Mockery::mock($type);
+ }
+ }
+
+ public function shouldHaveReceived($method = null, $args = null)
+ {
+ if ($method === null) {
+ return new HigherOrderMessage($this, "shouldHaveReceived");
+ }
+
+ $expectation = new \Mockery\VerificationExpectation($this, $method);
+ if (null !== $args) {
+ $expectation->withArgs($args);
+ }
+ $expectation->atLeast()->once();
+ $director = new \Mockery\VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation);
+ $this->_mockery_expectations_count++;
+ $director->verify();
+ return $director;
+ }
+
+ public function shouldHaveBeenCalled()
+ {
+ return $this->shouldHaveReceived("__invoke");
+ }
+
+ public function shouldNotHaveReceived($method = null, $args = null)
+ {
+ if ($method === null) {
+ return new HigherOrderMessage($this, "shouldNotHaveReceived");
+ }
+
+ $expectation = new \Mockery\VerificationExpectation($this, $method);
+ if (null !== $args) {
+ $expectation->withArgs($args);
+ }
+ $expectation->never();
+ $director = new \Mockery\VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation);
+ $this->_mockery_expectations_count++;
+ $director->verify();
+ return null;
+ }
+
+ public function shouldNotHaveBeenCalled(array $args = null)
+ {
+ return $this->shouldNotHaveReceived("__invoke", $args);
+ }
+
+ protected static function _mockery_handleStaticMethodCall($method, array $args)
+ {
+ $associatedRealObject = \Mockery::fetchMock(__CLASS__);
+ try {
+ return $associatedRealObject->__call($method, $args);
+ } catch (BadMethodCallException $e) {
+ throw new BadMethodCallException(
+ 'Static method ' . $associatedRealObject->mockery_getName() . '::' . $method
+ . '() does not exist on this mock object',
+ null,
+ $e
+ );
+ }
+ }
+
+ protected function _mockery_getReceivedMethodCalls()
+ {
+ return $this->_mockery_receivedMethodCalls ?: $this->_mockery_receivedMethodCalls = new \Mockery\ReceivedMethodCalls();
+ }
+
+ /**
+ * Called when an instance Mock was created and its constructor is getting called
+ *
+ * @see \Mockery\Generator\StringManipulation\Pass\InstanceMockPass
+ * @param array $args
+ */
+ protected function _mockery_constructorCalled(array $args)
+ {
+ if (!isset($this->_mockery_expectations['__construct']) /* _mockery_handleMethodCall runs the other checks */) {
+ return;
+ }
+ $this->_mockery_handleMethodCall('__construct', $args);
+ }
+
+ protected function _mockery_findExpectedMethodHandler($method)
+ {
+ if (isset($this->_mockery_expectations[$method])) {
+ return $this->_mockery_expectations[$method];
+ }
+
+ $lowerCasedMockeryExpectations = array_change_key_case($this->_mockery_expectations, CASE_LOWER);
+ $lowerCasedMethod = strtolower($method);
+
+ if (isset($lowerCasedMockeryExpectations[$lowerCasedMethod])) {
+ return $lowerCasedMockeryExpectations[$lowerCasedMethod];
+ }
+
+ return null;
+ }
+
+ protected function _mockery_handleMethodCall($method, array $args)
+ {
+ $this->_mockery_getReceivedMethodCalls()->push(new \Mockery\MethodCall($method, $args));
+
+ $rm = $this->mockery_getMethod($method);
+ if ($rm && $rm->isProtected() && !$this->_mockery_allowMockingProtectedMethods) {
+ if ($rm->isAbstract()) {
+ return;
+ }
+
+ try {
+ $prototype = $rm->getPrototype();
+ if ($prototype->isAbstract()) {
+ return;
+ }
+ } catch (\ReflectionException $re) {
+ // noop - there is no hasPrototype method
+ }
+
+ return call_user_func_array("parent::$method", $args);
+ }
+
+ $handler = $this->_mockery_findExpectedMethodHandler($method);
+
+ if ($handler !== null && !$this->_mockery_disableExpectationMatching) {
+ try {
+ return $handler->call($args);
+ } catch (\Mockery\Exception\NoMatchingExpectationException $e) {
+ if (!$this->_mockery_ignoreMissing && !$this->_mockery_deferMissing) {
+ throw $e;
+ }
+ }
+ }
+
+ if (!is_null($this->_mockery_partial) && method_exists($this->_mockery_partial, $method)) {
+ return call_user_func_array(array($this->_mockery_partial, $method), $args);
+ } elseif ($this->_mockery_deferMissing && is_callable("parent::$method")
+ && (!$this->hasMethodOverloadingInParentClass() || method_exists(get_parent_class($this), $method))) {
+ return call_user_func_array("parent::$method", $args);
+ } elseif ($method == '__toString') {
+ // __toString is special because we force its addition to the class API regardless of the
+ // original implementation. Thus, we should always return a string rather than honor
+ // _mockery_ignoreMissing and break the API with an error.
+ return sprintf("%s#%s", __CLASS__, spl_object_hash($this));
+ } elseif ($this->_mockery_ignoreMissing) {
+ if (\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() || (method_exists($this->_mockery_partial, $method) || is_callable("parent::$method"))) {
+ if ($this->_mockery_defaultReturnValue instanceof \Mockery\Undefined) {
+ return call_user_func_array(array($this->_mockery_defaultReturnValue, $method), $args);
+ } elseif (null === $this->_mockery_defaultReturnValue) {
+ return $this->mockery_returnValueForMethod($method);
+ }
+
+ return $this->_mockery_defaultReturnValue;
+ }
+ }
+
+ $message = 'Method ' . __CLASS__ . '::' . $method .
+ '() does not exist on this mock object';
+
+ if (!is_null($rm)) {
+ $message = 'Received ' . __CLASS__ .
+ '::' . $method . '(), but no expectations were specified';
+ }
+
+ $bmce = new BadMethodCallException($message);
+ $this->_mockery_thrownExceptions[] = $bmce;
+ throw $bmce;
+ }
+
+ /**
+ * Uses reflection to get the list of all
+ * methods within the current mock object
+ *
+ * @return array
+ */
+ protected function mockery_getMethods()
+ {
+ if (static::$_mockery_methods && \Mockery::getConfiguration()->reflectionCacheEnabled()) {
+ return static::$_mockery_methods;
+ }
+
+ if (isset($this->_mockery_partial)) {
+ $reflected = new \ReflectionObject($this->_mockery_partial);
+ } else {
+ $reflected = new \ReflectionClass($this);
+ }
+
+ return static::$_mockery_methods = $reflected->getMethods();
+ }
+
+ private function hasMethodOverloadingInParentClass()
+ {
+ // if there's __call any name would be callable
+ return is_callable('parent::aFunctionNameThatNoOneWouldEverUseInRealLife12345');
+ }
+
+ /**
+ * @return array
+ */
+ private function getNonPublicMethods()
+ {
+ return array_map(
+ function ($method) {
+ return $method->getName();
+ },
+ array_filter($this->mockery_getMethods(), function ($method) {
+ return !$method->isPublic();
+ })
+ );
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/MockInterface.php b/vendor/mockery/mockery/library/Mockery/MockInterface.php
new file mode 100644
index 000000000..e7a2685eb
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/MockInterface.php
@@ -0,0 +1,252 @@
+ return
+ * @return self|\Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage
+ */
+ public function allows($something = []);
+
+ /**
+ * @param mixed $something String method name (optional)
+ * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\ExpectsHigherOrderMessage
+ */
+ public function expects($something = null);
+
+ /**
+ * Alternative setup method to constructor
+ *
+ * @param \Mockery\Container $container
+ * @param object $partialObject
+ * @return void
+ */
+ public function mockery_init(\Mockery\Container $container = null, $partialObject = null);
+
+ /**
+ * Set expected method calls
+ *
+ * @param array ...$methodNames one or many methods that are expected to be called in this mock
+ *
+ * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage
+ */
+ public function shouldReceive(...$methodNames);
+
+ /**
+ * Shortcut method for setting an expectation that a method should not be called.
+ *
+ * @param array ...$methodNames one or many methods that are expected not to be called in this mock
+ * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage
+ */
+ public function shouldNotReceive(...$methodNames);
+
+ /**
+ * Allows additional methods to be mocked that do not explicitly exist on mocked class
+ * @param String $method name of the method to be mocked
+ */
+ public function shouldAllowMockingMethod($method);
+
+ /**
+ * Set mock to ignore unexpected methods and return Undefined class
+ * @param mixed $returnValue the default return value for calls to missing functions on this mock
+ * @return Mock
+ */
+ public function shouldIgnoreMissing($returnValue = null);
+
+ /**
+ * @return Mock
+ */
+ public function shouldAllowMockingProtectedMethods();
+
+ /**
+ * Set mock to defer unexpected methods to its parent if possible
+ *
+ * @deprecated 2.0.0 Please use makePartial() instead
+ *
+ * @return Mock
+ */
+ public function shouldDeferMissing();
+
+ /**
+ * Set mock to defer unexpected methods to its parent if possible
+ *
+ * @return Mock
+ */
+ public function makePartial();
+
+ /**
+ * @param null|string $method
+ * @param null $args
+ * @return mixed
+ */
+ public function shouldHaveReceived($method, $args = null);
+
+ /**
+ * @return mixed
+ */
+ public function shouldHaveBeenCalled();
+
+ /**
+ * @param null|string $method
+ * @param null $args
+ * @return mixed
+ */
+ public function shouldNotHaveReceived($method, $args = null);
+
+ /**
+ * @param array $args (optional)
+ * @return mixed
+ */
+ public function shouldNotHaveBeenCalled(array $args = null);
+
+ /**
+ * In the event shouldReceive() accepting an array of methods/returns
+ * this method will switch them from normal expectations to default
+ * expectations
+ *
+ * @return self
+ */
+ public function byDefault();
+
+ /**
+ * Iterate across all expectation directors and validate each
+ *
+ * @throws \Mockery\CountValidator\Exception
+ * @return void
+ */
+ public function mockery_verify();
+
+ /**
+ * Tear down tasks for this mock
+ *
+ * @return void
+ */
+ public function mockery_teardown();
+
+ /**
+ * Fetch the next available allocation order number
+ *
+ * @return int
+ */
+ public function mockery_allocateOrder();
+
+ /**
+ * Set ordering for a group
+ *
+ * @param mixed $group
+ * @param int $order
+ */
+ public function mockery_setGroup($group, $order);
+
+ /**
+ * Fetch array of ordered groups
+ *
+ * @return array
+ */
+ public function mockery_getGroups();
+
+ /**
+ * Set current ordered number
+ *
+ * @param int $order
+ */
+ public function mockery_setCurrentOrder($order);
+
+ /**
+ * Get current ordered number
+ *
+ * @return int
+ */
+ public function mockery_getCurrentOrder();
+
+ /**
+ * Validate the current mock's ordering
+ *
+ * @param string $method
+ * @param int $order
+ * @throws \Mockery\Exception
+ * @return void
+ */
+ public function mockery_validateOrder($method, $order);
+
+ /**
+ * Gets the count of expectations for this mock
+ *
+ * @return int
+ */
+ public function mockery_getExpectationCount();
+
+ /**
+ * Return the expectations director for the given method
+ *
+ * @var string $method
+ * @return \Mockery\ExpectationDirector|null
+ */
+ public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director);
+
+ /**
+ * Return the expectations director for the given method
+ *
+ * @var string $method
+ * @return \Mockery\ExpectationDirector|null
+ */
+ public function mockery_getExpectationsFor($method);
+
+ /**
+ * Find an expectation matching the given method and arguments
+ *
+ * @var string $method
+ * @var array $args
+ * @return \Mockery\Expectation|null
+ */
+ public function mockery_findExpectation($method, array $args);
+
+ /**
+ * Return the container for this mock
+ *
+ * @return \Mockery\Container
+ */
+ public function mockery_getContainer();
+
+ /**
+ * Return the name for this mock
+ *
+ * @return string
+ */
+ public function mockery_getName();
+
+ /**
+ * @return array
+ */
+ public function mockery_getMockableProperties();
+
+ /**
+ * @return string[]
+ */
+ public function mockery_getMockableMethods();
+
+ /**
+ * @return bool
+ */
+ public function mockery_isAnonymous();
+}
diff --git a/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php b/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php
new file mode 100644
index 000000000..da771c05a
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php
@@ -0,0 +1,48 @@
+methodCalls[] = $methodCall;
+ }
+
+ public function verify(Expectation $expectation)
+ {
+ foreach ($this->methodCalls as $methodCall) {
+ if ($methodCall->getMethod() !== $expectation->getName()) {
+ continue;
+ }
+
+ if (!$expectation->matchArgs($methodCall->getArgs())) {
+ continue;
+ }
+
+ $expectation->verifyCall($methodCall->getArgs());
+ }
+
+ $expectation->verify();
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/Undefined.php b/vendor/mockery/mockery/library/Mockery/Undefined.php
new file mode 100644
index 000000000..53b05e9c5
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/Undefined.php
@@ -0,0 +1,46 @@
+receivedMethodCalls = $receivedMethodCalls;
+ $this->expectation = $expectation;
+ }
+
+ public function verify()
+ {
+ return $this->receivedMethodCalls->verify($this->expectation);
+ }
+
+ public function with(...$args)
+ {
+ return $this->cloneApplyAndVerify("with", $args);
+ }
+
+ public function withArgs($args)
+ {
+ return $this->cloneApplyAndVerify("withArgs", array($args));
+ }
+
+ public function withNoArgs()
+ {
+ return $this->cloneApplyAndVerify("withNoArgs", array());
+ }
+
+ public function withAnyArgs()
+ {
+ return $this->cloneApplyAndVerify("withAnyArgs", array());
+ }
+
+ public function times($limit = null)
+ {
+ return $this->cloneWithoutCountValidatorsApplyAndVerify("times", array($limit));
+ }
+
+ public function once()
+ {
+ return $this->cloneWithoutCountValidatorsApplyAndVerify("once", array());
+ }
+
+ public function twice()
+ {
+ return $this->cloneWithoutCountValidatorsApplyAndVerify("twice", array());
+ }
+
+ public function atLeast()
+ {
+ return $this->cloneWithoutCountValidatorsApplyAndVerify("atLeast", array());
+ }
+
+ public function atMost()
+ {
+ return $this->cloneWithoutCountValidatorsApplyAndVerify("atMost", array());
+ }
+
+ public function between($minimum, $maximum)
+ {
+ return $this->cloneWithoutCountValidatorsApplyAndVerify("between", array($minimum, $maximum));
+ }
+
+ protected function cloneWithoutCountValidatorsApplyAndVerify($method, $args)
+ {
+ $expectation = clone $this->expectation;
+ $expectation->clearCountValidators();
+ call_user_func_array(array($expectation, $method), $args);
+ $director = new VerificationDirector($this->receivedMethodCalls, $expectation);
+ $director->verify();
+ return $director;
+ }
+
+ protected function cloneApplyAndVerify($method, $args)
+ {
+ $expectation = clone $this->expectation;
+ call_user_func_array(array($expectation, $method), $args);
+ $director = new VerificationDirector($this->receivedMethodCalls, $expectation);
+ $director->verify();
+ return $director;
+ }
+}
diff --git a/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php b/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php
new file mode 100644
index 000000000..3844a090a
--- /dev/null
+++ b/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php
@@ -0,0 +1,35 @@
+_countValidators = array();
+ }
+
+ public function __clone()
+ {
+ parent::__clone();
+ $this->_actualCount = 0;
+ }
+}
diff --git a/vendor/mockery/mockery/library/helpers.php b/vendor/mockery/mockery/library/helpers.php
new file mode 100644
index 000000000..72b7240ed
--- /dev/null
+++ b/vendor/mockery/mockery/library/helpers.php
@@ -0,0 +1,66 @@
+
+
+
+
+ ./tests
+ ./tests/PHP70
+ ./tests/PHP72
+
+ ./tests/PHP56
+ ./tests/Mockery/MockingVariadicArgumentsTest.php
+
+
+
+ ./tests
+ ./tests/PHP56
+
+ ./tests/PHP70
+ ./tests/PHP72
+ ./tests/Mockery/MockingVariadicArgumentsTest.php
+
+
+
+
+
+ ./library/
+
+ ./library/Mockery/Adapter/Phpunit/Legacy
+ ./library/Mockery/Adapter/Phpunit/TestListener.php
+
+
+
+
+
diff --git a/vendor/mockery/mockery/tests/Bootstrap.php b/vendor/mockery/mockery/tests/Bootstrap.php
new file mode 100644
index 000000000..5da2f6724
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Bootstrap.php
@@ -0,0 +1,66 @@
+checkMockeryExceptions();
+ }
+
+ public function markAsRisky()
+ {
+ }
+};
+
+class MockeryPHPUnitIntegrationTest extends MockeryTestCase
+{
+ /**
+ * @test
+ * @requires PHPUnit 5.7.6
+ */
+ public function it_marks_a_passing_test_as_risky_if_we_threw_exceptions()
+ {
+ $mock = mock();
+ try {
+ $mock->foobar();
+ } catch (\Exception $e) {
+ // exception swallowed...
+ }
+
+ $test = spy(BaseClassStub::class)->makePartial();
+ $test->finish();
+
+ $test->shouldHaveReceived()->markAsRisky();
+ }
+
+ /**
+ * @test
+ * @requires PHPUnit 5.7.6
+ */
+ public function the_user_can_manually_dismiss_an_exception_to_avoid_the_risky_test()
+ {
+ $mock = mock();
+ try {
+ $mock->foobar();
+ } catch (BadMethodCallException $e) {
+ $e->dismiss();
+ }
+
+ $test = spy(BaseClassStub::class)->makePartial();
+ $test->finish();
+
+ $test->shouldNotHaveReceived()->markAsRisky();
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Adapter/Phpunit/TestListenerTest.php b/vendor/mockery/mockery/tests/Mockery/Adapter/Phpunit/TestListenerTest.php
new file mode 100644
index 000000000..9a73c81df
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Adapter/Phpunit/TestListenerTest.php
@@ -0,0 +1,103 @@
+markTestSkipped('The TestListener is only supported with PHPUnit 6+.');
+ return;
+ }
+ // We intentionally test the static container here. That is what the
+ // listener will check.
+ $this->container = \Mockery::getContainer();
+ $this->listener = new TestListener();
+ $this->testResult = new TestResult();
+ $this->test = new EmptyTestCase();
+
+ $this->test->setTestResultObject($this->testResult);
+ $this->testResult->addListener($this->listener);
+
+ $this->assertTrue($this->testResult->wasSuccessful(), 'sanity check: empty test results should be considered successful');
+ }
+
+ public function testSuccessOnClose()
+ {
+ $mock = $this->container->mock();
+ $mock->shouldReceive('bar')->once();
+ $mock->bar();
+
+ // This is what MockeryPHPUnitIntegration and MockeryTestCase trait
+ // will do. We intentionally call the static close method.
+ $this->test->addToAssertionCount($this->container->mockery_getExpectationCount());
+ \Mockery::close();
+
+ $this->listener->endTest($this->test, 0);
+ $this->assertTrue($this->testResult->wasSuccessful(), 'expected test result to indicate success');
+ }
+
+ public function testFailureOnMissingClose()
+ {
+ $mock = $this->container->mock();
+ $mock->shouldReceive('bar')->once();
+
+ $this->listener->endTest($this->test, 0);
+ $this->assertFalse($this->testResult->wasSuccessful(), 'expected test result to indicate failure');
+
+ // Satisfy the expectation and close the global container now so we
+ // don't taint the environment.
+ $mock->bar();
+ \Mockery::close();
+ }
+
+ public function testMockeryIsAddedToBlacklist()
+ {
+ $suite = \Mockery::mock(\PHPUnit\Framework\TestSuite::class);
+
+ $this->assertArrayNotHasKey(\Mockery::class, \PHPUnit\Util\Blacklist::$blacklistedClassNames);
+ $this->listener->startTestSuite($suite);
+ $this->assertSame(1, \PHPUnit\Util\Blacklist::$blacklistedClassNames[\Mockery::class]);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/AdhocTest.php b/vendor/mockery/mockery/tests/Mockery/AdhocTest.php
new file mode 100644
index 000000000..b930c0a46
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/AdhocTest.php
@@ -0,0 +1,119 @@
+container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ }
+
+ public function teardown()
+ {
+ $this->container->mockery_close();
+ }
+
+ public function testSimplestMockCreation()
+ {
+ $m = $this->container->mock('MockeryTest_NameOfExistingClass');
+ $this->assertInstanceOf(MockeryTest_NameOfExistingClass::class, $m);
+ }
+
+ public function testMockeryInterfaceForClass()
+ {
+ $m = $this->container->mock('SplFileInfo');
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $m);
+ }
+
+ public function testMockeryInterfaceForNonExistingClass()
+ {
+ $m = $this->container->mock('ABC_IDontExist');
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $m);
+ }
+
+ public function testMockeryInterfaceForInterface()
+ {
+ $m = $this->container->mock('MockeryTest_NameOfInterface');
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $m);
+ }
+
+ public function testMockeryInterfaceForAbstract()
+ {
+ $m = $this->container->mock('MockeryTest_NameOfAbstract');
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $m);
+ }
+
+ public function testInvalidCountExceptionThrowsRuntimeExceptionOnIllegalComparativeSymbol()
+ {
+ $this->expectException('Mockery\Exception\RuntimeException');
+ $e = new \Mockery\Exception\InvalidCountException;
+ $e->setExpectedCountComparative('X');
+ }
+
+ public function testMockeryConstructAndDestructIsNotCalled()
+ {
+ MockeryTest_NameOfExistingClassWithDestructor::$isDestructorWasCalled = false;
+ // We pass no arguments in constructor, so it's not being called. Then destructor shouldn't be called too.
+ $this->container->mock('MockeryTest_NameOfExistingClassWithDestructor');
+ // Clear references to trigger destructor
+ $this->container->mockery_close();
+ $this->assertFalse(MockeryTest_NameOfExistingClassWithDestructor::$isDestructorWasCalled);
+ }
+
+ public function testMockeryConstructAndDestructIsCalled()
+ {
+ MockeryTest_NameOfExistingClassWithDestructor::$isDestructorWasCalled = false;
+
+ $this->container->mock('MockeryTest_NameOfExistingClassWithDestructor', array());
+ // Clear references to trigger destructor
+ $this->container->mockery_close();
+ $this->assertTrue(MockeryTest_NameOfExistingClassWithDestructor::$isDestructorWasCalled);
+ }
+}
+
+class MockeryTest_NameOfExistingClass
+{
+}
+
+interface MockeryTest_NameOfInterface
+{
+ public function foo();
+}
+
+abstract class MockeryTest_NameOfAbstract
+{
+ abstract public function foo();
+}
+
+class MockeryTest_NameOfExistingClassWithDestructor
+{
+ public static $isDestructorWasCalled = false;
+
+ public function __destruct()
+ {
+ self::$isDestructorWasCalled = true;
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/AllowsExpectsSyntaxTest.php b/vendor/mockery/mockery/tests/Mockery/AllowsExpectsSyntaxTest.php
new file mode 100644
index 000000000..d7492f378
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/AllowsExpectsSyntaxTest.php
@@ -0,0 +1,111 @@
+allows()->foo(123)->andReturns(456);
+
+ $this->assertEquals(456, $stub->foo(123));
+ }
+
+ /** @test */
+ public function allowsCanTakeAnArrayOfCalls()
+ {
+ $stub = m::mock();
+ $stub->allows([
+ "foo" => "bar",
+ "bar" => "baz",
+ ]);
+
+ $this->assertEquals("bar", $stub->foo());
+ $this->assertEquals("baz", $stub->bar());
+ }
+
+ /** @test */
+ public function allowsCanTakeAString()
+ {
+ $stub = m::mock();
+ $stub->allows("foo")->andReturns("bar");
+ $this->assertEquals("bar", $stub->foo());
+ }
+
+ /** @test */
+ public function expects_can_optionally_match_on_any_arguments()
+ {
+ $mock = m::mock();
+ $mock->allows()->foo()->withAnyArgs()->andReturns(123);
+
+ $this->assertEquals(123, $mock->foo(456, 789));
+ }
+
+ /** @test */
+ public function expects_can_take_a_string()
+ {
+ $mock = m::mock();
+ $mock->expects("foo")->andReturns(123);
+
+ $this->assertEquals(123, $mock->foo(456, 789));
+ }
+
+ /** @test */
+ public function expectsSetsUpExpectationOfOneCall()
+ {
+ $mock = m::mock();
+ $mock->expects()->foo(123);
+
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ m::close();
+ }
+
+ /** @test */
+ public function callVerificationCountCanBeOverridenAfterExpectsThrowsExceptionWhenIncorrectNumberOfCalls()
+ {
+ $mock = m::mock();
+ $mock->expects()->foo(123)->twice();
+
+ $mock->foo(123);
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ m::close();
+ }
+
+ /** @test */
+ public function callVerificationCountCanBeOverridenAfterExpects()
+ {
+ $mock = m::mock();
+ $mock->expects()->foo(123)->twice();
+
+ $mock->foo(123);
+ $mock->foo(123);
+
+ m::close();
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/CallableSpyTest.php b/vendor/mockery/mockery/tests/Mockery/CallableSpyTest.php
new file mode 100644
index 000000000..013e5b11b
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/CallableSpyTest.php
@@ -0,0 +1,199 @@
+shouldHaveBeenCalled();
+ }
+
+ /** @test */
+ public function it_throws_if_the_callable_was_not_called_at_all()
+ {
+ $spy = spy(function() {});
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldHaveBeenCalled();
+ }
+
+ /** @test */
+ public function it_throws_if_there_were_no_arguments_but_we_expected_some()
+ {
+ $spy = spy(function() {});
+
+ $spy();
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldHaveBeenCalled()->with(123, 546);
+ }
+
+ /** @test */
+ public function it_throws_if_the_arguments_do_not_match()
+ {
+ $spy = spy(function() {});
+
+ $spy(123);
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldHaveBeenCalled()->with(123, 546);
+ }
+
+ /** @test */
+ public function it_verifies_the_closure_was_not_called()
+ {
+ $spy = spy(function () {});
+
+ $spy->shouldNotHaveBeenCalled();
+ }
+
+ /** @test */
+ public function it_throws_if_it_was_called_when_we_expected_it_to_not_have_been_called()
+ {
+ $spy = spy(function () {});
+
+ $spy();
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldNotHaveBeenCalled();
+ }
+
+ /** @test */
+ public function it_verifies_it_was_not_called_with_some_particular_arguments_when_called_with_no_args()
+ {
+ $spy = spy(function () {});
+
+ $spy();
+
+ $spy->shouldNotHaveBeenCalled([123]);
+ }
+
+ /** @test */
+ public function it_verifies_it_was_not_called_with_some_particular_arguments_when_called_with_different_args()
+ {
+ $spy = spy(function () {});
+
+ $spy(456);
+
+ $spy->shouldNotHaveBeenCalled([123]);
+ }
+
+ /** @test */
+ public function it_throws_if_it_was_called_with_the_args_we_were_not_expecting()
+ {
+ $spy = spy(function () {});
+
+ $spy(123);
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldNotHaveBeenCalled([123]);
+ }
+
+ /** @test */
+ public function it_can_verify_it_was_called_a_number_of_times()
+ {
+ $spy = spy(function () {});
+
+ $spy();
+ $spy();
+
+ $spy->shouldHaveBeenCalled()->twice();
+ }
+
+ /** @test */
+ public function it_can_verify_it_was_called_a_number_of_times_with_particular_arguments()
+ {
+ $spy = spy(function () {});
+
+ $spy(123);
+ $spy(123);
+
+ $spy->shouldHaveBeenCalled()->with(123)->twice();
+ }
+
+ /** @test */
+ public function it_throws_if_it_was_called_less_than_the_number_of_times_we_expected()
+ {
+ $spy = spy(function () {});
+
+ $spy();
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldHaveBeenCalled()->twice();
+ }
+
+ /** @test */
+ public function it_throws_if_it_was_called_less_than_the_number_of_times_we_expected_with_particular_arguments()
+ {
+ $spy = spy(function () {});
+
+ $spy();
+ $spy(123);
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldHaveBeenCalled()->with(123)->twice();
+ }
+
+ /** @test */
+ public function it_throws_if_it_was_called_more_than_the_number_of_times_we_expected()
+ {
+ $spy = spy(function () {});
+
+ $spy();
+ $spy();
+ $spy();
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldHaveBeenCalled()->twice();
+ }
+
+ /** @test */
+ public function it_throws_if_it_was_called_more_than_the_number_of_times_we_expected_with_particular_arguments()
+ {
+ $spy = spy(function () {});
+
+ $spy(123);
+ $spy(123);
+ $spy(123);
+
+ $this->expectException(InvalidCountException::class);
+ $spy->shouldHaveBeenCalled()->with(123)->twice();
+ }
+
+ /** @test */
+ public function it_acts_as_partial()
+ {
+ $spy = spy(function ($number) { return $number + 1;});
+
+ $this->assertEquals(124, $spy(123));
+ $spy->shouldHaveBeenCalled();
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/ContainerTest.php b/vendor/mockery/mockery/tests/Mockery/ContainerTest.php
new file mode 100644
index 000000000..446d9e3f2
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/ContainerTest.php
@@ -0,0 +1,1825 @@
+shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals('bar', $m->foo());
+ }
+
+ public function testGetKeyOfDemeterMockShouldReturnKeyWhenMatchingMock()
+ {
+ $m = mock();
+ $m->shouldReceive('foo->bar');
+ $this->assertRegExp(
+ '/Mockery_(\d+)__demeter_([0-9a-f]+)_foo/',
+ Mockery::getContainer()->getKeyOfDemeterMockFor('foo', get_class($m))
+ );
+ }
+ public function testGetKeyOfDemeterMockShouldReturnNullWhenNoMatchingMock()
+ {
+ $method = 'unknownMethod';
+ $this->assertNull(Mockery::getContainer()->getKeyOfDemeterMockFor($method, 'any'));
+
+ $m = mock();
+ $m->shouldReceive('method');
+ $this->assertNull(Mockery::getContainer()->getKeyOfDemeterMockFor($method, get_class($m)));
+
+ $m->shouldReceive('foo->bar');
+ $this->assertNull(Mockery::getContainer()->getKeyOfDemeterMockFor($method, get_class($m)));
+ }
+
+
+ public function testNamedMocksAddNameToExceptions()
+ {
+ $m = mock('Foo');
+ $m->shouldReceive('foo')->with(1)->andReturn('bar');
+ try {
+ $m->foo();
+ } catch (\Mockery\Exception $e) {
+ $this->assertTrue((bool) preg_match("/Foo/", $e->getMessage()));
+ }
+ }
+
+ public function testSimpleMockWithArrayDefs()
+ {
+ $m = mock(array('foo'=>1, 'bar'=>2));
+ $this->assertEquals(1, $m->foo());
+ $this->assertEquals(2, $m->bar());
+ }
+
+ public function testSimpleMockWithArrayDefsCanBeOverridden()
+ {
+ // eg. In shared test setup
+ $m = mock(array('foo' => 1, 'bar' => 2));
+
+ // and then overridden in one test
+ $m->shouldReceive('foo')->with('baz')->once()->andReturn(2);
+ $m->shouldReceive('bar')->with('baz')->once()->andReturn(42);
+
+ $this->assertEquals(2, $m->foo('baz'));
+ $this->assertEquals(42, $m->bar('baz'));
+ }
+
+ public function testNamedMockWithArrayDefs()
+ {
+ $m = mock('Foo', array('foo'=>1, 'bar'=>2));
+ $this->assertEquals(1, $m->foo());
+ $this->assertEquals(2, $m->bar());
+ try {
+ $m->f();
+ } catch (BadMethodCallException $e) {
+ $this->assertTrue((bool) preg_match("/Foo/", $e->getMessage()));
+ }
+ }
+
+ public function testNamedMockWithArrayDefsCanBeOverridden()
+ {
+ // eg. In shared test setup
+ $m = mock('Foo', array('foo' => 1));
+
+ // and then overridden in one test
+ $m->shouldReceive('foo')->with('bar')->once()->andReturn(2);
+
+ $this->assertEquals(2, $m->foo('bar'));
+
+ try {
+ $m->f();
+ } catch (BadMethodCallException $e) {
+ $this->assertTrue((bool) preg_match("/Foo/", $e->getMessage()));
+ }
+ }
+
+ public function testNamedMockMultipleInterfaces()
+ {
+ $m = mock('stdClass, ArrayAccess, Countable', array('foo'=>1, 'bar'=>2));
+ $this->assertEquals(1, $m->foo());
+ $this->assertEquals(2, $m->bar());
+ try {
+ $m->f();
+ } catch (BadMethodCallException $e) {
+ $this->assertTrue((bool) preg_match("/stdClass/", $e->getMessage()));
+ $this->assertTrue((bool) preg_match("/ArrayAccess/", $e->getMessage()));
+ $this->assertTrue((bool) preg_match("/Countable/", $e->getMessage()));
+ }
+ }
+
+ public function testNamedMockWithConstructorArgs()
+ {
+ $m = mock("MockeryTest_ClassConstructor2[foo]", array($param1 = new stdClass()));
+ $m->shouldReceive("foo")->andReturn(123);
+ $this->assertEquals(123, $m->foo());
+ $this->assertEquals($param1, $m->getParam1());
+ }
+
+ public function testNamedMockWithConstructorArgsAndArrayDefs()
+ {
+ $m = mock(
+ "MockeryTest_ClassConstructor2[foo]",
+ array($param1 = new stdClass()),
+ array("foo" => 123)
+ );
+ $this->assertEquals(123, $m->foo());
+ $this->assertEquals($param1, $m->getParam1());
+ }
+
+ public function testNamedMockWithConstructorArgsWithInternalCallToMockedMethod()
+ {
+ $m = mock("MockeryTest_ClassConstructor2[foo]", array($param1 = new stdClass()));
+ $m->shouldReceive("foo")->andReturn(123);
+ $this->assertEquals(123, $m->bar());
+ }
+
+ public function testNamedMockWithConstructorArgsButNoQuickDefsShouldLeaveConstructorIntact()
+ {
+ $m = mock("MockeryTest_ClassConstructor2", array($param1 = new stdClass()));
+ $m->makePartial();
+ $this->assertEquals($param1, $m->getParam1());
+ }
+
+ public function testNamedMockWithMakePartial()
+ {
+ $m = mock("MockeryTest_ClassConstructor2", array($param1 = new stdClass()));
+ $m->makePartial();
+ $this->assertEquals('foo', $m->bar());
+ $m->shouldReceive("bar")->andReturn(123);
+ $this->assertEquals(123, $m->bar());
+ }
+
+ /**
+ * @expectedException BadMethodCallException
+ */
+ public function testNamedMockWithMakePartialThrowsIfNotAvailable()
+ {
+ $m = mock("MockeryTest_ClassConstructor2", array($param1 = new stdClass()));
+ $m->makePartial();
+ $m->foorbar123();
+ $m->mockery_verify();
+ }
+
+ public function testMockingAKnownConcreteClassSoMockInheritsClassType()
+ {
+ $m = mock('stdClass');
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals('bar', $m->foo());
+ $this->assertInstanceOf(stdClass::class, $m);
+ }
+
+ public function testMockingAKnownUserClassSoMockInheritsClassType()
+ {
+ $m = mock('MockeryTest_TestInheritedType');
+ $this->assertInstanceOf(MockeryTest_TestInheritedType::class, $m);
+ }
+
+ public function testMockingAConcreteObjectCreatesAPartialWithoutError()
+ {
+ $m = mock(new stdClass);
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals('bar', $m->foo());
+ $this->assertInstanceOf(stdClass::class, $m);
+ }
+
+ public function testCreatingAPartialAllowsDynamicExpectationsAndPassesThroughUnexpectedMethods()
+ {
+ $m = mock(new MockeryTestFoo);
+ $m->shouldReceive('bar')->andReturn('bar');
+ $this->assertEquals('bar', $m->bar());
+ $this->assertEquals('foo', $m->foo());
+ $this->assertInstanceOf(MockeryTestFoo::class, $m);
+ }
+
+ public function testCreatingAPartialAllowsExpectationsToInterceptCallsToImplementedMethods()
+ {
+ $m = mock(new MockeryTestFoo2);
+ $m->shouldReceive('bar')->andReturn('baz');
+ $this->assertEquals('baz', $m->bar());
+ $this->assertEquals('foo', $m->foo());
+ $this->assertInstanceOf(MockeryTestFoo2::class, $m);
+ }
+
+ public function testBlockForwardingToPartialObject()
+ {
+ $m = mock(new MockeryTestBar1, array('foo'=>1, Mockery\Container::BLOCKS => array('method1')));
+ $this->assertSame($m, $m->method1());
+ }
+
+ public function testPartialWithArrayDefs()
+ {
+ $m = mock(new MockeryTestBar1, array('foo'=>1, Mockery\Container::BLOCKS => array('method1')));
+ $this->assertEquals(1, $m->foo());
+ }
+
+ public function testPassingClosureAsFinalParameterUsedToDefineExpectations()
+ {
+ $m = mock('foo', function ($m) {
+ $m->shouldReceive('foo')->once()->andReturn('bar');
+ });
+ $this->assertEquals('bar', $m->foo());
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testMockingAKnownConcreteFinalClassThrowsErrors_OnlyPartialMocksCanMockFinalElements()
+ {
+ $m = mock('MockeryFoo3');
+ }
+
+ public function testMockingAKnownConcreteClassWithFinalMethodsThrowsNoException()
+ {
+ $this->assertInstanceOf(MockInterface::class, mock('MockeryFoo4'));
+ }
+
+ /**
+ * @group finalclass
+ */
+ public function testFinalClassesCanBePartialMocks()
+ {
+ $m = mock(new MockeryFoo3);
+ $m->shouldReceive('foo')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertNotInstanceOf(MockeryFoo3::class, $m);
+ }
+
+ public function testSplClassWithFinalMethodsCanBeMocked()
+ {
+ $m = mock('SplFileInfo');
+ $m->shouldReceive('foo')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertInstanceOf(SplFileInfo::class, $m);
+ }
+
+ public function testSplClassWithFinalMethodsCanBeMockedMultipleTimes()
+ {
+ mock('SplFileInfo');
+ $m = mock('SplFileInfo');
+ $m->shouldReceive('foo')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertInstanceOf(SplFileInfo::class, $m);
+ }
+
+ public function testClassesWithFinalMethodsCanBeProxyPartialMocks()
+ {
+ $m = mock(new MockeryFoo4);
+ $m->shouldReceive('foo')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertEquals('bar', $m->bar());
+ $this->assertInstanceOf(MockeryFoo4::class, $m);
+ }
+
+ public function testClassesWithFinalMethodsCanBeProperPartialMocks()
+ {
+ $m = mock('MockeryFoo4[bar]');
+ $m->shouldReceive('bar')->andReturn('baz');
+ $this->assertEquals('baz', $m->foo());
+ $this->assertEquals('baz', $m->bar());
+ $this->assertInstanceOf(MockeryFoo4::class, $m);
+ }
+
+ public function testClassesWithFinalMethodsCanBeProperPartialMocksButFinalMethodsNotPartialed()
+ {
+ $m = mock('MockeryFoo4[foo]');
+ $m->shouldReceive('foo')->andReturn('foo');
+ $this->assertEquals('baz', $m->foo()); // partial expectation ignored - will fail callcount assertion
+ $this->assertInstanceOf(MockeryFoo4::class, $m);
+ }
+
+ public function testSplfileinfoClassMockPassesUserExpectations()
+ {
+ $file = mock('SplFileInfo[getFilename,getPathname,getExtension,getMTime]', array(__FILE__));
+ $file->shouldReceive('getFilename')->once()->andReturn('foo');
+ $file->shouldReceive('getPathname')->once()->andReturn('path/to/foo');
+ $file->shouldReceive('getExtension')->once()->andReturn('css');
+ $file->shouldReceive('getMTime')->once()->andReturn(time());
+
+ // not sure what this test is for, maybe something special about
+ // SplFileInfo
+ $this->assertEquals('foo', $file->getFilename());
+ $this->assertEquals('path/to/foo', $file->getPathname());
+ $this->assertEquals('css', $file->getExtension());
+ $this->assertInternalType('int', $file->getMTime());
+ }
+
+ public function testCanMockInterface()
+ {
+ $m = mock('MockeryTest_Interface');
+ $this->assertInstanceOf(MockeryTest_Interface::class, $m);
+ }
+
+ public function testCanMockSpl()
+ {
+ $m = mock('\\SplFixedArray');
+ $this->assertInstanceOf(SplFixedArray::class, $m);
+ }
+
+ public function testCanMockInterfaceWithAbstractMethod()
+ {
+ $m = mock('MockeryTest_InterfaceWithAbstractMethod');
+ $this->assertInstanceOf(MockeryTest_InterfaceWithAbstractMethod::class, $m);
+ $m->shouldReceive('foo')->andReturn(1);
+ $this->assertEquals(1, $m->foo());
+ }
+
+ public function testCanMockAbstractWithAbstractProtectedMethod()
+ {
+ $m = mock('MockeryTest_AbstractWithAbstractMethod');
+ $this->assertInstanceOf(MockeryTest_AbstractWithAbstractMethod::class, $m);
+ }
+
+ public function testCanMockInterfaceWithPublicStaticMethod()
+ {
+ $m = mock('MockeryTest_InterfaceWithPublicStaticMethod');
+ $this->assertInstanceOf(MockeryTest_InterfaceWithPublicStaticMethod::class, $m);
+ }
+
+ public function testCanMockClassWithConstructor()
+ {
+ $m = mock('MockeryTest_ClassConstructor');
+ $this->assertInstanceOf(MockeryTest_ClassConstructor::class, $m);
+ }
+
+ public function testCanMockClassWithConstructorNeedingClassArgs()
+ {
+ $m = mock('MockeryTest_ClassConstructor2');
+ $this->assertInstanceOf(MockeryTest_ClassConstructor2::class, $m);
+ }
+
+ /**
+ * @group partial
+ */
+ public function testCanPartiallyMockANormalClass()
+ {
+ $m = mock('MockeryTest_PartialNormalClass[foo]');
+ $this->assertInstanceOf(MockeryTest_PartialNormalClass::class, $m);
+ $m->shouldReceive('foo')->andReturn('cba');
+ $this->assertEquals('abc', $m->bar());
+ $this->assertEquals('cba', $m->foo());
+ }
+
+ /**
+ * @group partial
+ */
+ public function testCanPartiallyMockAnAbstractClass()
+ {
+ $m = mock('MockeryTest_PartialAbstractClass[foo]');
+ $this->assertInstanceOf(MockeryTest_PartialAbstractClass::class, $m);
+ $m->shouldReceive('foo')->andReturn('cba');
+ $this->assertEquals('abc', $m->bar());
+ $this->assertEquals('cba', $m->foo());
+ }
+
+ /**
+ * @group partial
+ */
+ public function testCanPartiallyMockANormalClassWith2Methods()
+ {
+ $m = mock('MockeryTest_PartialNormalClass2[foo, baz]');
+ $this->assertInstanceOf(MockeryTest_PartialNormalClass2::class, $m);
+ $m->shouldReceive('foo')->andReturn('cba');
+ $m->shouldReceive('baz')->andReturn('cba');
+ $this->assertEquals('abc', $m->bar());
+ $this->assertEquals('cba', $m->foo());
+ $this->assertEquals('cba', $m->baz());
+ }
+
+ /**
+ * @group partial
+ */
+ public function testCanPartiallyMockAnAbstractClassWith2Methods()
+ {
+ $m = mock('MockeryTest_PartialAbstractClass2[foo,baz]');
+ $this->assertInstanceOf(MockeryTest_PartialAbstractClass2::class, $m);
+ $m->shouldReceive('foo')->andReturn('cba');
+ $m->shouldReceive('baz')->andReturn('cba');
+ $this->assertEquals('abc', $m->bar());
+ $this->assertEquals('cba', $m->foo());
+ $this->assertEquals('cba', $m->baz());
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ * @group partial
+ */
+ public function testThrowsExceptionIfSettingExpectationForNonMockedMethodOfPartialMock()
+ {
+ $this->markTestSkipped('For now...');
+ $m = mock('MockeryTest_PartialNormalClass[foo]');
+ $this->assertInstanceOf(MockeryTest_PartialNormalClass::class, $m);
+ $m->shouldReceive('bar')->andReturn('cba');
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ * @group partial
+ */
+ public function testThrowsExceptionIfClassOrInterfaceForPartialMockDoesNotExist()
+ {
+ $m = mock('MockeryTest_PartialNormalClassXYZ[foo]');
+ }
+
+ /**
+ * @group issue/4
+ */
+ public function testCanMockClassContainingMagicCallMethod()
+ {
+ $m = mock('MockeryTest_Call1');
+ $this->assertInstanceOf(MockeryTest_Call1::class, $m);
+ }
+
+ /**
+ * @group issue/4
+ */
+ public function testCanMockClassContainingMagicCallMethodWithoutTypeHinting()
+ {
+ $m = mock('MockeryTest_Call2');
+ $this->assertInstanceOf(MockeryTest_Call2::class, $m);
+ }
+
+ /**
+ * @group issue/14
+ */
+ public function testCanMockClassContainingAPublicWakeupMethod()
+ {
+ $m = mock('MockeryTest_Wakeup1');
+ $this->assertInstanceOf(MockeryTest_Wakeup1::class, $m);
+ }
+
+ /**
+ * @group issue/18
+ */
+ public function testCanMockClassUsingMagicCallMethodsInPlaceOfNormalMethods()
+ {
+ $m = Mockery::mock('Gateway');
+ $m->shouldReceive('iDoSomethingReallyCoolHere');
+ $m->iDoSomethingReallyCoolHere();
+ }
+
+ /**
+ * @group issue/18
+ */
+ public function testCanPartialMockObjectUsingMagicCallMethodsInPlaceOfNormalMethods()
+ {
+ $m = Mockery::mock(new Gateway);
+ $m->shouldReceive('iDoSomethingReallyCoolHere');
+ $m->iDoSomethingReallyCoolHere();
+ }
+
+ /**
+ * @group issue/13
+ */
+ public function testCanMockClassWhereMethodHasReferencedParameter()
+ {
+ $this->assertInstanceOf(MockInterface::class, Mockery::mock(new MockeryTest_MethodParamRef));
+ }
+
+ /**
+ * @group issue/13
+ */
+ public function testCanPartiallyMockObjectWhereMethodHasReferencedParameter()
+ {
+ $this->assertInstanceOf(MockInterface::class, Mockery::mock(new MockeryTest_MethodParamRef2));
+ }
+
+ /**
+ * @group issue/11
+ */
+ public function testMockingAKnownConcreteClassCanBeGrantedAnArbitraryClassType()
+ {
+ $m = mock('alias:MyNamespace\MyClass');
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals('bar', $m->foo());
+ $this->assertInstanceOf(MyNamespace\MyClass::class, $m);
+ }
+
+ /**
+ * @group issue/15
+ */
+ public function testCanMockMultipleInterfaces()
+ {
+ $m = mock('MockeryTest_Interface1, MockeryTest_Interface2');
+ $this->assertInstanceOf(MockeryTest_Interface1::class, $m);
+ $this->assertInstanceOf(MockeryTest_Interface2::class, $m);
+ }
+
+ /**
+ */
+ public function testCanMockMultipleInterfacesThatMayNotExist()
+ {
+ $m = mock('NonExistingClass, MockeryTest_Interface1, MockeryTest_Interface2, \Some\Thing\That\Doesnt\Exist');
+ $this->assertInstanceOf(MockeryTest_Interface1::class, $m);
+ $this->assertInstanceOf(MockeryTest_Interface2::class, $m);
+ $this->assertInstanceOf(\Some\Thing\That\Doesnt\Exist::class, $m);
+ }
+
+ /**
+ * @group issue/15
+ */
+ public function testCanMockClassAndApplyMultipleInterfaces()
+ {
+ $m = mock('MockeryTestFoo, MockeryTest_Interface1, MockeryTest_Interface2');
+ $this->assertInstanceOf(MockeryTestFoo::class, $m);
+ $this->assertInstanceOf(MockeryTest_Interface1::class, $m);
+ $this->assertInstanceOf(MockeryTest_Interface2::class, $m);
+ }
+
+ /**
+ * @group issue/7
+ *
+ * Noted: We could complicate internally, but a blind class is better built
+ * with a real class noted up front (stdClass is a perfect choice it is
+ * behaviourless). Fine, it's a muddle - but we need to draw a line somewhere.
+ */
+ public function testCanMockStaticMethods()
+ {
+ $m = mock('alias:MyNamespace\MyClass2');
+ $m->shouldReceive('staticFoo')->andReturn('bar');
+ $this->assertEquals('bar', \MyNameSpace\MyClass2::staticFoo());
+ }
+
+ /**
+ * @group issue/7
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testMockedStaticMethodsObeyMethodCounting()
+ {
+ $m = mock('alias:MyNamespace\MyClass3');
+ $m->shouldReceive('staticFoo')->once()->andReturn('bar');
+ Mockery::close();
+ }
+
+ /**
+ */
+ public function testMockedStaticThrowsExceptionWhenMethodDoesNotExist()
+ {
+ $m = mock('alias:MyNamespace\StaticNoMethod');
+ try {
+ MyNameSpace\StaticNoMethod::staticFoo();
+ } catch (BadMethodCallException $e) {
+ // Mockery + PHPUnit has a fail safe for tests swallowing our
+ // exceptions
+ $e->dismiss();
+ return;
+ }
+
+ $this->fail('Exception was not thrown');
+ }
+
+ /**
+ * @group issue/17
+ */
+ public function testMockingAllowsPublicPropertyStubbingOnRealClass()
+ {
+ $m = mock('MockeryTestFoo');
+ $m->foo = 'bar';
+ $this->assertEquals('bar', $m->foo);
+ //$this->assertArrayHasKey('foo', $m->mockery_getMockableProperties());
+ }
+
+ /**
+ * @group issue/17
+ */
+ public function testMockingAllowsPublicPropertyStubbingOnNamedMock()
+ {
+ $m = mock('Foo');
+ $m->foo = 'bar';
+ $this->assertEquals('bar', $m->foo);
+ //$this->assertArrayHasKey('foo', $m->mockery_getMockableProperties());
+ }
+
+ /**
+ * @group issue/17
+ */
+ public function testMockingAllowsPublicPropertyStubbingOnPartials()
+ {
+ $m = mock(new stdClass);
+ $m->foo = 'bar';
+ $this->assertEquals('bar', $m->foo);
+ //$this->assertArrayHasKey('foo', $m->mockery_getMockableProperties());
+ }
+
+ /**
+ * @group issue/17
+ */
+ public function testMockingDoesNotStubNonStubbedPropertiesOnPartials()
+ {
+ $m = mock(new MockeryTest_ExistingProperty);
+ $this->assertEquals('bar', $m->foo);
+ $this->assertArrayNotHasKey('foo', $m->mockery_getMockableProperties());
+ }
+
+ public function testCreationOfInstanceMock()
+ {
+ $m = mock('overload:MyNamespace\MyClass4');
+ $this->assertInstanceOf(MyNamespace\MyClass4::class, $m);
+ }
+
+ public function testInstantiationOfInstanceMock()
+ {
+ $m = mock('overload:MyNamespace\MyClass5');
+ $instance = new MyNamespace\MyClass5;
+ $this->assertInstanceOf(MyNamespace\MyClass5::class, $instance);
+ }
+
+ public function testInstantiationOfInstanceMockImportsExpectations()
+ {
+ $m = mock('overload:MyNamespace\MyClass6');
+ $m->shouldReceive('foo')->andReturn('bar');
+ $instance = new MyNamespace\MyClass6;
+ $this->assertEquals('bar', $instance->foo());
+ }
+
+ public function testInstantiationOfInstanceMockImportsDefaultExpectations()
+ {
+ $m = mock('overload:MyNamespace\MyClass6');
+ $m->shouldReceive('foo')->andReturn('bar')->byDefault();
+ $instance = new MyNamespace\MyClass6;
+
+ $this->assertEquals('bar', $instance->foo());
+ }
+
+ public function testInstantiationOfInstanceMockImportsDefaultExpectationsInTheCorrectOrder()
+ {
+ $m = mock('overload:MyNamespace\MyClass6');
+ $m->shouldReceive('foo')->andReturn(1)->byDefault();
+ $m->shouldReceive('foo')->andReturn(2)->byDefault();
+ $m->shouldReceive('foo')->andReturn(3)->byDefault();
+ $instance = new MyNamespace\MyClass6;
+
+ $this->assertEquals(3, $instance->foo());
+ }
+
+ public function testInstantiationOfInstanceMocksIgnoresVerificationOfOriginMock()
+ {
+ $m = mock('overload:MyNamespace\MyClass7');
+ $m->shouldReceive('foo')->once()->andReturn('bar');
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testInstantiationOfInstanceMocksAddsThemToContainerForVerification()
+ {
+ $m = mock('overload:MyNamespace\MyClass8');
+ $m->shouldReceive('foo')->once();
+ $instance = new MyNamespace\MyClass8;
+ Mockery::close();
+ }
+
+ public function testInstantiationOfInstanceMocksDoesNotHaveCountValidatorCrossover()
+ {
+ $m = mock('overload:MyNamespace\MyClass9');
+ $m->shouldReceive('foo')->once();
+ $instance1 = new MyNamespace\MyClass9;
+ $instance2 = new MyNamespace\MyClass9;
+ $instance1->foo();
+ $instance2->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testInstantiationOfInstanceMocksDoesNotHaveCountValidatorCrossover2()
+ {
+ $m = mock('overload:MyNamespace\MyClass10');
+ $m->shouldReceive('foo')->once();
+ $instance1 = new MyNamespace\MyClass10;
+ $instance2 = new MyNamespace\MyClass10;
+ $instance1->foo();
+ Mockery::close();
+ }
+
+ public function testCreationOfInstanceMockWithFullyQualifiedName()
+ {
+ $m = mock('overload:\MyNamespace\MyClass11');
+ $this->assertInstanceOf(MyNamespace\MyClass11::class, $m);
+ }
+
+ public function testInstanceMocksShouldIgnoreMissing()
+ {
+ $m = mock('overload:MyNamespace\MyClass12');
+ $m->shouldIgnoreMissing();
+
+ $instance = new MyNamespace\MyClass12();
+ $this->assertNull($instance->foo());
+ }
+
+ /**
+ * @group issue/451
+ */
+ public function testSettingPropertyOnInstanceMockWillSetItOnActualInstance()
+ {
+ $m = mock('overload:MyNamespace\MyClass13');
+ $m->shouldReceive('foo')->andSet('bar', 'baz');
+ $instance = new MyNamespace\MyClass13;
+ $instance->foo();
+ $this->assertEquals('baz', $m->bar);
+ $this->assertEquals('baz', $instance->bar);
+ }
+
+ public function testInstantiationOfInstanceMockWithConstructorParameterValidation()
+ {
+ $m = mock('overload:MyNamespace\MyClass14');
+ $params = [
+ 'value1' => uniqid('test_')
+ ];
+ $m->shouldReceive('__construct')->with($params);
+
+ new MyNamespace\MyClass14($params);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception\NoMatchingExpectationException
+ */
+ public function testInstantiationOfInstanceMockWithConstructorParameterValidationNegative()
+ {
+ $m = mock('overload:MyNamespace\MyClass15');
+ $params = [
+ 'value1' => uniqid('test_')
+ ];
+ $m->shouldReceive('__construct')->with($params);
+
+ new MyNamespace\MyClass15([]);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessageRegExp /^instanceMock \d{3}$/
+ */
+ public function testInstantiationOfInstanceMockWithConstructorParameterValidationException()
+ {
+ $m = mock('overload:MyNamespace\MyClass16');
+ $m->shouldReceive('__construct')
+ ->andThrow(new \Exception('instanceMock '.rand(100, 999)));
+
+ new MyNamespace\MyClass16();
+ }
+
+ public function testMethodParamsPassedByReferenceHaveReferencePreserved()
+ {
+ $m = mock('MockeryTestRef1');
+ $m->shouldReceive('foo')->with(
+ Mockery::on(function (&$a) {
+ $a += 1;
+ return true;
+ }),
+ Mockery::any()
+ );
+ $a = 1;
+ $b = 1;
+ $m->foo($a, $b);
+ $this->assertEquals(2, $a);
+ $this->assertEquals(1, $b);
+ }
+
+ public function testMethodParamsPassedByReferenceThroughWithArgsHaveReferencePreserved()
+ {
+ $m = mock('MockeryTestRef1');
+ $m->shouldReceive('foo')->withArgs(function (&$a, $b) {
+ $a += 1;
+ $b += 1;
+ return true;
+ });
+ $a = 1;
+ $b = 1;
+ $m->foo($a, $b);
+ $this->assertEquals(2, $a);
+ $this->assertEquals(1, $b);
+ }
+
+ /**
+ * Meant to test the same logic as
+ * testCanOverrideExpectedParametersOfExtensionPHPClassesToPreserveRefs,
+ * but:
+ * - doesn't require an extension
+ * - isn't actually known to be used
+ */
+ public function testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs()
+ {
+ Mockery::getConfiguration()->setInternalClassMethodParamMap(
+ 'DateTime', 'modify', array('&$string')
+ );
+ // @ used to avoid E_STRICT for incompatible signature
+ @$m = mock('DateTime');
+ $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed, remove @ error suppresion to debug");
+ $m->shouldReceive('modify')->with(
+ Mockery::on(function (&$string) {
+ $string = 'foo';
+ return true;
+ })
+ );
+ $data ='bar';
+ $m->modify($data);
+ $this->assertEquals('foo', $data);
+ Mockery::getConfiguration()->resetInternalClassMethodParamMaps();
+ }
+
+ /**
+ * Real world version of
+ * testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs
+ */
+ public function testCanOverrideExpectedParametersOfExtensionPHPClassesToPreserveRefs()
+ {
+ if (!class_exists('MongoCollection', false)) {
+ $this->markTestSkipped('ext/mongo not installed');
+ }
+ Mockery::getConfiguration()->setInternalClassMethodParamMap(
+ 'MongoCollection', 'insert', array('&$data', '$options')
+ );
+ // @ used to avoid E_STRICT for incompatible signature
+ @$m = mock('MongoCollection');
+ $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed, remove @ error suppresion to debug");
+ $m->shouldReceive('insert')->with(
+ Mockery::on(function (&$data) {
+ $data['_id'] = 123;
+ return true;
+ }),
+ Mockery::type('array')
+ );
+ $data = array('a'=>1,'b'=>2);
+ $m->insert($data, array());
+ $this->assertArrayHasKey('_id', $data);
+ $this->assertEquals(123, $data['_id']);
+ Mockery::getConfiguration()->resetInternalClassMethodParamMaps();
+ }
+
+ public function testCanCreateNonOverridenInstanceOfPreviouslyOverridenInternalClasses()
+ {
+ Mockery::getConfiguration()->setInternalClassMethodParamMap(
+ 'DateTime', 'modify', array('&$string')
+ );
+ // @ used to avoid E_STRICT for incompatible signature
+ @$m = mock('DateTime');
+ $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed, remove @ error suppresion to debug");
+ $rc = new ReflectionClass($m);
+ $rm = $rc->getMethod('modify');
+ $params = $rm->getParameters();
+ $this->assertTrue($params[0]->isPassedByReference());
+
+ Mockery::getConfiguration()->resetInternalClassMethodParamMaps();
+
+ $m = mock('DateTime');
+ $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed");
+ $rc = new ReflectionClass($m);
+ $rm = $rc->getMethod('modify');
+ $params = $rm->getParameters();
+ $this->assertFalse($params[0]->isPassedByReference());
+
+ Mockery::getConfiguration()->resetInternalClassMethodParamMaps();
+ }
+
+ /**
+ * @group abstract
+ */
+ public function testCanMockAbstractClassWithAbstractPublicMethod()
+ {
+ $m = mock('MockeryTest_AbstractWithAbstractPublicMethod');
+ $this->assertInstanceOf(MockeryTest_AbstractWithAbstractPublicMethod::class, $m);
+ }
+
+ /**
+ * @issue issue/21
+ */
+ public function testClassDeclaringIssetDoesNotThrowException()
+ {
+ $this->assertInstanceOf(MockInterface::class, mock('MockeryTest_IssetMethod'));
+ }
+
+ /**
+ * @issue issue/21
+ */
+ public function testClassDeclaringUnsetDoesNotThrowException()
+ {
+ $this->assertInstanceOf(MockInterface::class, mock('MockeryTest_UnsetMethod'));
+ }
+
+ /**
+ * @issue issue/35
+ */
+ public function testCallingSelfOnlyReturnsLastMockCreatedOrCurrentMockBeingProgrammedSinceTheyAreOneAndTheSame()
+ {
+ $m = mock('MockeryTestFoo');
+ $this->assertNotInstanceOf(MockeryTestFoo2::class, Mockery::self());
+ //$m = mock('MockeryTestFoo2');
+ //$this->assertInstanceOf(MockeryTestFoo2::class, self());
+ //$m = mock('MockeryTestFoo');
+ //$this->assertNotInstanceOf(MockeryTestFoo2::class, Mockery::self());
+ //$this->assertInstanceOf(MockeryTestFoo::class, Mockery::self());
+ }
+
+ /**
+ * @issue issue/89
+ */
+ public function testCreatingMockOfClassWithExistingToStringMethodDoesntCreateClassWithTwoToStringMethods()
+ {
+ $m = mock('MockeryTest_WithToString'); // this would fatal
+ $m->shouldReceive("__toString")->andReturn('dave');
+ $this->assertEquals("dave", "$m");
+ }
+
+ public function testGetExpectationCount_freshContainer()
+ {
+ $this->assertEquals(0, Mockery::getContainer()->mockery_getExpectationCount());
+ }
+
+ public function testGetExpectationCount_simplestMock()
+ {
+ $m = mock();
+ $m->shouldReceive('foo')->andReturn('bar');
+ $this->assertEquals(1, Mockery::getContainer()->mockery_getExpectationCount());
+ }
+
+ public function testMethodsReturningParamsByReferenceDoesNotErrorOut()
+ {
+ mock('MockeryTest_ReturnByRef');
+ $mock = mock('MockeryTest_ReturnByRef');
+ $mock->shouldReceive("get")->andReturn($var = 123);
+ $this->assertSame($var, $mock->get());
+ }
+
+
+ public function testMockCallableTypeHint()
+ {
+ $this->assertInstanceOf(MockInterface::class, mock('MockeryTest_MockCallableTypeHint'));
+ }
+
+ public function testCanMockClassWithReservedWordMethod()
+ {
+ if (!extension_loaded("redis")) {
+ $this->markTestSkipped("phpredis not installed");
+ }
+
+ mock("Redis");
+ }
+
+ public function testUndeclaredClassIsDeclared()
+ {
+ $this->assertFalse(class_exists("BlahBlah"));
+ $mock = mock("BlahBlah");
+ $this->assertInstanceOf("BlahBlah", $mock);
+ }
+
+ public function testUndeclaredClassWithNamespaceIsDeclared()
+ {
+ $this->assertFalse(class_exists("MyClasses\Blah\BlahBlah"));
+ $mock = mock("MyClasses\Blah\BlahBlah");
+ $this->assertInstanceOf("MyClasses\Blah\BlahBlah", $mock);
+ }
+
+ public function testUndeclaredClassWithNamespaceIncludingLeadingOperatorIsDeclared()
+ {
+ $this->assertFalse(class_exists("\MyClasses\DaveBlah\BlahBlah"));
+ $mock = mock("\MyClasses\DaveBlah\BlahBlah");
+ $this->assertInstanceOf("\MyClasses\DaveBlah\BlahBlah", $mock);
+ }
+
+ public function testMockingPhpredisExtensionClassWorks()
+ {
+ if (!class_exists('Redis')) {
+ $this->markTestSkipped('PHPRedis extension required for this test');
+ }
+ $m = mock('Redis');
+ }
+
+ public function testIssetMappingUsingProxiedPartials_CheckNoExceptionThrown()
+ {
+ $var = mock(new MockeryTestIsset_Bar());
+ $mock = mock(new MockeryTestIsset_Foo($var));
+ $mock->shouldReceive('bar')->once();
+ $mock->bar();
+ Mockery::close();
+
+ $this->assertTrue(true);
+ }
+
+ /**
+ * @group traversable1
+ */
+ public function testCanMockInterfacesExtendingTraversable()
+ {
+ $mock = mock('MockeryTest_InterfaceWithTraversable');
+ $this->assertInstanceOf('MockeryTest_InterfaceWithTraversable', $mock);
+ $this->assertInstanceOf('ArrayAccess', $mock);
+ $this->assertInstanceOf('Countable', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ /**
+ * @group traversable2
+ */
+ public function testCanMockInterfacesAlongsideTraversable()
+ {
+ $mock = mock('stdClass, ArrayAccess, Countable, Traversable');
+ $this->assertInstanceOf('stdClass', $mock);
+ $this->assertInstanceOf('ArrayAccess', $mock);
+ $this->assertInstanceOf('Countable', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ public function testInterfacesCanHaveAssertions()
+ {
+ $m = mock('stdClass, ArrayAccess, Countable, Traversable');
+ $m->shouldReceive('foo')->once();
+ $m->foo();
+ }
+
+ public function testMockingIteratorAggregateDoesNotImplementIterator()
+ {
+ $mock = mock('MockeryTest_ImplementsIteratorAggregate');
+ $this->assertInstanceOf('IteratorAggregate', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ $this->assertNotInstanceOf('Iterator', $mock);
+ }
+
+ public function testMockingInterfaceThatExtendsIteratorDoesNotImplementIterator()
+ {
+ $mock = mock('MockeryTest_InterfaceThatExtendsIterator');
+ $this->assertInstanceOf('Iterator', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ public function testMockingInterfaceThatExtendsIteratorAggregateDoesNotImplementIterator()
+ {
+ $mock = mock('MockeryTest_InterfaceThatExtendsIteratorAggregate');
+ $this->assertInstanceOf('IteratorAggregate', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ $this->assertNotInstanceOf('Iterator', $mock);
+ }
+
+ public function testMockingIteratorAggregateDoesNotImplementIteratorAlongside()
+ {
+ $mock = mock('IteratorAggregate');
+ $this->assertInstanceOf('IteratorAggregate', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ $this->assertNotInstanceOf('Iterator', $mock);
+ }
+
+ public function testMockingIteratorDoesNotImplementIteratorAlongside()
+ {
+ $mock = mock('Iterator');
+ $this->assertInstanceOf('Iterator', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ public function testMockingIteratorDoesNotImplementIterator()
+ {
+ $mock = mock('MockeryTest_ImplementsIterator');
+ $this->assertInstanceOf('Iterator', $mock);
+ $this->assertInstanceOf('Traversable', $mock);
+ }
+
+ public function testMockeryCloseForIllegalIssetFileInclude()
+ {
+ $m = Mockery::mock('StdClass')
+ ->shouldReceive('get')
+ ->andReturn(false)
+ ->getMock();
+ $m->get();
+ Mockery::close();
+
+ // no idea what this test does, adding this as an assertion...
+ $this->assertTrue(true);
+ }
+
+ public function testMockeryShouldDistinguishBetweenConstructorParamsAndClosures()
+ {
+ $obj = new MockeryTestFoo();
+ $this->assertInstanceOf(MockInterface::class, mock('MockeryTest_ClassMultipleConstructorParams[dave]', [
+ &$obj, 'foo'
+ ]));
+ }
+
+ /** @group nette */
+ public function testMockeryShouldNotMockCallstaticMagicMethod()
+ {
+ $this->assertInstanceOf(MockInterface::class, mock('MockeryTest_CallStatic'));
+ }
+
+ /** @group issue/144 */
+ public function testMockeryShouldInterpretEmptyArrayAsConstructorArgs()
+ {
+ $mock = mock("EmptyConstructorTest", array());
+ $this->assertSame(0, $mock->numberOfConstructorArgs);
+ }
+
+ /** @group issue/144 */
+ public function testMockeryShouldCallConstructorByDefaultWhenRequestingPartials()
+ {
+ $mock = mock("EmptyConstructorTest[foo]");
+ $this->assertSame(0, $mock->numberOfConstructorArgs);
+ }
+
+ /** @group issue/158 */
+ public function testMockeryShouldRespectInterfaceWithMethodParamSelf()
+ {
+ $this->assertInstanceOf(MockInterface::class, mock('MockeryTest_InterfaceWithMethodParamSelf'));
+ }
+
+ /** @group issue/162 */
+ public function testMockeryDoesntTryAndMockLowercaseToString()
+ {
+ $this->assertInstanceOf(MockInterface::class, mock('MockeryTest_Lowercase_ToString'));
+ }
+
+ /** @group issue/175 */
+ public function testExistingStaticMethodMocking()
+ {
+ $mock = mock('MockeryTest_PartialStatic[mockMe]');
+
+ $mock->shouldReceive('mockMe')->with(5)->andReturn(10);
+
+ $this->assertEquals(10, $mock::mockMe(5));
+ $this->assertEquals(3, $mock::keepMe(3));
+ }
+
+ /**
+ * @group issue/154
+ * @expectedException InvalidArgumentException
+ * @expectedExceptionMessage protectedMethod() cannot be mocked as it is a protected method and mocking protected methods is not enabled for the currently used mock object.
+ */
+ public function testShouldThrowIfAttemptingToStubProtectedMethod()
+ {
+ $mock = mock('MockeryTest_WithProtectedAndPrivate');
+ $mock->shouldReceive("protectedMethod");
+ }
+
+ /**
+ * @group issue/154
+ * @expectedException InvalidArgumentException
+ * @expectedExceptionMessage privateMethod() cannot be mocked as it is a private method
+ */
+ public function testShouldThrowIfAttemptingToStubPrivateMethod()
+ {
+ $mock = mock('MockeryTest_WithProtectedAndPrivate');
+ $mock->shouldReceive("privateMethod");
+ }
+
+ public function testWakeupMagicIsNotMockedToAllowSerialisationInstanceHack()
+ {
+ $this->assertInstanceOf(\DateTime::class, mock('DateTime'));
+ }
+
+ /**
+ * @group issue/154
+ */
+ public function testCanMockMethodsWithRequiredParamsThatHaveDefaultValues()
+ {
+ $mock = mock('MockeryTest_MethodWithRequiredParamWithDefaultValue');
+ $mock->shouldIgnoreMissing();
+ $this->assertNull($mock->foo(null, 123));
+ }
+
+ /**
+ * @test
+ * @group issue/294
+ * @expectedException Mockery\Exception\RuntimeException
+ * @expectedExceptionMessage Could not load mock DateTime, class already exists
+ */
+ public function testThrowsWhenNamedMockClassExistsAndIsNotMockery()
+ {
+ $builder = new MockConfigurationBuilder();
+ $builder->setName("DateTime");
+ $mock = mock($builder);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(resource(...))
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithResource()
+ {
+ $mock = mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo(fopen('php://memory', 'r'));
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(['myself' => [...]])
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithCircularArray()
+ {
+ $testArray = array();
+ $testArray['myself'] =& $testArray;
+
+ $mock = mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(['a_scalar' => 2, 'an_array' => [...]])
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedArray()
+ {
+ $testArray = array();
+ $testArray['a_scalar'] = 2;
+ $testArray['an_array'] = array(1, 2, 3);
+
+ $mock = mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(['a_scalar' => 2, 'an_object' => object(stdClass)])
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedObject()
+ {
+ $testArray = array();
+ $testArray['a_scalar'] = 2;
+ $testArray['an_object'] = new stdClass();
+
+ $mock = mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(['a_scalar' => 2, 'a_closure' => object(Closure
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedClosure()
+ {
+ $testArray = array();
+ $testArray['a_scalar'] = 2;
+ $testArray['a_closure'] = function () {
+ };
+
+ $mock = mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ * @expectedExceptionMessage MyTestClass::foo(['a_scalar' => 2, 'a_resource' => resource(...)])
+ */
+ public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedResource()
+ {
+ $testArray = array();
+ $testArray['a_scalar'] = 2;
+ $testArray['a_resource'] = fopen('php://memory', 'r');
+
+ $mock = mock('MyTestClass');
+ $mock->shouldReceive('foo')->with(array('yourself' => 21));
+
+ $mock->foo($testArray);
+ }
+
+ public function testExceptionOutputMakesBooleansLookLikeBooleans()
+ {
+ $mock = mock('MyTestClass');
+ $mock->shouldReceive("foo")->with(123);
+
+ $this->expectException(
+ "Mockery\Exception\NoMatchingExpectationException",
+ "MyTestClass::foo(true, false, [0 => true, 1 => false])"
+ );
+
+ $mock->foo(true, false, [true, false]);
+ }
+
+ /**
+ * @test
+ * @group issue/339
+ */
+ public function canMockClassesThatDescendFromInternalClasses()
+ {
+ $mock = mock("MockeryTest_ClassThatDescendsFromInternalClass");
+ $this->assertInstanceOf("DateTime", $mock);
+ }
+
+ /**
+ * @test
+ * @group issue/339
+ */
+ public function canMockClassesThatImplementSerializable()
+ {
+ $mock = mock("MockeryTest_ClassThatImplementsSerializable");
+ $this->assertInstanceOf("Serializable", $mock);
+ }
+
+ /**
+ * @test
+ * @group issue/346
+ */
+ public function canMockInternalClassesThatImplementSerializable()
+ {
+ $mock = mock("ArrayObject");
+ $this->assertInstanceOf("Serializable", $mock);
+ }
+
+ /**
+ * @dataProvider classNameProvider
+ */
+ public function testIsValidClassName($expected, $className)
+ {
+ $container = new \Mockery\Container;
+ $this->assertSame($expected, $container->isValidClassName($className));
+ }
+
+ public function classNameProvider()
+ {
+ return array(
+ array(false, ' '), // just a space
+ array(false, 'ClassName.WithDot'),
+ array(false, '\\\\TooManyBackSlashes'),
+ array(true, 'Foo'),
+ array(true, '\\Foo\\Bar'),
+ );
+ }
+}
+
+class MockeryTest_CallStatic
+{
+ public static function __callStatic($method, $args)
+ {
+ }
+}
+
+class MockeryTest_ClassMultipleConstructorParams
+{
+ public function __construct($a, $b)
+ {
+ }
+
+ public function dave()
+ {
+ }
+}
+
+interface MockeryTest_InterfaceWithTraversable extends ArrayAccess, Traversable, Countable
+{
+ public function self();
+}
+
+class MockeryTestIsset_Bar
+{
+ public function doSomething()
+ {
+ }
+}
+
+class MockeryTestIsset_Foo
+{
+ private $var;
+
+ public function __construct($var)
+ {
+ $this->var = $var;
+ }
+
+ public function __get($name)
+ {
+ $this->var->doSomething();
+ }
+
+ public function __isset($name)
+ {
+ return (bool) strlen($this->__get($name));
+ }
+}
+
+class MockeryTest_IssetMethod
+{
+ protected $_properties = array();
+
+ public function __construct()
+ {
+ }
+
+ public function __isset($property)
+ {
+ return isset($this->_properties[$property]);
+ }
+}
+
+class MockeryTest_UnsetMethod
+{
+ protected $_properties = array();
+
+ public function __construct()
+ {
+ }
+
+ public function __unset($property)
+ {
+ unset($this->_properties[$property]);
+ }
+}
+
+class MockeryTestFoo
+{
+ public function foo()
+ {
+ return 'foo';
+ }
+}
+
+class MockeryTestFoo2
+{
+ public function foo()
+ {
+ return 'foo';
+ }
+
+ public function bar()
+ {
+ return 'bar';
+ }
+}
+
+final class MockeryFoo3
+{
+ public function foo()
+ {
+ return 'baz';
+ }
+}
+
+class MockeryFoo4
+{
+ final public function foo()
+ {
+ return 'baz';
+ }
+
+ public function bar()
+ {
+ return 'bar';
+ }
+}
+
+interface MockeryTest_Interface
+{
+}
+interface MockeryTest_Interface1
+{
+}
+interface MockeryTest_Interface2
+{
+}
+
+interface MockeryTest_InterfaceWithAbstractMethod
+{
+ public function set();
+}
+
+interface MockeryTest_InterfaceWithPublicStaticMethod
+{
+ public static function self();
+}
+
+abstract class MockeryTest_AbstractWithAbstractMethod
+{
+ abstract protected function set();
+}
+
+class MockeryTest_WithProtectedAndPrivate
+{
+ protected function protectedMethod()
+ {
+ }
+
+ private function privateMethod()
+ {
+ }
+}
+
+class MockeryTest_ClassConstructor
+{
+ public function __construct($param1)
+ {
+ }
+}
+
+class MockeryTest_ClassConstructor2
+{
+ protected $param1;
+
+ public function __construct(stdClass $param1)
+ {
+ $this->param1 = $param1;
+ }
+
+ public function getParam1()
+ {
+ return $this->param1;
+ }
+
+ public function foo()
+ {
+ return 'foo';
+ }
+
+ public function bar()
+ {
+ return $this->foo();
+ }
+}
+
+class MockeryTest_Call1
+{
+ public function __call($method, array $params)
+ {
+ }
+}
+
+class MockeryTest_Call2
+{
+ public function __call($method, $params)
+ {
+ }
+}
+
+class MockeryTest_Wakeup1
+{
+ public function __construct()
+ {
+ }
+
+ public function __wakeup()
+ {
+ }
+}
+
+class MockeryTest_ExistingProperty
+{
+ public $foo = 'bar';
+}
+
+abstract class MockeryTest_AbstractWithAbstractPublicMethod
+{
+ abstract public function foo($a, $b);
+}
+
+// issue/18
+class SoCool
+{
+ public function iDoSomethingReallyCoolHere()
+ {
+ return 3;
+ }
+}
+
+class Gateway
+{
+ public function __call($method, $args)
+ {
+ $m = new SoCool();
+ return call_user_func_array(array($m, $method), $args);
+ }
+}
+
+class MockeryTestBar1
+{
+ public function method1()
+ {
+ return $this;
+ }
+}
+
+class MockeryTest_ReturnByRef
+{
+ public $i = 0;
+
+ public function &get()
+ {
+ return $this->$i;
+ }
+}
+
+class MockeryTest_MethodParamRef
+{
+ public function method1(&$foo)
+ {
+ return true;
+ }
+}
+class MockeryTest_MethodParamRef2
+{
+ public function method1(&$foo)
+ {
+ return true;
+ }
+}
+class MockeryTestRef1
+{
+ public function foo(&$a, $b)
+ {
+ }
+}
+
+class MockeryTest_PartialNormalClass
+{
+ public function foo()
+ {
+ return 'abc';
+ }
+
+ public function bar()
+ {
+ return 'abc';
+ }
+}
+
+abstract class MockeryTest_PartialAbstractClass
+{
+ abstract public function foo();
+
+ public function bar()
+ {
+ return 'abc';
+ }
+}
+
+class MockeryTest_PartialNormalClass2
+{
+ public function foo()
+ {
+ return 'abc';
+ }
+
+ public function bar()
+ {
+ return 'abc';
+ }
+
+ public function baz()
+ {
+ return 'abc';
+ }
+}
+
+abstract class MockeryTest_PartialAbstractClass2
+{
+ abstract public function foo();
+
+ public function bar()
+ {
+ return 'abc';
+ }
+
+ abstract public function baz();
+}
+
+class MockeryTest_TestInheritedType
+{
+}
+
+if (PHP_VERSION_ID >= 50400) {
+ class MockeryTest_MockCallableTypeHint
+ {
+ public function foo(callable $baz)
+ {
+ $baz();
+ }
+
+ public function bar(callable $callback = null)
+ {
+ $callback();
+ }
+ }
+}
+
+class MockeryTest_WithToString
+{
+ public function __toString()
+ {
+ }
+}
+
+class MockeryTest_ImplementsIteratorAggregate implements IteratorAggregate
+{
+ public function getIterator()
+ {
+ return new ArrayIterator(array());
+ }
+}
+
+class MockeryTest_ImplementsIterator implements Iterator
+{
+ public function rewind()
+ {
+ }
+
+ public function current()
+ {
+ }
+
+ public function key()
+ {
+ }
+
+ public function next()
+ {
+ }
+
+ public function valid()
+ {
+ }
+}
+
+class EmptyConstructorTest
+{
+ public $numberOfConstructorArgs;
+
+ public function __construct(...$args)
+ {
+ $this->numberOfConstructorArgs = count($args);
+ }
+
+ public function foo()
+ {
+ }
+}
+
+interface MockeryTest_InterfaceWithMethodParamSelf
+{
+ public function foo(self $bar);
+}
+
+class MockeryTest_Lowercase_ToString
+{
+ public function __tostring()
+ {
+ }
+}
+
+class MockeryTest_PartialStatic
+{
+ public static function mockMe($a)
+ {
+ return $a;
+ }
+
+ public static function keepMe($b)
+ {
+ return $b;
+ }
+}
+
+class MockeryTest_MethodWithRequiredParamWithDefaultValue
+{
+ public function foo(DateTime $bar = null, $baz)
+ {
+ }
+}
+
+interface MockeryTest_InterfaceThatExtendsIterator extends Iterator
+{
+ public function foo();
+}
+
+interface MockeryTest_InterfaceThatExtendsIteratorAggregate extends IteratorAggregate
+{
+ public function foo();
+}
+
+class MockeryTest_ClassThatDescendsFromInternalClass extends DateTime
+{
+}
+
+class MockeryTest_ClassThatImplementsSerializable implements Serializable
+{
+ public function serialize()
+ {
+ }
+
+ public function unserialize($serialized)
+ {
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/DemeterChainTest.php b/vendor/mockery/mockery/tests/Mockery/DemeterChainTest.php
new file mode 100644
index 000000000..9528d1612
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/DemeterChainTest.php
@@ -0,0 +1,204 @@
+= 0) {
+ require_once __DIR__.'/DummyClasses/DemeterChain.php';
+}
+
+use Mockery\Adapter\Phpunit\MockeryTestCase;
+
+class DemeterChainTest extends MockeryTestCase
+{
+ /** @var Mockery\Mock $this->mock */
+ private $mock;
+
+ public function setUp()
+ {
+ $this->mock = $this->mock = Mockery::mock()->shouldIgnoreMissing();
+ }
+
+ public function tearDown()
+ {
+ $this->mock->mockery_getContainer()->mockery_close();
+ }
+
+ public function testTwoChains()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getElement->getSecond')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->assertEquals(
+ 'something',
+ $this->mock->getElement()->getFirst()
+ );
+ $this->assertEquals(
+ 'somethingElse',
+ $this->mock->getElement()->getSecond()
+ );
+ $this->mock->mockery_getContainer()->mockery_close();
+ }
+
+ public function testTwoChainsWithExpectedParameters()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->with('parameter')
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getElement->getSecond')
+ ->once()
+ ->with('secondParameter')
+ ->andReturn('somethingElse');
+
+ $this->assertEquals(
+ 'something',
+ $this->mock->getElement()->getFirst('parameter')
+ );
+ $this->assertEquals(
+ 'somethingElse',
+ $this->mock->getElement()->getSecond('secondParameter')
+ );
+ $this->mock->mockery_getContainer()->mockery_close();
+ }
+
+ public function testThreeChains()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getElement->getSecond')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->assertEquals(
+ 'something',
+ $this->mock->getElement()->getFirst()
+ );
+ $this->assertEquals(
+ 'somethingElse',
+ $this->mock->getElement()->getSecond()
+ );
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('somethingNew');
+ $this->assertEquals(
+ 'somethingNew',
+ $this->mock->getElement()->getFirst()
+ );
+ }
+
+ public function testManyChains()
+ {
+ $this->mock->shouldReceive('getElements->getFirst')
+ ->once()
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getElements->getSecond')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->mock->getElements()->getFirst();
+ $this->mock->getElements()->getSecond();
+ }
+
+ public function testTwoNotRelatedChains()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('something');
+
+ $this->mock->shouldReceive('getOtherElement->getSecond')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->assertEquals(
+ 'somethingElse',
+ $this->mock->getOtherElement()->getSecond()
+ );
+ $this->assertEquals(
+ 'something',
+ $this->mock->getElement()->getFirst()
+ );
+ }
+
+ public function testDemeterChain()
+ {
+ $this->mock->shouldReceive('getElement->getFirst')
+ ->once()
+ ->andReturn('somethingElse');
+
+ $this->assertEquals('somethingElse', $this->mock->getElement()->getFirst());
+ }
+
+ public function testMultiLevelDemeterChain()
+ {
+ $this->mock->shouldReceive('levelOne->levelTwo->getFirst')
+ ->andReturn('first');
+
+ $this->mock->shouldReceive('levelOne->levelTwo->getSecond')
+ ->andReturn('second');
+
+ $this->assertEquals(
+ 'second',
+ $this->mock->levelOne()->levelTwo()->getSecond()
+ );
+ $this->assertEquals(
+ 'first',
+ $this->mock->levelOne()->levelTwo()->getFirst()
+ );
+ }
+
+ public function testSimilarDemeterChainsOnDifferentClasses()
+ {
+ $mock1 = Mockery::mock('overload:mock1');
+ $mock1->shouldReceive('select->some->data')->andReturn(1);
+ $mock1->shouldReceive('select->some->other->data')->andReturn(2);
+
+ $mock2 = Mockery::mock('overload:mock2');
+ $mock2->shouldReceive('select->some->data')->andReturn(3);
+ $mock2->shouldReceive('select->some->other->data')->andReturn(4);
+
+ $this->assertEquals(1, mock1::select()->some()->data());
+ $this->assertEquals(2, mock1::select()->some()->other()->data());
+ $this->assertEquals(3, mock2::select()->some()->data());
+ $this->assertEquals(4, mock2::select()->some()->other()->data());
+ }
+
+ /**
+ * @requires PHP 7.0.0
+ */
+ public function testDemeterChainsWithClassReturnTypeHints()
+ {
+ $a = \Mockery::mock(\DemeterChain\A::class);
+ $a->shouldReceive('foo->bar->baz')->andReturn(new stdClass);
+
+ $m = new \DemeterChain\Main();
+ $result = $m->callDemeter($a);
+
+ $this->assertInstanceOf(stdClass::class, $result);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/DummyClasses/DemeterChain.php b/vendor/mockery/mockery/tests/Mockery/DummyClasses/DemeterChain.php
new file mode 100644
index 000000000..b778cd4eb
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/DummyClasses/DemeterChain.php
@@ -0,0 +1,54 @@
+foo()->bar()->baz();
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/DummyClasses/Namespaced.php b/vendor/mockery/mockery/tests/Mockery/DummyClasses/Namespaced.php
new file mode 100644
index 000000000..615eb718a
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/DummyClasses/Namespaced.php
@@ -0,0 +1,35 @@
+mock = mock();
+ }
+
+ public function teardown()
+ {
+ parent::tearDown();
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ }
+
+ public function testReturnsNullWhenNoArgs()
+ {
+ $this->mock->shouldReceive('foo');
+ $this->assertNull($this->mock->foo());
+ }
+
+ public function testReturnsNullWhenSingleArg()
+ {
+ $this->mock->shouldReceive('foo');
+ $this->assertNull($this->mock->foo(1));
+ }
+
+ public function testReturnsNullWhenManyArgs()
+ {
+ $this->mock->shouldReceive('foo');
+ $this->assertNull($this->mock->foo('foo', array(), new stdClass));
+ }
+
+ public function testReturnsNullIfNullIsReturnValue()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(null);
+ $this->assertNull($this->mock->foo());
+ }
+
+ public function testReturnsNullForMockedExistingClassIfAndreturnnullCalled()
+ {
+ $mock = mock('MockeryTest_Foo');
+ $mock->shouldReceive('foo')->andReturn(null);
+ $this->assertNull($mock->foo());
+ }
+
+ public function testReturnsNullForMockedExistingClassIfNullIsReturnValue()
+ {
+ $mock = mock('MockeryTest_Foo');
+ $mock->shouldReceive('foo')->andReturnNull();
+ $this->assertNull($mock->foo());
+ }
+
+ public function testReturnsSameValueForAllIfNoArgsExpectationAndNoneGiven()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1);
+ $this->assertEquals(1, $this->mock->foo());
+ }
+
+ public function testSetsPublicPropertyWhenRequested()
+ {
+ $this->mock->bar = null;
+ $this->mock->shouldReceive('foo')->andSet('bar', 'baz');
+ $this->assertNull($this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ }
+
+ public function testSetsPublicPropertyWhenRequestedUsingAlias()
+ {
+ $this->mock->bar = null;
+ $this->mock->shouldReceive('foo')->set('bar', 'baz');
+ $this->assertNull($this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ }
+
+ public function testSetsPublicPropertiesWhenRequested()
+ {
+ $this->mock->bar = null;
+ $this->mock->shouldReceive('foo')->andSet('bar', 'baz', 'bazz', 'bazzz');
+ $this->assertNull($this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazzz', $this->mock->bar);
+ }
+
+ public function testSetsPublicPropertiesWhenRequestedUsingAlias()
+ {
+ $this->mock->bar = null;
+ $this->mock->shouldReceive('foo')->set('bar', 'baz', 'bazz', 'bazzz');
+ $this->assertAttributeEmpty('bar', $this->mock);
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazzz', $this->mock->bar);
+ }
+
+ public function testSetsPublicPropertiesWhenRequestedMoreTimesThanSetValues()
+ {
+ $this->mock->bar = null;
+ $this->mock->shouldReceive('foo')->andSet('bar', 'baz', 'bazz');
+ $this->assertNull($this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazz', $this->mock->bar);
+ }
+
+ public function testSetsPublicPropertiesWhenRequestedMoreTimesThanSetValuesUsingAlias()
+ {
+ $this->mock->bar = null;
+ $this->mock->shouldReceive('foo')->andSet('bar', 'baz', 'bazz');
+ $this->assertNull($this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazz', $this->mock->bar);
+ }
+
+ public function testSetsPublicPropertiesWhenRequestedMoreTimesThanSetValuesWithDirectSet()
+ {
+ $this->mock->bar = null;
+ $this->mock->shouldReceive('foo')->andSet('bar', 'baz', 'bazz');
+ $this->assertNull($this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazz', $this->mock->bar);
+ $this->mock->bar = null;
+ $this->mock->foo();
+ $this->assertNull($this->mock->bar);
+ }
+
+ public function testSetsPublicPropertiesWhenRequestedMoreTimesThanSetValuesWithDirectSetUsingAlias()
+ {
+ $this->mock->bar = null;
+ $this->mock->shouldReceive('foo')->set('bar', 'baz', 'bazz');
+ $this->assertNull($this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('baz', $this->mock->bar);
+ $this->mock->foo();
+ $this->assertEquals('bazz', $this->mock->bar);
+ $this->mock->bar = null;
+ $this->mock->foo();
+ $this->assertNull($this->mock->bar);
+ }
+
+ public function testReturnsSameValueForAllIfNoArgsExpectationAndSomeGiven()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1);
+ $this->assertEquals(1, $this->mock->foo('foo'));
+ }
+
+ public function testReturnsValueFromSequenceSequentially()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1, 2, 3);
+ $this->mock->foo('foo');
+ $this->assertEquals(2, $this->mock->foo('foo'));
+ }
+
+ public function testReturnsValueFromSequenceSequentiallyAndRepeatedlyReturnsFinalValueOnExtraCalls()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1, 2, 3);
+ $this->mock->foo('foo');
+ $this->mock->foo('foo');
+ $this->assertEquals(3, $this->mock->foo('foo'));
+ $this->assertEquals(3, $this->mock->foo('foo'));
+ }
+
+ public function testReturnsValueFromSequenceSequentiallyAndRepeatedlyReturnsFinalValueOnExtraCallsWithManyAndReturnCalls()
+ {
+ $this->mock->shouldReceive('foo')->andReturn(1)->andReturn(2, 3);
+ $this->mock->foo('foo');
+ $this->mock->foo('foo');
+ $this->assertEquals(3, $this->mock->foo('foo'));
+ $this->assertEquals(3, $this->mock->foo('foo'));
+ }
+
+ public function testReturnsValueOfClosure()
+ {
+ $this->mock->shouldReceive('foo')->with(5)->andReturnUsing(function ($v) {
+ return $v+1;
+ });
+ $this->assertEquals(6, $this->mock->foo(5));
+ }
+
+ public function testReturnsUndefined()
+ {
+ $this->mock->shouldReceive('foo')->andReturnUndefined();
+ $this->assertInstanceOf(\Mockery\Undefined::class, $this->mock->foo());
+ }
+
+ public function testReturnsValuesSetAsArray()
+ {
+ $this->mock->shouldReceive('foo')->andReturnValues(array(1, 2, 3));
+ $this->assertEquals(1, $this->mock->foo());
+ $this->assertEquals(2, $this->mock->foo());
+ $this->assertEquals(3, $this->mock->foo());
+ }
+
+ /**
+ * @expectedException OutOfBoundsException
+ */
+ public function testThrowsException()
+ {
+ $this->mock->shouldReceive('foo')->andThrow(new OutOfBoundsException);
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ /** @test */
+ public function and_throws_is_an_alias_to_and_throw()
+ {
+ $this->mock->shouldReceive('foo')->andThrows(new OutOfBoundsException);
+
+ $this->expectException(OutOfBoundsException::class);
+ $this->mock->foo();
+ }
+
+ /**
+ * @test
+ * @requires PHP 7.0.0
+ */
+ public function it_can_throw_a_throwable()
+ {
+ $this->expectException(\Error::class);
+ $this->mock->shouldReceive('foo')->andThrow(new \Error());
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException OutOfBoundsException
+ */
+ public function testThrowsExceptionBasedOnArgs()
+ {
+ $this->mock->shouldReceive('foo')->andThrow('OutOfBoundsException');
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testThrowsExceptionBasedOnArgsWithMessage()
+ {
+ $this->mock->shouldReceive('foo')->andThrow('OutOfBoundsException', 'foo');
+ try {
+ $this->mock->foo();
+ } catch (OutOfBoundsException $e) {
+ $this->assertEquals('foo', $e->getMessage());
+ }
+ }
+
+ /**
+ * @expectedException OutOfBoundsException
+ */
+ public function testThrowsExceptionSequentially()
+ {
+ $this->mock->shouldReceive('foo')->andThrow(new Exception)->andThrow(new OutOfBoundsException);
+ try {
+ $this->mock->foo();
+ } catch (Exception $e) {
+ }
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testAndThrowExceptions()
+ {
+ $this->mock->shouldReceive('foo')->andThrowExceptions(array(
+ new OutOfBoundsException,
+ new InvalidArgumentException,
+ ));
+
+ try {
+ $this->mock->foo();
+ throw new Exception("Expected OutOfBoundsException, non thrown");
+ } catch (\Exception $e) {
+ $this->assertInstanceOf("OutOfBoundsException", $e, "Wrong or no exception thrown: {$e->getMessage()}");
+ }
+
+ try {
+ $this->mock->foo();
+ throw new Exception("Expected InvalidArgumentException, non thrown");
+ } catch (\Exception $e) {
+ $this->assertInstanceOf("InvalidArgumentException", $e, "Wrong or no exception thrown: {$e->getMessage()}");
+ }
+ }
+
+ /**
+ * @expectedException Mockery\Exception
+ * @expectedExceptionMessage You must pass an array of exception objects to andThrowExceptions
+ */
+ public function testAndThrowExceptionsCatchNonExceptionArgument()
+ {
+ $this->mock
+ ->shouldReceive('foo')
+ ->andThrowExceptions(array('NotAnException'));
+ Mockery::close();
+ }
+
+ public function testMultipleExpectationsWithReturns()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->andReturn(10);
+ $this->mock->shouldReceive('bar')->with(2)->andReturn(20);
+ $this->assertEquals(10, $this->mock->foo(1));
+ $this->assertEquals(20, $this->mock->bar(2));
+ }
+
+ public function testExpectsNoArguments()
+ {
+ $this->mock->shouldReceive('foo')->withNoArgs();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsNoArgumentsThrowsExceptionIfAnyPassed()
+ {
+ $this->mock->shouldReceive('foo')->withNoArgs();
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testExpectsArgumentsArray()
+ {
+ $this->mock->shouldReceive('foo')->withArgs(array(1, 2));
+ $this->mock->foo(1, 2);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsArgumentsArrayThrowsExceptionIfPassedEmptyArray()
+ {
+ $this->mock->shouldReceive('foo')->withArgs(array());
+ $this->mock->foo(1, 2);
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsArgumentsArrayThrowsExceptionIfNoArgumentsPassed()
+ {
+ $this->mock->shouldReceive('foo')->with();
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsArgumentsArrayThrowsExceptionIfPassedWrongArguments()
+ {
+ $this->mock->shouldReceive('foo')->withArgs(array(1, 2));
+ $this->mock->foo(3, 4);
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ * @expectedExceptionMessageRegExp /foo\(NULL\)/
+ */
+ public function testExpectsStringArgumentExceptionMessageDifferentiatesBetweenNullAndEmptyString()
+ {
+ $this->mock->shouldReceive('foo')->withArgs(array('a string'));
+ $this->mock->foo(null);
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessageRegExp /invalid argument (.+), only array and closure are allowed/
+ */
+ public function testExpectsArgumentsArrayThrowsExceptionIfPassedWrongArgumentType()
+ {
+ $this->mock->shouldReceive('foo')->withArgs(5);
+ Mockery::close();
+ }
+
+ public function testExpectsArgumentsArrayAcceptAClosureThatValidatesPassedArguments()
+ {
+ $closure = function ($odd, $even) {
+ return ($odd % 2 != 0) && ($even % 2 == 0);
+ };
+ $this->mock->shouldReceive('foo')->withArgs($closure);
+ $this->mock->foo(1, 2);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsArgumentsArrayThrowsExceptionWhenClosureEvaluatesToFalse()
+ {
+ $closure = function ($odd, $even) {
+ return ($odd % 2 != 0) && ($even % 2 == 0);
+ };
+ $this->mock->shouldReceive('foo')->withArgs($closure);
+ $this->mock->foo(4, 2);
+ Mockery::close();
+ }
+
+ public function testExpectsArgumentsArrayClosureDoesNotThrowExceptionIfOptionalArgumentsAreMissing()
+ {
+ $closure = function ($odd, $even, $sum = null) {
+ $result = ($odd % 2 != 0) && ($even % 2 == 0);
+ if (!is_null($sum)) {
+ return $result && ($odd + $even == $sum);
+ }
+ return $result;
+ };
+ $this->mock->shouldReceive('foo')->withArgs($closure);
+ $this->mock->foo(1, 4);
+ }
+
+ public function testExpectsArgumentsArrayClosureDoesNotThrowExceptionIfOptionalArgumentsMathTheExpectation()
+ {
+ $closure = function ($odd, $even, $sum = null) {
+ $result = ($odd % 2 != 0) && ($even % 2 == 0);
+ if (!is_null($sum)) {
+ return $result && ($odd + $even == $sum);
+ }
+ return $result;
+ };
+ $this->mock->shouldReceive('foo')->withArgs($closure);
+ $this->mock->foo(1, 4, 5);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testExpectsArgumentsArrayClosureThrowsExceptionIfOptionalArgumentsDontMatchTheExpectation()
+ {
+ $closure = function ($odd, $even, $sum = null) {
+ $result = ($odd % 2 != 0) && ($even % 2 == 0);
+ if (!is_null($sum)) {
+ return $result && ($odd + $even == $sum);
+ }
+ return $result;
+ };
+ $this->mock->shouldReceive('foo')->withArgs($closure);
+ $this->mock->foo(1, 4, 2);
+ Mockery::close();
+ }
+
+ public function testExpectsAnyArguments()
+ {
+ $this->mock->shouldReceive('foo')->withAnyArgs();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 'k', new stdClass);
+ }
+
+ public function testExpectsArgumentMatchingObjectType()
+ {
+ $this->mock->shouldReceive('foo')->with('\stdClass');
+ $this->mock->foo(new stdClass);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testThrowsExceptionOnNoArgumentMatch()
+ {
+ $this->mock->shouldReceive('foo')->with(1);
+ $this->mock->foo(2);
+ Mockery::close();
+ }
+
+ public function testNeverCalled()
+ {
+ $this->mock->shouldReceive('foo')->never();
+ }
+
+ public function testShouldNotReceive()
+ {
+ $this->mock->shouldNotReceive('foo');
+ }
+
+ /**
+ * @expectedException \Mockery\Exception\InvalidCountException
+ */
+ public function testShouldNotReceiveThrowsExceptionIfMethodCalled()
+ {
+ $this->mock->shouldNotReceive('foo');
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception\InvalidCountException
+ */
+ public function testShouldNotReceiveWithArgumentThrowsExceptionIfMethodCalled()
+ {
+ $this->mock->shouldNotReceive('foo')->with(2);
+ $this->mock->foo(2);
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testNeverCalledThrowsExceptionOnCall()
+ {
+ $this->mock->shouldReceive('foo')->never();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testCalledOnce()
+ {
+ $this->mock->shouldReceive('foo')->once();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledOnceThrowsExceptionIfNotCalled()
+ {
+ $this->mock->shouldReceive('foo')->once();
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledOnceThrowsExceptionIfCalledTwice()
+ {
+ $this->mock->shouldReceive('foo')->once();
+ $this->mock->foo();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testCalledTwice()
+ {
+ $this->mock->shouldReceive('foo')->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledTwiceThrowsExceptionIfNotCalled()
+ {
+ $this->mock->shouldReceive('foo')->twice();
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledOnceThrowsExceptionIfCalledThreeTimes()
+ {
+ $this->mock->shouldReceive('foo')->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testCalledZeroOrMoreTimesAtZeroCalls()
+ {
+ $this->mock->shouldReceive('foo')->zeroOrMoreTimes();
+ }
+
+ public function testCalledZeroOrMoreTimesAtThreeCalls()
+ {
+ $this->mock->shouldReceive('foo')->zeroOrMoreTimes();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ }
+
+ public function testTimesCountCalls()
+ {
+ $this->mock->shouldReceive('foo')->times(4);
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testTimesCountCallThrowsExceptionOnTooFewCalls()
+ {
+ $this->mock->shouldReceive('foo')->times(2);
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testTimesCountCallThrowsExceptionOnTooManyCalls()
+ {
+ $this->mock->shouldReceive('foo')->times(2);
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testCalledAtLeastOnceAtExactlyOneCall()
+ {
+ $this->mock->shouldReceive('foo')->atLeast()->once();
+ $this->mock->foo();
+ }
+
+ public function testCalledAtLeastOnceAtExactlyThreeCalls()
+ {
+ $this->mock->shouldReceive('foo')->atLeast()->times(3);
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledAtLeastThrowsExceptionOnTooFewCalls()
+ {
+ $this->mock->shouldReceive('foo')->atLeast()->twice();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testCalledAtMostOnceAtExactlyOneCall()
+ {
+ $this->mock->shouldReceive('foo')->atMost()->once();
+ $this->mock->foo();
+ }
+
+ public function testCalledAtMostAtExactlyThreeCalls()
+ {
+ $this->mock->shouldReceive('foo')->atMost()->times(3);
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCalledAtLeastThrowsExceptionOnTooManyCalls()
+ {
+ $this->mock->shouldReceive('foo')->atMost()->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testExactCountersOverrideAnyPriorSetNonExactCounters()
+ {
+ $this->mock->shouldReceive('foo')->atLeast()->once()->once();
+ $this->mock->foo();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testComboOfLeastAndMostCallsWithOneCall()
+ {
+ $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice();
+ $this->mock->foo();
+ }
+
+ public function testComboOfLeastAndMostCallsWithTwoCalls()
+ {
+ $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testComboOfLeastAndMostCallsThrowsExceptionAtTooFewCalls()
+ {
+ $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice();
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testComboOfLeastAndMostCallsThrowsExceptionAtTooManyCalls()
+ {
+ $this->mock->shouldReceive('foo')->atleast()->once()->atMost()->twice();
+ $this->mock->foo();
+ $this->mock->foo();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testCallCountingOnlyAppliesToMatchedExpectations()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->once();
+ $this->mock->shouldReceive('foo')->with(2)->twice();
+ $this->mock->shouldReceive('foo')->with(3);
+ $this->mock->foo(1);
+ $this->mock->foo(2);
+ $this->mock->foo(2);
+ $this->mock->foo(3);
+ }
+
+ /**
+ * @expectedException \Mockery\CountValidator\Exception
+ */
+ public function testCallCountingThrowsExceptionOnAnyMismatch()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->once();
+ $this->mock->shouldReceive('foo')->with(2)->twice();
+ $this->mock->shouldReceive('foo')->with(3);
+ $this->mock->shouldReceive('bar');
+ $this->mock->foo(1);
+ $this->mock->foo(2);
+ $this->mock->foo(3);
+ $this->mock->bar();
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception\InvalidCountException
+ */
+ public function testCallCountingThrowsExceptionFirst()
+ {
+ $number_of_calls = 0;
+ $this->mock->shouldReceive('foo')
+ ->times(2)
+ ->with(\Mockery::on(function ($argument) use (&$number_of_calls) {
+ $number_of_calls++;
+ return $number_of_calls <= 3;
+ }));
+
+ $this->mock->foo(1);
+ $this->mock->foo(1);
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testOrderedCallsWithoutError()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->foo();
+ $this->mock->bar();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testOrderedCallsWithOutOfOrderError()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->bar();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testDifferentArgumentsAndOrderingsPassWithoutException()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->ordered();
+ $this->mock->shouldReceive('foo')->with(2)->ordered();
+ $this->mock->foo(1);
+ $this->mock->foo(2);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testDifferentArgumentsAndOrderingsThrowExceptionWhenInWrongOrder()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->ordered();
+ $this->mock->shouldReceive('foo')->with(2)->ordered();
+ $this->mock->foo(2);
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testUnorderedCallsIgnoredForOrdering()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->ordered();
+ $this->mock->shouldReceive('foo')->with(2);
+ $this->mock->shouldReceive('foo')->with(3)->ordered();
+ $this->mock->foo(2);
+ $this->mock->foo(1);
+ $this->mock->foo(2);
+ $this->mock->foo(3);
+ $this->mock->foo(2);
+ }
+
+ public function testOrderingOfDefaultGrouping()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->foo();
+ $this->mock->bar();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testOrderingOfDefaultGroupingThrowsExceptionOnWrongOrder()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->bar();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testOrderingUsingNumberedGroups()
+ {
+ $this->mock->shouldReceive('start')->ordered(1);
+ $this->mock->shouldReceive('foo')->ordered(2);
+ $this->mock->shouldReceive('bar')->ordered(2);
+ $this->mock->shouldReceive('final')->ordered();
+ $this->mock->start();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->mock->final();
+ }
+
+ public function testOrderingUsingNamedGroups()
+ {
+ $this->mock->shouldReceive('start')->ordered('start');
+ $this->mock->shouldReceive('foo')->ordered('foobar');
+ $this->mock->shouldReceive('bar')->ordered('foobar');
+ $this->mock->shouldReceive('final')->ordered();
+ $this->mock->start();
+ $this->mock->bar();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->mock->final();
+ }
+
+ /**
+ * @group 2A
+ */
+ public function testGroupedUngroupedOrderingDoNotOverlap()
+ {
+ $s = $this->mock->shouldReceive('start')->ordered();
+ $m = $this->mock->shouldReceive('mid')->ordered('foobar');
+ $e = $this->mock->shouldReceive('end')->ordered();
+ $this->assertLessThan($m->getOrderNumber(), $s->getOrderNumber());
+ $this->assertLessThan($e->getOrderNumber(), $m->getOrderNumber());
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testGroupedOrderingThrowsExceptionWhenCallsDisordered()
+ {
+ $this->mock->shouldReceive('foo')->ordered('first');
+ $this->mock->shouldReceive('bar')->ordered('second');
+ $this->mock->bar();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testExpectationMatchingWithNoArgsOrderings()
+ {
+ $this->mock->shouldReceive('foo')->withNoArgs()->once()->ordered();
+ $this->mock->shouldReceive('bar')->withNoArgs()->once()->ordered();
+ $this->mock->shouldReceive('foo')->withNoArgs()->once()->ordered();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->mock->foo();
+ }
+
+ public function testExpectationMatchingWithAnyArgsOrderings()
+ {
+ $this->mock->shouldReceive('foo')->withAnyArgs()->once()->ordered();
+ $this->mock->shouldReceive('bar')->withAnyArgs()->once()->ordered();
+ $this->mock->shouldReceive('foo')->withAnyArgs()->once()->ordered();
+ $this->mock->foo();
+ $this->mock->bar();
+ $this->mock->foo();
+ }
+
+ public function testEnsuresOrderingIsNotCrossMockByDefault()
+ {
+ $this->mock->shouldReceive('foo')->ordered();
+ $mock2 = mock('bar');
+ $mock2->shouldReceive('bar')->ordered();
+ $mock2->bar();
+ $this->mock->foo();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testEnsuresOrderingIsCrossMockWhenGloballyFlagSet()
+ {
+ $this->mock->shouldReceive('foo')->globally()->ordered();
+ $mock2 = mock('bar');
+ $mock2->shouldReceive('bar')->globally()->ordered();
+ $mock2->bar();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testExpectationCastToStringFormatting()
+ {
+ $exp = $this->mock->shouldReceive('foo')->with(1, 'bar', new stdClass, array('Spam' => 'Ham', 'Bar' => 'Baz'));
+ $this->assertEquals("[foo(1, 'bar', object(stdClass), ['Spam' => 'Ham', 'Bar' => 'Baz'])]", (string) $exp);
+ }
+
+ public function testLongExpectationCastToStringFormatting()
+ {
+ $exp = $this->mock->shouldReceive('foo')->with(array('Spam' => 'Ham', 'Bar' => 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'Bar', 'Baz', 'End'));
+ $this->assertEquals("[foo(['Spam' => 'Ham', 'Bar' => 'Baz', 0 => 'Bar', 1 => 'Baz', 2 => 'Bar', 3 => 'Baz', 4 => 'Bar', 5 => 'Baz', 6 => 'Bar', 7 => 'Baz', 8 => 'Bar', 9 => 'Baz', 10 => 'Bar', 11 => 'Baz', 12 => 'Bar', 13 => 'Baz', 14 => 'Bar', 15 => 'Baz', 16 => 'Bar', 17 => 'Baz', 18 => 'Bar', 19 => 'Baz', 20 => 'Bar', 21 => 'Baz', 22 => 'Bar', 23 => 'Baz', 24 => 'Bar', 25 => 'Baz', 26 => 'Bar', 27 => 'Baz', 28 => 'Bar', 29 => 'Baz', 30 => 'Bar', 31 => 'Baz', 32 => 'Bar', 33 => 'Baz', 34 => 'Bar', 35 => 'Baz', 36 => 'Bar', 37 => 'Baz', 38 => 'Bar', 39 => 'Baz', 40 => 'Bar', 41 => 'Baz', 42 => 'Bar', 43 => 'Baz', 44 => 'Bar', 45 => 'Baz', 46 => 'Baz', 47 => 'Bar', 48 => 'Baz', 49 => 'Bar', 50 => 'Baz', 51 => 'Bar', 52 => 'Baz', 53 => 'Bar', 54 => 'Baz', 55 => 'Bar', 56 => 'Baz', 57 => 'Baz', 58 => 'Bar', 59 => 'Baz', 60 => 'Bar', 61 => 'Baz', 62 => 'Bar', 63 => 'Baz', 64 => 'Bar', 65 => 'Baz', 66 => 'Bar', 67 => 'Baz', 68 => 'Baz', 69 => 'Bar', 70 => 'Baz', 71 => 'Bar', 72 => 'Baz', 73 => 'Bar', 74 => 'Baz', 7...])]", (string) $exp);
+ }
+
+ public function testMultipleExpectationCastToStringFormatting()
+ {
+ $exp = $this->mock->shouldReceive('foo', 'bar')->with(1);
+ $this->assertEquals('[foo(1), bar(1)]', (string) $exp);
+ }
+
+ public function testGroupedOrderingWithLimitsAllowsMultipleReturnValues()
+ {
+ $this->mock->shouldReceive('foo')->with(2)->once()->andReturn('first');
+ $this->mock->shouldReceive('foo')->with(2)->twice()->andReturn('second/third');
+ $this->mock->shouldReceive('foo')->with(2)->andReturn('infinity');
+ $this->assertEquals('first', $this->mock->foo(2));
+ $this->assertEquals('second/third', $this->mock->foo(2));
+ $this->assertEquals('second/third', $this->mock->foo(2));
+ $this->assertEquals('infinity', $this->mock->foo(2));
+ $this->assertEquals('infinity', $this->mock->foo(2));
+ $this->assertEquals('infinity', $this->mock->foo(2));
+ }
+
+ public function testExpectationsCanBeMarkedAsDefaults()
+ {
+ $this->mock->shouldReceive('foo')->andReturn('bar')->byDefault();
+ $this->assertEquals('bar', $this->mock->foo());
+ }
+
+ public function testDefaultExpectationsValidatedInCorrectOrder()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->once()->andReturn('first')->byDefault();
+ $this->mock->shouldReceive('foo')->with(2)->once()->andReturn('second')->byDefault();
+ $this->assertEquals('first', $this->mock->foo(1));
+ $this->assertEquals('second', $this->mock->foo(2));
+ }
+
+ public function testDefaultExpectationsAreReplacedByLaterConcreteExpectations()
+ {
+ $this->mock->shouldReceive('foo')->andReturn('bar')->once()->byDefault();
+ $this->mock->shouldReceive('foo')->andReturn('baz')->twice();
+ $this->assertEquals('baz', $this->mock->foo());
+ $this->assertEquals('baz', $this->mock->foo());
+ }
+
+ public function testExpectationFallsBackToDefaultExpectationWhenConcreteExpectationsAreUsedUp()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->andReturn('bar')->once()->byDefault();
+ $this->mock->shouldReceive('foo')->with(2)->andReturn('baz')->once();
+ $this->assertEquals('baz', $this->mock->foo(2));
+ $this->assertEquals('bar', $this->mock->foo(1));
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testDefaultExpectationsCanBeOrdered()
+ {
+ $this->mock->shouldReceive('foo')->ordered()->byDefault();
+ $this->mock->shouldReceive('bar')->ordered()->byDefault();
+ $this->mock->bar();
+ $this->mock->foo();
+ Mockery::close();
+ }
+
+ public function testDefaultExpectationsCanBeOrderedAndReplaced()
+ {
+ $this->mock->shouldReceive('foo')->ordered()->byDefault();
+ $this->mock->shouldReceive('bar')->ordered()->byDefault();
+ $this->mock->shouldReceive('bar')->ordered();
+ $this->mock->shouldReceive('foo')->ordered();
+ $this->mock->bar();
+ $this->mock->foo();
+ }
+
+ public function testByDefaultOperatesFromMockConstruction()
+ {
+ $container = new \Mockery\Container(\Mockery::getDefaultGenerator(), \Mockery::getDefaultLoader());
+ $mock = $container->mock('f', array('foo'=>'rfoo', 'bar'=>'rbar', 'baz'=>'rbaz'))->byDefault();
+ $mock->shouldReceive('foo')->andReturn('foobar');
+ $this->assertEquals('foobar', $mock->foo());
+ $this->assertEquals('rbar', $mock->bar());
+ $this->assertEquals('rbaz', $mock->baz());
+ }
+
+ public function testByDefaultOnAMockDoesSquatWithoutExpectations()
+ {
+ $this->assertInstanceOf(MockInterface::class, mock('f')->byDefault());
+ }
+
+ public function testDefaultExpectationsCanBeOverridden()
+ {
+ $this->mock->shouldReceive('foo')->with('test')->andReturn('bar')->byDefault();
+ $this->mock->shouldReceive('foo')->with('test')->andReturn('newbar')->byDefault();
+ $this->mock->foo('test');
+ $this->assertEquals('newbar', $this->mock->foo('test'));
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testByDefaultPreventedFromSettingDefaultWhenDefaultingExpectationWasReplaced()
+ {
+ $exp = $this->mock->shouldReceive('foo')->andReturn(1);
+ $this->mock->shouldReceive('foo')->andReturn(2);
+ $exp->byDefault();
+ Mockery::close();
+ }
+
+ /**
+ * Argument Constraint Tests
+ */
+
+ public function testAnyConstraintMatchesAnyArg()
+ {
+ $this->mock->shouldReceive('foo')->with(1, Mockery::any())->twice();
+ $this->mock->foo(1, 2);
+ $this->mock->foo(1, 'str');
+ }
+
+ public function testAnyConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::any())->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ public function testAndAnyOtherConstraintMatchesTheRestOfTheArguments()
+ {
+ $this->mock->shouldReceive('foo')->with(1, 2, Mockery::andAnyOthers())->twice();
+ $this->mock->foo(1, 2, 3, 4, 5);
+ $this->mock->foo(1, 'str', 3, 4);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testAndAnyOtherConstraintDoesNotPreventMatchingOfRegularArguments()
+ {
+ $this->mock->shouldReceive('foo')->with(1, 2, Mockery::andAnyOthers());
+ $this->mock->foo(10, 2, 3, 4, 5);
+ Mockery::close();
+ }
+
+ public function testArrayConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('array'))->once();
+ $this->mock->foo(array());
+ }
+
+ public function testArrayConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('array'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testArrayConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('array'));
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testBoolConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('bool'))->once();
+ $this->mock->foo(true);
+ }
+
+ public function testBoolConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('bool'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testBoolConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('bool'));
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testCallableConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('callable'))->once();
+ $this->mock->foo(function () {
+ return 'f';
+ });
+ }
+
+ public function testCallableConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('callable'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testCallableConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('callable'));
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testDoubleConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('double'))->once();
+ $this->mock->foo(2.25);
+ }
+
+ public function testDoubleConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('double'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testDoubleConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('double'));
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testFloatConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('float'))->once();
+ $this->mock->foo(2.25);
+ }
+
+ public function testFloatConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('float'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testFloatConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('float'));
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testIntConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('int'))->once();
+ $this->mock->foo(2);
+ }
+
+ public function testIntConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('int'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testIntConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('int'));
+ $this->mock->foo('f');
+ Mockery::close();
+ }
+
+ public function testLongConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('long'))->once();
+ $this->mock->foo(2);
+ }
+
+ public function testLongConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('long'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testLongConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('long'));
+ $this->mock->foo('f');
+ Mockery::close();
+ }
+
+ public function testNullConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('null'))->once();
+ $this->mock->foo(null);
+ }
+
+ public function testNullConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('null'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testNullConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('null'));
+ $this->mock->foo('f');
+ Mockery::close();
+ }
+
+ public function testNumericConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('numeric'))->once();
+ $this->mock->foo('2');
+ }
+
+ public function testNumericConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('numeric'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testNumericConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('numeric'));
+ $this->mock->foo('f');
+ Mockery::close();
+ }
+
+ public function testObjectConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once();
+ $this->mock->foo(new stdClass);
+ }
+
+ public function testObjectConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('object`'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testObjectConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('object'));
+ $this->mock->foo('f');
+ Mockery::close();
+ }
+
+ public function testRealConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('real'))->once();
+ $this->mock->foo(2.25);
+ }
+
+ public function testRealConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('real'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testRealConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('real'));
+ $this->mock->foo('f');
+ Mockery::close();
+ }
+
+ public function testResourceConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('resource'))->once();
+ $r = fopen(dirname(__FILE__) . '/_files/file.txt', 'r');
+ $this->mock->foo($r);
+ }
+
+ public function testResourceConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('resource'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testResourceConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('resource'));
+ $this->mock->foo('f');
+ Mockery::close();
+ }
+
+ public function testScalarConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('scalar'))->once();
+ $this->mock->foo(2);
+ }
+
+ public function testScalarConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('scalar'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testScalarConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('scalar'));
+ $this->mock->foo(array());
+ Mockery::close();
+ }
+
+ public function testStringConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('string'))->once();
+ $this->mock->foo('2');
+ }
+
+ public function testStringConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('string'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testStringConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('string'));
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+
+ public function testClassConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once();
+ $this->mock->foo(new stdClass);
+ }
+
+ public function testClassConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('stdClass'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testClassConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'));
+ $this->mock->foo(new Exception);
+ Mockery::close();
+ }
+
+ public function testDucktypeConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::ducktype('quack', 'swim'))->once();
+ $this->mock->foo(new Mockery_Duck);
+ }
+
+ public function testDucktypeConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::ducktype('quack', 'swim'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testDucktypeConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::ducktype('quack', 'swim'));
+ $this->mock->foo(new Mockery_Duck_Nonswimmer);
+ Mockery::close();
+ }
+
+ public function testArrayContentConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::subset(array('a'=>1, 'b'=>2)))->once();
+ $this->mock->foo(array('a'=>1, 'b'=>2, 'c'=>3));
+ }
+
+ public function testArrayContentConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::subset(array('a'=>1, 'b'=>2)))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testArrayContentConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::subset(array('a'=>1, 'b'=>2)));
+ $this->mock->foo(array('a'=>1, 'c'=>3));
+ Mockery::close();
+ }
+
+ public function testContainsConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::contains(1, 2))->once();
+ $this->mock->foo(array('a'=>1, 'b'=>2, 'c'=>3));
+ }
+
+ public function testContainsConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::contains(1, 2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testContainsConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::contains(1, 2));
+ $this->mock->foo(array('a'=>1, 'c'=>3));
+ Mockery::close();
+ }
+
+ public function testHasKeyConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::hasKey('c'))->once();
+ $this->mock->foo(array('a'=>1, 'b'=>2, 'c'=>3));
+ }
+
+ public function testHasKeyConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::hasKey('a'))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, array('a'=>1), 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testHasKeyConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::hasKey('c'));
+ $this->mock->foo(array('a'=>1, 'b'=>3));
+ Mockery::close();
+ }
+
+ public function testHasValueConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::hasValue(1))->once();
+ $this->mock->foo(array('a'=>1, 'b'=>2, 'c'=>3));
+ }
+
+ public function testHasValueConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::hasValue(1))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, array('a'=>1), 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testHasValueConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::hasValue(2));
+ $this->mock->foo(array('a'=>1, 'b'=>3));
+ Mockery::close();
+ }
+
+ public function testOnConstraintMatchesArgument_ClosureEvaluatesToTrue()
+ {
+ $function = function ($arg) {
+ return $arg % 2 == 0;
+ };
+ $this->mock->shouldReceive('foo')->with(Mockery::on($function))->once();
+ $this->mock->foo(4);
+ }
+
+ public function testOnConstraintMatchesArgumentOfTypeArray_ClosureEvaluatesToTrue()
+ {
+ $function = function ($arg) {
+ return is_array($arg);
+ };
+ $this->mock->shouldReceive('foo')->with(Mockery::on($function))->once();
+ $this->mock->foo([4, 5]);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testOnConstraintThrowsExceptionWhenConstraintUnmatched_ClosureEvaluatesToFalse()
+ {
+ $function = function ($arg) {
+ return $arg % 2 == 0;
+ };
+ $this->mock->shouldReceive('foo')->with(Mockery::on($function));
+ $this->mock->foo(5);
+ Mockery::close();
+ }
+
+ public function testMustBeConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::mustBe(2))->once();
+ $this->mock->foo(2);
+ }
+
+ public function testMustBeConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::mustBe(2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testMustBeConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::mustBe(2));
+ $this->mock->foo('2');
+ Mockery::close();
+ }
+
+ public function testMustBeConstraintMatchesObjectArgumentWithEqualsComparisonNotIdentical()
+ {
+ $a = new stdClass;
+ $a->foo = 1;
+ $b = new stdClass;
+ $b->foo = 1;
+ $this->mock->shouldReceive('foo')->with(Mockery::mustBe($a))->once();
+ $this->mock->foo($b);
+ }
+
+ public function testMustBeConstraintNonMatchingCaseWithObject()
+ {
+ $a = new stdClass;
+ $a->foo = 1;
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::mustBe($a))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, $a, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testMustBeConstraintThrowsExceptionWhenConstraintUnmatchedWithObject()
+ {
+ $a = new stdClass;
+ $a->foo = 1;
+ $b = new stdClass;
+ $b->foo = 2;
+ $this->mock->shouldReceive('foo')->with(Mockery::mustBe($a));
+ $this->mock->foo($b);
+ Mockery::close();
+ }
+
+ public function testMatchPrecedenceBasedOnExpectedCallsFavouringExplicitMatch()
+ {
+ $this->mock->shouldReceive('foo')->with(1)->once();
+ $this->mock->shouldReceive('foo')->with(Mockery::any())->never();
+ $this->mock->foo(1);
+ }
+
+ public function testMatchPrecedenceBasedOnExpectedCallsFavouringAnyMatch()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::any())->once();
+ $this->mock->shouldReceive('foo')->with(1)->never();
+ $this->mock->foo(1);
+ }
+
+ public function testReturnNullIfIgnoreMissingMethodsSet()
+ {
+ $this->mock->shouldIgnoreMissing();
+ $this->assertNull($this->mock->g(1, 2));
+ }
+
+ public function testReturnUndefinedIfIgnoreMissingMethodsSet()
+ {
+ $this->mock->shouldIgnoreMissing()->asUndefined();
+ $this->assertInstanceOf(\Mockery\Undefined::class, $this->mock->g(1, 2));
+ }
+
+ public function testReturnAsUndefinedAllowsForInfiniteSelfReturningChain()
+ {
+ $this->mock->shouldIgnoreMissing()->asUndefined();
+ $this->assertInstanceOf(\Mockery\Undefined::class, $this->mock->g(1, 2)->a()->b()->c());
+ }
+
+ public function testShouldIgnoreMissingFluentInterface()
+ {
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $this->mock->shouldIgnoreMissing());
+ }
+
+ public function testShouldIgnoreMissingAsUndefinedFluentInterface()
+ {
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $this->mock->shouldIgnoreMissing()->asUndefined());
+ }
+
+ public function testShouldIgnoreMissingAsDefinedProxiesToUndefinedAllowingToString()
+ {
+ $this->mock->shouldIgnoreMissing()->asUndefined();
+ $this->assertInternalType('string', "{$this->mock->g()}");
+ $this->assertInternalType('string', "{$this->mock}");
+ }
+
+ public function testShouldIgnoreMissingDefaultReturnValue()
+ {
+ $this->mock->shouldIgnoreMissing(1);
+ $this->assertEquals(1, $this->mock->a());
+ }
+
+ /** @issue #253 */
+ public function testShouldIgnoreMissingDefaultSelfAndReturnsSelf()
+ {
+ $this->mock->shouldIgnoreMissing(\Mockery::self());
+ $this->assertSame($this->mock, $this->mock->a()->b());
+ }
+
+ public function testToStringMagicMethodCanBeMocked()
+ {
+ $this->mock->shouldReceive("__toString")->andReturn('dave');
+ $this->assertEquals("{$this->mock}", "dave");
+ }
+
+ public function testOptionalMockRetrieval()
+ {
+ $m = mock('f')->shouldReceive('foo')->with(1)->andReturn(3)->mock();
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $m);
+ }
+
+ public function testNotConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::not(1))->once();
+ $this->mock->foo(2);
+ }
+
+ public function testNotConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::not(2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testNotConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::not(2));
+ $this->mock->foo(2);
+ Mockery::close();
+ }
+
+ public function testAnyOfConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::anyOf(1, 2))->twice();
+ $this->mock->foo(2);
+ $this->mock->foo(1);
+ }
+
+ public function testAnyOfConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::anyOf(1, 2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 2, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testAnyOfConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::anyOf(1, 2));
+ $this->mock->foo(3);
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testAnyOfConstraintThrowsExceptionWhenTrueIsNotAnExpectedArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::anyOf(1, 2));
+ $this->mock->foo(true);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testAnyOfConstraintThrowsExceptionWhenFalseIsNotAnExpectedArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::anyOf(0, 1, 2));
+ $this->mock->foo(false);
+ }
+
+ public function testNotAnyOfConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::notAnyOf(1, 2))->once();
+ $this->mock->foo(3);
+ }
+
+ public function testNotAnyOfConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->times(3);
+ $this->mock->shouldReceive('foo')->with(1, Mockery::notAnyOf(1, 2))->never();
+ $this->mock->foo();
+ $this->mock->foo(1);
+ $this->mock->foo(1, 4, 3);
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testNotAnyOfConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::notAnyOf(1, 2));
+ $this->mock->foo(2);
+ Mockery::close();
+ }
+
+ public function testPatternConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::pattern('/foo.*/'))->once();
+ $this->mock->foo('foobar');
+ }
+
+ public function testPatternConstraintNonMatchingCase()
+ {
+ $this->mock->shouldReceive('foo')->once();
+ $this->mock->shouldReceive('foo')->with(Mockery::pattern('/foo.*/'))->never();
+ $this->mock->foo('bar');
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testPatternConstraintThrowsExceptionWhenConstraintUnmatched()
+ {
+ $this->mock->shouldReceive('foo')->with(Mockery::pattern('/foo.*/'));
+ $this->mock->foo('bar');
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testGlobalConfigMayForbidMockingNonExistentMethodsOnClasses()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = mock('stdClass');
+ $mock->shouldReceive('foo');
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ * @expectedExceptionMessage Mockery can't find 'SomeMadeUpClass' so can't mock it
+ */
+ public function testGlobalConfigMayForbidMockingNonExistentMethodsOnAutoDeclaredClasses()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = mock('SomeMadeUpClass');
+ $mock->shouldReceive('foo');
+ Mockery::close();
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testGlobalConfigMayForbidMockingNonExistentMethodsOnObjects()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = mock(new stdClass);
+ $mock->shouldReceive('foo');
+ Mockery::close();
+ }
+
+ public function testAnExampleWithSomeExpectationAmends()
+ {
+ $service = mock('MyService');
+ $service->shouldReceive('login')->with('user', 'pass')->once()->andReturn(true);
+ $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(false);
+ $service->shouldReceive('addBookmark')->with(Mockery::pattern('/^http:/'), \Mockery::type('string'))->times(3)->andReturn(true);
+ $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(true);
+
+ $this->assertTrue($service->login('user', 'pass'));
+ $this->assertFalse($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1'));
+ $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2'));
+ $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+ }
+
+ public function testAnExampleWithSomeExpectationAmendsOnCallCounts()
+ {
+ $service = mock('MyService');
+ $service->shouldReceive('login')->with('user', 'pass')->once()->andReturn(true);
+ $service->shouldReceive('hasBookmarksTagged')->with('php')->once()->andReturn(false);
+ $service->shouldReceive('addBookmark')->with(Mockery::pattern('/^http:/'), \Mockery::type('string'))->times(3)->andReturn(true);
+ $service->shouldReceive('hasBookmarksTagged')->with('php')->twice()->andReturn(true);
+
+ $this->assertTrue($service->login('user', 'pass'));
+ $this->assertFalse($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1'));
+ $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2'));
+ $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+ }
+
+ public function testAnExampleWithSomeExpectationAmendsOnCallCounts_PHPUnitTest()
+ {
+ $service = $this->createMock('MyService2');
+ $service->expects($this->once())->method('login')->with('user', 'pass')->will($this->returnValue(true));
+ $service->expects($this->exactly(3))->method('hasBookmarksTagged')->with('php')
+ ->will($this->onConsecutiveCalls(false, true, true));
+ $service->expects($this->exactly(3))->method('addBookmark')
+ ->with($this->matchesRegularExpression('/^http:/'), $this->isType('string'))
+ ->will($this->returnValue(true));
+
+ $this->assertTrue($service->login('user', 'pass'));
+ $this->assertFalse($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->addBookmark('http://example.com/1', 'some_tag1'));
+ $this->assertTrue($service->addBookmark('http://example.com/2', 'some_tag2'));
+ $this->assertTrue($service->addBookmark('http://example.com/3', 'some_tag3'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+ $this->assertTrue($service->hasBookmarksTagged('php'));
+ }
+
+ public function testMockedMethodsCallableFromWithinOriginalClass()
+ {
+ $mock = mock('MockeryTest_InterMethod1[doThird]');
+ $mock->shouldReceive('doThird')->andReturn(true);
+ $this->assertTrue($mock->doFirst());
+ }
+
+ /**
+ * @group issue #20
+ */
+ public function testMockingDemeterChainsPassesMockeryExpectationToCompositeExpectation()
+ {
+ $mock = mock('Mockery_Demeterowski');
+ $mock->shouldReceive('foo->bar->baz')->andReturn('Spam!');
+ $demeter = new Mockery_UseDemeter($mock);
+ $this->assertSame('Spam!', $demeter->doit());
+ }
+
+ /**
+ * @group issue #20 - with args in demeter chain
+ */
+ public function testMockingDemeterChainsPassesMockeryExpectationToCompositeExpectationWithArgs()
+ {
+ $mock = mock('Mockery_Demeterowski');
+ $mock->shouldReceive('foo->bar->baz')->andReturn('Spam!');
+ $demeter = new Mockery_UseDemeter($mock);
+ $this->assertSame('Spam!', $demeter->doitWithArgs());
+ }
+
+ public function testShouldNotReceiveCanBeAddedToCompositeExpectation()
+ {
+ $mock = mock('Foo');
+ $mock->shouldReceive('a')->once()->andReturn('Spam!')
+ ->shouldNotReceive('b');
+ $mock->a();
+ }
+
+ public function testPassthruEnsuresRealMethodCalledForReturnValues()
+ {
+ $mock = mock('MockeryTest_SubjectCall1');
+ $mock->shouldReceive('foo')->once()->passthru();
+ $this->assertEquals('bar', $mock->foo());
+ }
+
+ public function testShouldIgnoreMissingExpectationBasedOnArgs()
+ {
+ $mock = mock("MyService2")->shouldIgnoreMissing();
+ $mock->shouldReceive("hasBookmarksTagged")->with("dave")->once();
+ $mock->hasBookmarksTagged("dave");
+ $mock->hasBookmarksTagged("padraic");
+ }
+
+ public function testMakePartialExpectationBasedOnArgs()
+ {
+ $mock = mock("MockeryTest_SubjectCall1")->makePartial();
+
+ $this->assertEquals('bar', $mock->foo());
+ $this->assertEquals('bar', $mock->foo("baz"));
+ $this->assertEquals('bar', $mock->foo("qux"));
+
+ $mock->shouldReceive("foo")->with("baz")->twice()->andReturn('123');
+ $this->assertEquals('bar', $mock->foo());
+ $this->assertEquals('123', $mock->foo("baz"));
+ $this->assertEquals('bar', $mock->foo("qux"));
+
+ $mock->shouldReceive("foo")->withNoArgs()->once()->andReturn('456');
+ $this->assertEquals('456', $mock->foo());
+ $this->assertEquals('123', $mock->foo("baz"));
+ $this->assertEquals('bar', $mock->foo("qux"));
+ }
+
+ public function testCanReturnSelf()
+ {
+ $this->mock->shouldReceive("foo")->andReturnSelf();
+ $this->assertSame($this->mock, $this->mock->foo());
+ }
+
+ public function testReturnsTrueIfTrueIsReturnValue()
+ {
+ $this->mock->shouldReceive("foo")->andReturnTrue();
+ $this->assertTrue($this->mock->foo());
+ }
+
+ public function testReturnsFalseIfFalseIsReturnValue()
+ {
+ $this->mock->shouldReceive("foo")->andReturnFalse();
+ $this->assertFalse($this->mock->foo());
+ }
+
+ public function testExpectationCanBeOverridden()
+ {
+ $this->mock->shouldReceive('foo')->once()->andReturn('green');
+ $this->mock->shouldReceive('foo')->andReturn('blue');
+ $this->assertEquals($this->mock->foo(), 'green');
+ $this->assertEquals($this->mock->foo(), 'blue');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testTimesExpectationForbidsFloatNumbers()
+ {
+ $this->mock->shouldReceive('foo')->times(1.3);
+ Mockery::close();
+ }
+
+ public function testIfExceptionIndicatesAbsenceOfMethodAndExpectationsOnMock()
+ {
+ $mock = mock('Mockery_Duck');
+
+ $this->expectException(
+ '\BadMethodCallException',
+ 'Method ' . get_class($mock) .
+ '::nonExistent() does not exist on this mock object'
+ );
+
+ $mock->nonExistent();
+ Mockery::close();
+ }
+
+ public function testIfCallingMethodWithNoExpectationsHasSpecificExceptionMessage()
+ {
+ $mock = mock('Mockery_Duck');
+
+ $this->expectException(
+ '\BadMethodCallException',
+ 'Received ' . get_class($mock) .
+ '::quack(), ' . 'but no expectations were specified'
+ );
+
+ $mock->quack();
+ Mockery::close();
+ }
+
+ public function testMockShouldNotBeAnonymousWhenImplementingSpecificInterface()
+ {
+ $waterMock = mock('IWater');
+ $this->assertFalse($waterMock->mockery_isAnonymous());
+ }
+
+ /**
+ * @expectedException \Mockery\Exception
+ */
+ public function testWetherMockWithInterfaceOnlyCanNotImplementNonExistingMethods()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $waterMock = \Mockery::mock('IWater');
+ $waterMock
+ ->shouldReceive('nonExistentMethod')
+ ->once()
+ ->andReturnNull();
+ \Mockery::close();
+ }
+
+ public function testCountWithBecauseExceptionMessage()
+ {
+ $this->expectException(InvalidCountException::class);
+ $this->expectExceptionMessageRegexp(
+ '/Method foo\(\) from Mockery_[\d]+ should be called' . PHP_EOL . ' ' .
+ 'exactly 1 times but called 0 times. Because We like foo/'
+ );
+
+ $this->mock->shouldReceive('foo')->once()->because('We like foo');
+ Mockery::close();
+ }
+
+ /** @test */
+ public function it_uses_a_matchers_to_string_method_in_the_exception_output()
+ {
+ $mock = Mockery::mock();
+
+ $mock->expects()->foo(Mockery::hasKey('foo'));
+
+ $this->expectException(
+ InvalidCountException::class,
+ "Method foo()"
+ );
+
+ Mockery::close();
+ }
+}
+
+interface IWater
+{
+ public function dry();
+}
+
+class MockeryTest_SubjectCall1
+{
+ public function foo()
+ {
+ return 'bar';
+ }
+}
+
+class MockeryTest_InterMethod1
+{
+ public function doFirst()
+ {
+ return $this->doSecond();
+ }
+
+ private function doSecond()
+ {
+ return $this->doThird();
+ }
+
+ public function doThird()
+ {
+ return false;
+ }
+}
+
+class MyService2
+{
+ public function login($user, $pass)
+ {
+ }
+ public function hasBookmarksTagged($tag)
+ {
+ }
+ public function addBookmark($uri, $tag)
+ {
+ }
+}
+
+class Mockery_Duck
+{
+ public function quack()
+ {
+ }
+ public function swim()
+ {
+ }
+}
+
+class Mockery_Duck_Nonswimmer
+{
+ public function quack()
+ {
+ }
+}
+
+class Mockery_Demeterowski
+{
+ public function foo()
+ {
+ return $this;
+ }
+ public function bar()
+ {
+ return $this;
+ }
+ public function baz()
+ {
+ return 'Ham!';
+ }
+}
+
+class Mockery_UseDemeter
+{
+ public function __construct($demeter)
+ {
+ $this->demeter = $demeter;
+ }
+ public function doit()
+ {
+ return $this->demeter->foo()->bar()->baz();
+ }
+ public function doitWithArgs()
+ {
+ return $this->demeter->foo("foo")->bar("bar")->baz("baz");
+ }
+}
+
+class MockeryTest_Foo
+{
+ public function foo()
+ {
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Fixtures/ClassWithAllLowerCaseMethod.php b/vendor/mockery/mockery/tests/Mockery/Fixtures/ClassWithAllLowerCaseMethod.php
new file mode 100644
index 000000000..2cf2b770e
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Fixtures/ClassWithAllLowerCaseMethod.php
@@ -0,0 +1,30 @@
+
+ {
+ return array('key' => true);
+ }
+
+ public function HHVMVoid() : ?void
+ {
+ return null;
+ }
+
+ public function HHVMMixed() : mixed
+ {
+ return null;
+ }
+
+ public function HHVMThis() : this
+ {
+ return $this;
+ }
+
+ public function HHVMString() : string
+ {
+ return 'a string';
+ }
+
+ public function HHVMImmVector() : ImmVector
+ {
+ return new ImmVector([1, 2, 3]);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Fixtures/MethodWithIterableTypeHints.php b/vendor/mockery/mockery/tests/Mockery/Fixtures/MethodWithIterableTypeHints.php
new file mode 100644
index 000000000..49739c604
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Fixtures/MethodWithIterableTypeHints.php
@@ -0,0 +1,29 @@
+assertTrue($target->hasInternalAncestor());
+
+ $target = new DefinedTargetClass(new \ReflectionClass("Mockery\MockeryTest_ClassThatExtendsArrayObject"));
+ $this->assertTrue($target->hasInternalAncestor());
+
+ $target = new DefinedTargetClass(new \ReflectionClass("Mockery\DefinedTargetClassTest"));
+ $this->assertFalse($target->hasInternalAncestor());
+ }
+}
+
+class MockeryTest_ClassThatExtendsArrayObject extends \ArrayObject
+{
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationBuilderTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationBuilderTest.php
new file mode 100644
index 000000000..ac48ac149
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationBuilderTest.php
@@ -0,0 +1,85 @@
+assertContains('__halt_compiler', $builder->getMockConfiguration()->getBlackListedMethods());
+
+ // need a builtin for this
+ $this->markTestSkipped("Need a builtin class with a method that is a reserved word");
+ }
+
+ /**
+ * @test
+ */
+ public function magicMethodsAreBlackListedByDefault()
+ {
+ $builder = new MockConfigurationBuilder;
+ $builder->addTarget(ClassWithMagicCall::class);
+ $methods = $builder->getMockConfiguration()->getMethodsToMock();
+ $this->assertCount(1, $methods);
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+
+ /** @test */
+ public function xdebugs_debug_info_is_black_listed_by_default()
+ {
+ $builder = new MockConfigurationBuilder;
+ $builder->addTarget(ClassWithDebugInfo::class);
+ $methods = $builder->getMockConfiguration()->getMethodsToMock();
+ $this->assertCount(1, $methods);
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+}
+
+class ClassWithMagicCall
+{
+ public function foo()
+ {
+ }
+
+ public function __call($method, $args)
+ {
+ }
+}
+
+class ClassWithDebugInfo
+{
+ public function foo()
+ {
+ }
+
+ public function __debugInfo()
+ {
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationTest.php
new file mode 100644
index 000000000..d32ac581e
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/MockConfigurationTest.php
@@ -0,0 +1,218 @@
+getMethodsToMock();
+ $this->assertCount(1, $methods);
+ $this->assertEquals("bar", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function blackListsAreCaseInsensitive()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array("FOO"));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertCount(1, $methods);
+ $this->assertEquals("bar", $methods[0]->getName());
+ }
+
+
+ /**
+ * @test
+ */
+ public function onlyWhiteListedMethodsShouldBeInListToBeMocked()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array(), array('foo'));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertCount(1, $methods);
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function whitelistOverRulesBlackList()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array("foo"), array("foo"));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertCount(1, $methods);
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function whiteListsAreCaseInsensitive()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array(), array("FOO"));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertCount(1, $methods);
+ $this->assertEquals("foo", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function finalMethodsAreExcluded()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\\ClassWithFinalMethod"));
+
+ $methods = $config->getMethodsToMock();
+ $this->assertCount(1, $methods);
+ $this->assertEquals("bar", $methods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function shouldIncludeMethodsFromAllTargets()
+ {
+ $config = new MockConfiguration(array("Mockery\\Generator\\TestInterface", "Mockery\\Generator\\TestInterface2"));
+ $methods = $config->getMethodsToMock();
+ $this->assertCount(2, $methods);
+ }
+
+ /**
+ * @test
+ * @expectedException Mockery\Exception
+ */
+ public function shouldThrowIfTargetClassIsFinal()
+ {
+ $config = new MockConfiguration(array("Mockery\\Generator\\TestFinal"));
+ $config->getTargetClass();
+ }
+
+ /**
+ * @test
+ */
+ public function shouldTargetIteratorAggregateIfTryingToMockTraversable()
+ {
+ $config = new MockConfiguration(array("\\Traversable"));
+
+ $interfaces = $config->getTargetInterfaces();
+ $this->assertCount(1, $interfaces);
+ $first = array_shift($interfaces);
+ $this->assertEquals("IteratorAggregate", $first->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function shouldTargetIteratorAggregateIfTraversableInTargetsTree()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface"));
+
+ $interfaces = $config->getTargetInterfaces();
+ $this->assertCount(2, $interfaces);
+ $this->assertEquals("IteratorAggregate", $interfaces[0]->getName());
+ $this->assertEquals("Mockery\Generator\TestTraversableInterface", $interfaces[1]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function shouldBringIteratorToHeadOfTargetListIfTraversablePresent()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface2"));
+
+ $interfaces = $config->getTargetInterfaces();
+ $this->assertCount(2, $interfaces);
+ $this->assertEquals("Iterator", $interfaces[0]->getName());
+ $this->assertEquals("Mockery\Generator\TestTraversableInterface2", $interfaces[1]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function shouldBringIteratorAggregateToHeadOfTargetListIfTraversablePresent()
+ {
+ $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface3"));
+
+ $interfaces = $config->getTargetInterfaces();
+ $this->assertCount(2, $interfaces);
+ $this->assertEquals("IteratorAggregate", $interfaces[0]->getName());
+ $this->assertEquals("Mockery\Generator\TestTraversableInterface3", $interfaces[1]->getName());
+ }
+}
+
+interface TestTraversableInterface extends \Traversable
+{
+}
+interface TestTraversableInterface2 extends \Traversable, \Iterator
+{
+}
+interface TestTraversableInterface3 extends \Traversable, \IteratorAggregate
+{
+}
+
+final class TestFinal
+{
+}
+
+interface TestInterface
+{
+ public function foo();
+}
+
+interface TestInterface2
+{
+ public function bar();
+}
+
+class TestSubject
+{
+ public function foo()
+ {
+ }
+
+ public function bar()
+ {
+ }
+}
+
+class ClassWithFinalMethod
+{
+ final public function foo()
+ {
+ }
+
+ public function bar()
+ {
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php
new file mode 100644
index 000000000..6ce54e961
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php
@@ -0,0 +1,59 @@
+ true,
+ ))->makePartial();
+ $code = $pass->apply(static::CODE, $config);
+ $this->assertContains('__call($method, $args)', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldRemoveCallStaticTypeHintIfRequired()
+ {
+ $pass = new CallTypeHintPass;
+ $config = m::mock("Mockery\Generator\MockConfiguration", array(
+ "requiresCallStaticTypeHintRemoval" => true,
+ ))->makePartial();
+ $code = $pass->apply(static::CODE, $config);
+ $this->assertContains('__callStatic($method, $args)', $code);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php
new file mode 100644
index 000000000..d9209b865
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php
@@ -0,0 +1,78 @@
+pass = new ClassNamePass();
+ }
+
+ /**
+ * @test
+ */
+ public function shouldRemoveNamespaceDefinition()
+ {
+ $config = new MockConfiguration(array(), array(), array(), "Dave\Dave");
+ $code = $this->pass->apply(static::CODE, $config);
+ $this->assertNotContains('namespace Mockery;', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldReplaceNamespaceIfClassNameIsNamespaced()
+ {
+ $config = new MockConfiguration(array(), array(), array(), "Dave\Dave");
+ $code = $this->pass->apply(static::CODE, $config);
+ $this->assertNotContains('namespace Mockery;', $code);
+ $this->assertContains('namespace Dave;', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldReplaceClassNameWithSpecifiedName()
+ {
+ $config = new MockConfiguration(array(), array(), array(), "Dave");
+ $code = $this->pass->apply(static::CODE, $config);
+ $this->assertContains('class Dave', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldRemoveLeadingBackslashesFromNamespace()
+ {
+ $config = new MockConfiguration(array(), array(), array(), "\Dave\Dave");
+ $code = $this->pass->apply(static::CODE, $config);
+ $this->assertContains('namespace Dave;', $code);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ConstantsPassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ConstantsPassTest.php
new file mode 100644
index 000000000..ae907bca8
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/ConstantsPassTest.php
@@ -0,0 +1,52 @@
+ ['FOO' => 'test']]
+ );
+ $code = $pass->apply(static::CODE, $config);
+ $this->assertContains("const FOO = 'test'", $code);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php
new file mode 100644
index 000000000..94be52666
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php
@@ -0,0 +1,45 @@
+setInstanceMock(true);
+ $config = $builder->getMockConfiguration();
+ $pass = new InstanceMockPass;
+ $code = $pass->apply('class Dave { }', $config);
+ $this->assertContains('public function __construct', $code);
+ $this->assertContains('protected $_mockery_ignoreVerification', $code);
+ $this->assertContains('this->_mockery_constructorCalled(func_get_args());', $code);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php
new file mode 100644
index 000000000..99301652a
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php
@@ -0,0 +1,66 @@
+ array(),
+ ));
+
+ $code = $pass->apply(static::CODE, $config);
+ $this->assertEquals(static::CODE, $code);
+ }
+
+ /**
+ * @test
+ */
+ public function shouldAddAnyInterfaceNamesToImplementsDefinition()
+ {
+ $pass = new InterfacePass;
+
+ $config = m::mock("Mockery\Generator\MockConfiguration", array(
+ "getTargetInterfaces" => array(
+ m::mock(array("getName" => "Dave\Dave")),
+ m::mock(array("getName" => "Paddy\Paddy")),
+ ),
+ ));
+
+ $code = $pass->apply(static::CODE, $config);
+
+ $this->assertContains("implements MockInterface, \Dave\Dave, \Paddy\Paddy", $code);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/GlobalHelpersTest.php b/vendor/mockery/mockery/tests/Mockery/GlobalHelpersTest.php
new file mode 100644
index 000000000..0f2b7c4a6
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/GlobalHelpersTest.php
@@ -0,0 +1,63 @@
+assertInstanceOf(\Mockery\MockInterface::class, $double);
+ $this->expectException(\Exception::class);
+ $double->foo();
+ }
+
+ /** @test */
+ public function spy_creates_a_spy()
+ {
+ $double = spy();
+
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $double);
+ $double->foo();
+ }
+
+ /** @test */
+ public function named_mock_creates_a_named_mock()
+ {
+ $className = "Class".uniqid();
+ $double = namedMock($className);
+
+ $this->assertInstanceOf(\Mockery\MockInterface::class, $double);
+ $this->assertInstanceOf($className, $double);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php b/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php
new file mode 100644
index 000000000..659397c0f
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/HamcrestExpectationTest.php
@@ -0,0 +1,62 @@
+mock = mock('foo');
+ }
+
+
+ public function tearDown()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ parent::tearDown();
+ }
+
+ /** Just a quickie roundup of a few Hamcrest matchers to check nothing obvious out of place **/
+
+ public function testAnythingConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(anything())->once();
+ $this->mock->foo(2);
+ }
+
+ public function testGreaterThanConstraintMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(greaterThan(1))->once();
+ $this->mock->foo(2);
+ }
+
+ /**
+ * @expectedException Mockery\Exception
+ */
+ public function testGreaterThanConstraintNotMatchesArgument()
+ {
+ $this->mock->shouldReceive('foo')->with(greaterThan(1));
+ $this->mock->foo(1);
+ Mockery::close();
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Loader/EvalLoaderTest.php b/vendor/mockery/mockery/tests/Mockery/Loader/EvalLoaderTest.php
new file mode 100644
index 000000000..025a1dab7
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Loader/EvalLoaderTest.php
@@ -0,0 +1,35 @@
+getLoader()->load($definition);
+
+ $this->assertTrue(class_exists($className));
+ }
+
+ abstract public function getLoader();
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Loader/RequireLoaderTest.php b/vendor/mockery/mockery/tests/Mockery/Loader/RequireLoaderTest.php
new file mode 100644
index 000000000..9f0664a34
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Loader/RequireLoaderTest.php
@@ -0,0 +1,35 @@
+assertionFailedError = '\PHPUnit\Framework\AssertionFailedError';
+ $this->frameworkConstraint = '\PHPUnit\Framework\Constraint';
+ } else {
+ $this->assertionFailedError = '\PHPUnit_Framework_AssertionFailedError';
+ $this->frameworkConstraint = '\PHPUnit_Framework_Constraint';
+ }
+
+ $this->constraint = \Mockery::mock($this->frameworkConstraint);
+ $this->matcher = new PHPUnitConstraint($this->constraint);
+ $this->rethrowingMatcher = new PHPUnitConstraint($this->constraint, true);
+ }
+
+ public function testMatches()
+ {
+ $value1 = 'value1';
+ $value2 = 'value1';
+ $value3 = 'value1';
+ $this->constraint
+ ->shouldReceive('evaluate')
+ ->once()
+ ->with($value1)
+ ->getMock()
+ ->shouldReceive('evaluate')
+ ->once()
+ ->with($value2)
+ ->andThrow($this->assertionFailedError)
+ ->getMock()
+ ->shouldReceive('evaluate')
+ ->once()
+ ->with($value3)
+ ->getMock()
+ ;
+ $this->assertTrue($this->matcher->match($value1));
+ $this->assertFalse($this->matcher->match($value2));
+ $this->assertTrue($this->rethrowingMatcher->match($value3));
+ }
+
+ public function testMatchesWhereNotMatchAndRethrowing()
+ {
+ $this->expectException($this->assertionFailedError);
+ $value = 'value';
+ $this->constraint
+ ->shouldReceive('evaluate')
+ ->once()
+ ->with($value)
+ ->andThrow($this->assertionFailedError)
+ ;
+ $this->rethrowingMatcher->match($value);
+ }
+
+ public function test__toString()
+ {
+ $this->assertEquals('', $this->matcher);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Matcher/SubsetTest.php b/vendor/mockery/mockery/tests/Mockery/Matcher/SubsetTest.php
new file mode 100644
index 000000000..e45e17cf3
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Matcher/SubsetTest.php
@@ -0,0 +1,97 @@
+ 123]);
+
+ $actual = [
+ 'foo' => 'bar',
+ 'dave' => 123,
+ 'bar' => 'baz',
+ ];
+
+ $this->assertTrue($matcher->match($actual));
+ }
+
+ /** @test */
+ public function it_recursively_matches()
+ {
+ $matcher = Subset::strict(['foo' => ['bar' => ['baz' => 123]]]);
+
+ $actual = [
+ 'foo' => [
+ 'bar' => [
+ 'baz' => 123,
+ ]
+ ],
+ 'dave' => 123,
+ 'bar' => 'baz',
+ ];
+
+ $this->assertTrue($matcher->match($actual));
+ }
+
+ /** @test */
+ public function it_is_strict_by_default()
+ {
+ $matcher = new Subset(['dave' => 123]);
+
+ $actual = [
+ 'foo' => 'bar',
+ 'dave' => 123.0,
+ 'bar' => 'baz',
+ ];
+
+ $this->assertFalse($matcher->match($actual));
+ }
+
+ /** @test */
+ public function it_can_run_a_loose_comparison()
+ {
+ $matcher = Subset::loose(['dave' => 123]);
+
+ $actual = [
+ 'foo' => 'bar',
+ 'dave' => 123.0,
+ 'bar' => 'baz',
+ ];
+
+ $this->assertTrue($matcher->match($actual));
+ }
+
+ /** @test */
+ public function it_returns_false_if_actual_is_not_an_array()
+ {
+ $matcher = new Subset(['dave' => 123]);
+
+ $actual = null;
+
+ $this->assertFalse($matcher->match($actual));
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockClassWithFinalWakeupTest.php b/vendor/mockery/mockery/tests/Mockery/MockClassWithFinalWakeupTest.php
new file mode 100644
index 000000000..f84b30d35
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockClassWithFinalWakeupTest.php
@@ -0,0 +1,94 @@
+
+ * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License
+ */
+
+namespace test\Mockery;
+
+use Mockery\Adapter\Phpunit\MockeryTestCase;
+
+class MockClassWithFinalWakeupTest extends MockeryTestCase
+{
+ protected function setUp()
+ {
+ $this->container = new \Mockery\Container;
+ }
+
+ protected function tearDown()
+ {
+ $this->container->mockery_close();
+ }
+
+ /**
+ * @test
+ *
+ * Test that we are able to create partial mocks of classes that have
+ * a __wakeup method marked as final. As long as __wakeup is not one of the
+ * mocked methods.
+ */
+ public function testCreateMockForClassWithFinalWakeup()
+ {
+ $mock = $this->container->mock("test\Mockery\TestWithFinalWakeup");
+ $this->assertInstanceOf("test\Mockery\TestWithFinalWakeup", $mock);
+ $this->assertEquals('test\Mockery\TestWithFinalWakeup::__wakeup', $mock->__wakeup());
+
+ $mock = $this->container->mock('test\Mockery\SubclassWithFinalWakeup');
+ $this->assertInstanceOf('test\Mockery\SubclassWithFinalWakeup', $mock);
+ $this->assertEquals('test\Mockery\TestWithFinalWakeup::__wakeup', $mock->__wakeup());
+ }
+
+ public function testCreateMockForClassWithNonFinalWakeup()
+ {
+ $mock = $this->container->mock('test\Mockery\TestWithNonFinalWakeup');
+ $this->assertInstanceOf('test\Mockery\TestWithNonFinalWakeup', $mock);
+
+ // Make sure __wakeup is overridden and doesn't return anything.
+ $this->assertNull($mock->__wakeup());
+ }
+}
+
+class TestWithFinalWakeup
+{
+ public function foo()
+ {
+ return 'foo';
+ }
+
+ public function bar()
+ {
+ return 'bar';
+ }
+
+ final public function __wakeup()
+ {
+ return __METHOD__;
+ }
+}
+
+class SubclassWithFinalWakeup extends TestWithFinalWakeup
+{
+}
+
+class TestWithNonFinalWakeup
+{
+ public function __wakeup()
+ {
+ return __METHOD__;
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockClassWithMethodOverloadingTest.php b/vendor/mockery/mockery/tests/Mockery/MockClassWithMethodOverloadingTest.php
new file mode 100644
index 000000000..b0284dc0c
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockClassWithMethodOverloadingTest.php
@@ -0,0 +1,43 @@
+makePartial();
+ $this->assertInstanceOf('test\Mockery\TestWithMethodOverloading', $mock);
+
+ // TestWithMethodOverloading::__call wouldn't be used. See Gotchas!.
+ $mock->randomMethod();
+ }
+
+ public function testCreateMockForClassWithMethodOverloadingWithExistingMethod()
+ {
+ $mock = mock('test\Mockery\TestWithMethodOverloading')
+ ->makePartial();
+ $this->assertInstanceOf('test\Mockery\TestWithMethodOverloading', $mock);
+
+ $this->assertSame(1, $mock->thisIsRealMethod());
+ }
+}
+
+class TestWithMethodOverloading
+{
+ public function __call($name, $arguments)
+ {
+ return 1;
+ }
+
+ public function thisIsRealMethod()
+ {
+ return 1;
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockClassWithUnknownTypeHintTest.php b/vendor/mockery/mockery/tests/Mockery/MockClassWithUnknownTypeHintTest.php
new file mode 100644
index 000000000..8706f8d79
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockClassWithUnknownTypeHintTest.php
@@ -0,0 +1,43 @@
+assertInstanceOf(MockInterface::class, $mock);
+ }
+}
+
+class HasUnknownClassAsTypeHintOnMethod
+{
+ public function foo(\UnknownTestClass\Bar $bar)
+ {
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockTest.php b/vendor/mockery/mockery/tests/Mockery/MockTest.php
new file mode 100644
index 000000000..15b4b7be3
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockTest.php
@@ -0,0 +1,219 @@
+allowMockingNonExistentMethods(false);
+ $m = mock();
+ $m->shouldReceive("test123")->andReturn(true);
+ assertThat($m->test123(), equalTo(true));
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ }
+
+ public function testMockWithNotAllowingMockingOfNonExistentMethodsCanBeGivenAdditionalMethodsToMockEvenIfTheyDontExistOnClass()
+ {
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $m = mock('ExampleClassForTestingNonExistentMethod');
+ $m->shouldAllowMockingMethod('testSomeNonExistentMethod');
+ $m->shouldReceive("testSomeNonExistentMethod")->andReturn(true);
+ assertThat($m->testSomeNonExistentMethod(), equalTo(true));
+ \Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ }
+
+ public function testShouldAllowMockingMethodReturnsMockInstance()
+ {
+ $m = Mockery::mock('someClass');
+ $this->assertInstanceOf('Mockery\MockInterface', $m->shouldAllowMockingMethod('testFunction'));
+ }
+
+ public function testShouldAllowMockingProtectedMethodReturnsMockInstance()
+ {
+ $m = Mockery::mock('someClass');
+ $this->assertInstanceOf('Mockery\MockInterface', $m->shouldAllowMockingProtectedMethods('testFunction'));
+ }
+
+ public function testMockAddsToString()
+ {
+ $mock = mock('ClassWithNoToString');
+ $this->assertTrue(method_exists($mock, '__toString'));
+ }
+
+ public function testMockToStringMayBeDeferred()
+ {
+ $mock = mock('ClassWithToString')->makePartial();
+ $this->assertEquals("foo", (string)$mock);
+ }
+
+ public function testMockToStringShouldIgnoreMissingAlwaysReturnsString()
+ {
+ $mock = mock('ClassWithNoToString')->shouldIgnoreMissing();
+ $this->assertNotEquals('', (string)$mock);
+
+ $mock->asUndefined();
+ $this->assertNotEquals('', (string)$mock);
+ }
+
+ public function testShouldIgnoreMissing()
+ {
+ $mock = mock('ClassWithNoToString')->shouldIgnoreMissing();
+ $this->assertNull($mock->nonExistingMethod());
+ }
+
+ /**
+ * @expectedException Mockery\Exception
+ */
+ public function testShouldIgnoreMissingDisallowMockingNonExistentMethodsUsingGlobalConfiguration()
+ {
+ Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = mock('ClassWithMethods')->shouldIgnoreMissing();
+ $mock->shouldReceive('nonExistentMethod');
+ }
+
+ /**
+ * @expectedException BadMethodCallException
+ */
+ public function testShouldIgnoreMissingCallingNonExistentMethodsUsingGlobalConfiguration()
+ {
+ Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = mock('ClassWithMethods')->shouldIgnoreMissing();
+ $mock->nonExistentMethod();
+ }
+
+ public function testShouldIgnoreMissingCallingExistentMethods()
+ {
+ Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
+ $mock = mock('ClassWithMethods')->shouldIgnoreMissing();
+ assertThat(nullValue($mock->foo()));
+ $mock->shouldReceive('bar')->passthru();
+ assertThat($mock->bar(), equalTo('bar'));
+ }
+
+ public function testShouldIgnoreMissingCallingNonExistentMethods()
+ {
+ Mockery::getConfiguration()->allowMockingNonExistentMethods(true);
+ $mock = mock('ClassWithMethods')->shouldIgnoreMissing();
+ assertThat(nullValue($mock->foo()));
+ assertThat(nullValue($mock->bar()));
+ assertThat(nullValue($mock->nonExistentMethod()));
+
+ $mock->shouldReceive(array('foo' => 'new_foo', 'nonExistentMethod' => 'result'));
+ $mock->shouldReceive('bar')->passthru();
+ assertThat($mock->foo(), equalTo('new_foo'));
+ assertThat($mock->bar(), equalTo('bar'));
+ assertThat($mock->nonExistentMethod(), equalTo('result'));
+ }
+
+ public function testCanMockException()
+ {
+ $exception = Mockery::mock('Exception');
+ $this->assertInstanceOf('Exception', $exception);
+ }
+
+ public function testCanMockSubclassOfException()
+ {
+ $errorException = Mockery::mock('ErrorException');
+ $this->assertInstanceOf('ErrorException', $errorException);
+ $this->assertInstanceOf('Exception', $errorException);
+ }
+
+ public function testCallingShouldReceiveWithoutAValidMethodName()
+ {
+ $mock = Mockery::mock();
+
+ $this->expectException("InvalidArgumentException", "Received empty method name");
+ $mock->shouldReceive("");
+ }
+
+ /**
+ * @expectedException Mockery\Exception
+ */
+ public function testShouldThrowExceptionWithInvalidClassName()
+ {
+ mock('ClassName.CannotContainDot');
+ }
+
+
+ /** @test */
+ public function expectation_count_will_count_expectations()
+ {
+ $mock = new Mock();
+ $mock->shouldReceive("doThis")->once();
+ $mock->shouldReceive("doThat")->once();
+
+ $this->assertEquals(2, $mock->mockery_getExpectationCount());
+ }
+
+ /** @test */
+ public function expectation_count_will_ignore_defaults_if_overriden()
+ {
+ $mock = new Mock();
+ $mock->shouldReceive("doThis")->once()->byDefault();
+ $mock->shouldReceive("doThis")->twice();
+ $mock->shouldReceive("andThis")->twice();
+
+ $this->assertEquals(2, $mock->mockery_getExpectationCount());
+ }
+
+ /** @test */
+ public function expectation_count_will_count_defaults_if_not_overriden()
+ {
+ $mock = new Mock();
+ $mock->shouldReceive("doThis")->once()->byDefault();
+ $mock->shouldReceive("doThat")->once()->byDefault();
+
+ $this->assertEquals(2, $mock->mockery_getExpectationCount());
+ }
+}
+
+
+class ExampleClassForTestingNonExistentMethod
+{
+}
+
+class ClassWithToString
+{
+ public function __toString()
+ {
+ return 'foo';
+ }
+}
+
+class ClassWithNoToString
+{
+}
+
+class ClassWithMethods
+{
+ public function foo()
+ {
+ return 'foo';
+ }
+
+ public function bar()
+ {
+ return 'bar';
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php b/vendor/mockery/mockery/tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php
new file mode 100644
index 000000000..fe8ed916c
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php
@@ -0,0 +1,28 @@
+shouldReceive("include")->andReturn("foo");
+
+ $this->assertTrue(method_exists($mock, "include"));
+ $this->assertEquals("foo", $mock->include());
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php b/vendor/mockery/mockery/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php
new file mode 100644
index 000000000..6f494283c
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php
@@ -0,0 +1,65 @@
+mock('Mockery\Tests\Evenement_EventEmitter', 'Mockery\Tests\Chatroulette_ConnectionInterface');
+ }
+}
+
+interface Evenement_EventEmitterInterface
+{
+ public function on($name, $callback);
+}
+
+class Evenement_EventEmitter implements Evenement_EventEmitterInterface
+{
+ public function on($name, $callback)
+ {
+ }
+}
+
+interface React_StreamInterface extends Evenement_EventEmitterInterface
+{
+ public function close();
+}
+
+interface React_ReadableStreamInterface extends React_StreamInterface
+{
+ public function pause();
+}
+
+interface React_WritableStreamInterface extends React_StreamInterface
+{
+ public function write($data);
+}
+
+interface Chatroulette_ConnectionInterface extends React_ReadableStreamInterface, React_WritableStreamInterface
+{
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingAllLowerCasedMethodsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingAllLowerCasedMethodsTest.php
new file mode 100644
index 000000000..295ae6ca8
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingAllLowerCasedMethodsTest.php
@@ -0,0 +1,43 @@
+shouldReceive('userExpectsCamelCaseMethod')
+ ->andReturn('mocked');
+
+ $result = $mock->userExpectsCamelCaseMethod();
+
+ $expected = 'mocked';
+
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingClassConstantsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingClassConstantsTest.php
new file mode 100644
index 000000000..4cb7b839c
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingClassConstantsTest.php
@@ -0,0 +1,43 @@
+setConstantsMap([
+ 'ClassWithConstants' => [
+ 'FOO' => 'baz',
+ 'X' => 2,
+ ]
+ ]);
+
+ $mock = \Mockery::mock('overload:ClassWithConstants');
+
+ self::assertEquals('baz', $mock::FOO);
+ self::assertEquals(2, $mock::X);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingHHVMMethodsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingHHVMMethodsTest.php
new file mode 100644
index 000000000..7377f1608
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingHHVMMethodsTest.php
@@ -0,0 +1,107 @@
+isHHVM()) {
+ $this->markTestSkipped('For HHVM test only');
+ }
+
+ parent::setUp();
+
+ require_once __DIR__."/Fixtures/MethodWithHHVMReturnType.php";
+ }
+
+ /** @test */
+ public function it_strip_hhvm_array_return_types()
+ {
+ $mock = mock('test\Mockery\Fixtures\MethodWithHHVMReturnType');
+
+ $mock->shouldReceive('nullableHHVMArray')->andReturn(array('key' => true));
+ $mock->nullableHHVMArray();
+ }
+
+ /** @test */
+ public function it_strip_hhvm_void_return_types()
+ {
+ $mock = mock('test\Mockery\Fixtures\MethodWithHHVMReturnType');
+
+ $mock->shouldReceive('HHVMVoid')->andReturnNull();
+ $mock->HHVMVoid();
+ }
+
+ /** @test */
+ public function it_strip_hhvm_mixed_return_types()
+ {
+ $mock = mock('test\Mockery\Fixtures\MethodWithHHVMReturnType');
+
+ $mock->shouldReceive('HHVMMixed')->andReturnNull();
+ $mock->HHVMMixed();
+ }
+
+ /** @test */
+ public function it_strip_hhvm_this_return_types()
+ {
+ $mock = mock('test\Mockery\Fixtures\MethodWithHHVMReturnType');
+
+ $mock->shouldReceive('HHVMThis')->andReturn(new MethodWithHHVMReturnType());
+ $mock->HHVMThis();
+ }
+
+ /** @test */
+ public function it_allow_hhvm_string_return_types()
+ {
+ $mock = mock('test\Mockery\Fixtures\MethodWithHHVMReturnType');
+
+ $mock->shouldReceive('HHVMString')->andReturn('a string');
+ $mock->HHVMString();
+ }
+
+ /** @test */
+ public function it_allow_hhvm_imm_vector_return_types()
+ {
+ $mock = mock('test\Mockery\Fixtures\MethodWithHHVMReturnType');
+
+ $mock->shouldReceive('HHVMImmVector')->andReturn(new \HH\ImmVector([1, 2, 3]));
+ $mock->HHVMImmVector();
+ }
+
+ /**
+ * Returns true when it is HHVM.
+ */
+ private function isHHVM()
+ {
+ return \defined('HHVM_VERSION');
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingMethodsWithIterableTypeHintsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingMethodsWithIterableTypeHintsTest.php
new file mode 100644
index 000000000..34ef54c00
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingMethodsWithIterableTypeHintsTest.php
@@ -0,0 +1,39 @@
+assertInstanceOf(\test\Mockery\Fixtures\MethodWithIterableTypeHints::class, $mock);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingMethodsWithNullableParametersTest.php b/vendor/mockery/mockery/tests/Mockery/MockingMethodsWithNullableParametersTest.php
new file mode 100644
index 000000000..e3aa76759
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingMethodsWithNullableParametersTest.php
@@ -0,0 +1,52 @@
+assertInstanceOf(\test\Mockery\Fixtures\MethodWithNullableTypedParameter::class, $mock);
+ }
+
+ /**
+ * @test
+ */
+ public function it_can_handle_default_parameters()
+ {
+ require __DIR__."/Fixtures/MethodWithParametersWithDefaultValues.php";
+ $mock = mock("test\Mockery\Fixtures\MethodWithParametersWithDefaultValues");
+
+ $this->assertInstanceOf(\test\Mockery\Fixtures\MethodWithParametersWithDefaultValues::class, $mock);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingNullableMethodsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingNullableMethodsTest.php
new file mode 100644
index 000000000..9b7bdc24a
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingNullableMethodsTest.php
@@ -0,0 +1,217 @@
+shouldReceive('nonNullablePrimitive')->andReturn('a string');
+ $mock->nonNullablePrimitive();
+ }
+
+ /**
+ * @test
+ * @expectedException \TypeError
+ */
+ public function itShouldNotAllowNonNullToBeNull()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nonNullablePrimitive')->andReturn(null);
+ $mock->nonNullablePrimitive();
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAllowPrimitiveNullableToBeNull()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nullablePrimitive')->andReturn(null);
+ $mock->nullablePrimitive();
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAllowPrimitiveNullabeToBeSet()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nullablePrimitive')->andReturn('a string');
+ $mock->nullablePrimitive();
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAllowSelfToBeSet()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nonNullableSelf')->andReturn(new MethodWithNullableReturnType());
+ $mock->nonNullableSelf();
+ }
+
+ /**
+ * @test
+ * @expectedException \TypeError
+ */
+ public function itShouldNotAllowSelfToBeNull()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nonNullableSelf')->andReturn(null);
+ $mock->nonNullableSelf();
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAllowNullableSelfToBeSet()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nullableSelf')->andReturn(new MethodWithNullableReturnType());
+ $mock->nullableSelf();
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAllowNullableSelfToBeNull()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nullableSelf')->andReturn(null);
+ $mock->nullableSelf();
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAllowClassToBeSet()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nonNullableClass')->andReturn(new MethodWithNullableReturnType());
+ $mock->nonNullableClass();
+ }
+
+ /**
+ * @test
+ * @expectedException \TypeError
+ */
+ public function itShouldNotAllowClassToBeNull()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nonNullableClass')->andReturn(null);
+ $mock->nonNullableClass();
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAllowNullalbeClassToBeSet()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nullableClass')->andReturn(new MethodWithNullableReturnType());
+ $mock->nullableClass();
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAllowNullableClassToBeNull()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
+
+ $mock->shouldReceive('nullableClass')->andReturn(null);
+ $mock->nullableClass();
+ }
+
+ /** @test */
+ public function it_allows_returning_null_for_nullable_object_return_types()
+ {
+ $double= \Mockery::mock(MethodWithNullableReturnType::class);
+
+ $double->shouldReceive("nullableClass")->andReturnNull();
+
+ $this->assertNull($double->nullableClass());
+ }
+
+ /** @test */
+ public function it_allows_returning_null_for_nullable_string_return_types()
+ {
+ $double= \Mockery::mock(MethodWithNullableReturnType::class);
+
+ $double->shouldReceive("nullableString")->andReturnNull();
+
+ $this->assertNull($double->nullableString());
+ }
+
+ /** @test */
+ public function it_allows_returning_null_for_nullable_int_return_types()
+ {
+ $double= \Mockery::mock(MethodWithNullableReturnType::class);
+
+ $double->shouldReceive("nullableInt")->andReturnNull();
+
+ $this->assertNull($double->nullableInt());
+ }
+
+ /** @test */
+ public function it_returns_null_on_calls_to_ignored_methods_of_spies_if_return_type_is_nullable()
+ {
+ $double = \Mockery::spy(MethodWithNullableReturnType::class);
+
+ $this->assertNull($double->nullableClass());
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingProtectedMethodsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingProtectedMethodsTest.php
new file mode 100644
index 000000000..7810d1bf4
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingProtectedMethodsTest.php
@@ -0,0 +1,133 @@
+assertEquals("bar", $mock->bar());
+ }
+
+ /**
+ * @test
+ *
+ * This is a regression test, basically we don't want the mock handling
+ * interfering with calling protected methods partials
+ */
+ public function shouldAutomaticallyDeferCallsToProtectedMethodsForRuntimePartials()
+ {
+ $mock = mock("test\Mockery\TestWithProtectedMethods")->makePartial();
+ $this->assertEquals("bar", $mock->bar());
+ }
+
+ /** @test */
+ public function shouldAutomaticallyIgnoreAbstractProtectedMethods()
+ {
+ $mock = mock("test\Mockery\TestWithProtectedMethods")->makePartial();
+ $this->assertNull($mock->foo());
+ }
+
+ /** @test */
+ public function shouldAllowMockingProtectedMethods()
+ {
+ $mock = mock("test\Mockery\TestWithProtectedMethods")
+ ->makePartial()
+ ->shouldAllowMockingProtectedMethods();
+
+ $mock->shouldReceive("protectedBar")->andReturn("notbar");
+ $this->assertEquals("notbar", $mock->bar());
+ }
+
+ /** @test */
+ public function shouldAllowMockingProtectedMethodOnDefinitionTimePartial()
+ {
+ $mock = mock("test\Mockery\TestWithProtectedMethods[protectedBar]")
+ ->shouldAllowMockingProtectedMethods();
+
+ $mock->shouldReceive("protectedBar")->andReturn("notbar");
+ $this->assertEquals("notbar", $mock->bar());
+ }
+
+ /** @test */
+ public function shouldAllowMockingAbstractProtectedMethods()
+ {
+ $mock = mock("test\Mockery\TestWithProtectedMethods")
+ ->makePartial()
+ ->shouldAllowMockingProtectedMethods();
+
+ $mock->shouldReceive("abstractProtected")->andReturn("abstractProtected");
+ $this->assertEquals("abstractProtected", $mock->foo());
+ }
+
+ /** @test */
+ public function shouldAllowMockingIncreasedVisabilityMethods()
+ {
+ $mock = mock("test\Mockery\TestIncreasedVisibilityChild");
+ $mock->shouldReceive('foobar')->andReturn("foobar");
+ $this->assertEquals('foobar', $mock->foobar());
+ }
+}
+
+
+abstract class TestWithProtectedMethods
+{
+ public function foo()
+ {
+ return $this->abstractProtected();
+ }
+
+ abstract protected function abstractProtected();
+
+ public function bar()
+ {
+ return $this->protectedBar();
+ }
+
+ protected function protectedBar()
+ {
+ return 'bar';
+ }
+}
+
+class TestIncreasedVisibilityParent
+{
+ protected function foobar()
+ {
+ }
+}
+
+class TestIncreasedVisibilityChild extends TestIncreasedVisibilityParent
+{
+ public function foobar()
+ {
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingVariadicArgumentsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingVariadicArgumentsTest.php
new file mode 100644
index 000000000..a940f63ad
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingVariadicArgumentsTest.php
@@ -0,0 +1,45 @@
+shouldReceive("foo")->andReturn("notbar");
+ $this->assertEquals("notbar", $mock->foo());
+ }
+}
+
+
+abstract class TestWithVariadicArguments
+{
+ public function foo(...$bar)
+ {
+ return $bar;
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/MockingVoidMethodsTest.php b/vendor/mockery/mockery/tests/Mockery/MockingVoidMethodsTest.php
new file mode 100644
index 000000000..f1f167a13
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/MockingVoidMethodsTest.php
@@ -0,0 +1,53 @@
+assertInstanceOf(\test\Mockery\Fixtures\MethodWithVoidReturnType::class, $mock);
+ }
+
+ /** @test */
+ public function it_can_stub_and_mock_void_methods()
+ {
+ $mock = mock("test\Mockery\Fixtures\MethodWithVoidReturnType");
+
+ $mock->shouldReceive("foo");
+ $mock->foo();
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/NamedMockTest.php b/vendor/mockery/mockery/tests/Mockery/NamedMockTest.php
new file mode 100644
index 000000000..b39355f20
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/NamedMockTest.php
@@ -0,0 +1,86 @@
+assertInstanceOf("Mockery\Dave123", $mock);
+ }
+
+ /** @test */
+ public function itCreatesPassesFurtherArgumentsJustLikeMock()
+ {
+ $mock = Mockery::namedMock("Mockery\Dave456", "DateTime", array(
+ "getDave" => "dave"
+ ));
+
+ $this->assertInstanceOf("DateTime", $mock);
+ $this->assertEquals("dave", $mock->getDave());
+ }
+
+ /**
+ * @test
+ * @expectedException Mockery\Exception
+ * @expectedExceptionMessage The mock named 'Mockery\Dave7' has been already defined with a different mock configuration
+ */
+ public function itShouldThrowIfAttemptingToRedefineNamedMock()
+ {
+ $mock = Mockery::namedMock("Mockery\Dave7");
+ $mock = Mockery::namedMock("Mockery\Dave7", "DateTime");
+ }
+
+ /** @test */
+ public function itCreatesConcreteMethodImplementationWithReturnType()
+ {
+ $cactus = new \Nature\Plant();
+ $gardener = Mockery::namedMock(
+ "NewNamespace\\ClassName",
+ "Gardener",
+ array('water' => true)
+ );
+ $this->assertTrue($gardener->water($cactus));
+ }
+
+ /**
+ * @test
+ * @requires PHP 7.0.0
+ */
+ public function it_gracefully_handles_namespacing()
+ {
+ $animal = Mockery::namedMock(
+ uniqid(Animal::class, false),
+ Animal::class
+ );
+
+ $animal->shouldReceive("habitat")->andReturn(new Habitat());
+
+ $this->assertInstanceOf(Habitat::class, $animal->habitat());
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/SpyTest.php b/vendor/mockery/mockery/tests/Mockery/SpyTest.php
new file mode 100644
index 000000000..73de84c0b
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/SpyTest.php
@@ -0,0 +1,152 @@
+myMethod();
+ $spy->shouldHaveReceived("myMethod");
+
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ $spy->shouldHaveReceived("someMethodThatWasNotCalled");
+ }
+
+ /** @test */
+ public function itVerifiesAMethodWasNotCalled()
+ {
+ $spy = m::spy();
+ $spy->shouldNotHaveReceived("myMethod");
+
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ $spy->myMethod();
+ $spy->shouldNotHaveReceived("myMethod");
+ }
+
+ /** @test */
+ public function itVerifiesAMethodWasNotCalledWithParticularArguments()
+ {
+ $spy = m::spy();
+ $spy->myMethod(123, 456);
+
+ $spy->shouldNotHaveReceived("myMethod", array(789, 10));
+
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ $spy->shouldNotHaveReceived("myMethod", array(123, 456));
+ }
+
+ /** @test */
+ public function itVerifiesAMethodWasCalledASpecificNumberOfTimes()
+ {
+ $spy = m::spy();
+ $spy->myMethod();
+ $spy->myMethod();
+ $spy->shouldHaveReceived("myMethod")->twice();
+
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ $spy->myMethod();
+ $spy->shouldHaveReceived("myMethod")->twice();
+ }
+
+ /** @test */
+ public function itVerifiesAMethodWasCalledWithSpecificArguments()
+ {
+ $spy = m::spy();
+ $spy->myMethod(123, "a string");
+ $spy->shouldHaveReceived("myMethod")->with(123, "a string");
+ $spy->shouldHaveReceived("myMethod", array(123, "a string"));
+
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ $spy->shouldHaveReceived("myMethod")->with(123);
+ }
+
+ /** @test */
+ public function itIncrementsExpectationCountWhenShouldHaveReceivedIsUsed()
+ {
+ $spy = m::spy();
+ $spy->myMethod('param1', 'param2');
+ $spy->shouldHaveReceived('myMethod')->with('param1', 'param2');
+ $this->assertEquals(1, $spy->mockery_getExpectationCount());
+ }
+
+ /** @test */
+ public function itIncrementsExpectationCountWhenShouldNotHaveReceivedIsUsed()
+ {
+ $spy = m::spy();
+ $spy->shouldNotHaveReceived('method');
+ $this->assertEquals(1, $spy->mockery_getExpectationCount());
+ }
+
+ /** @test */
+ public function any_args_can_be_used_with_alternative_syntax()
+ {
+ $spy = m::spy();
+ $spy->foo(123, 456);
+
+ $spy->shouldHaveReceived()->foo(anyArgs());
+ }
+
+ /** @test */
+ public function should_have_received_higher_order_message_call_a_method_with_correct_arguments()
+ {
+ $spy = m::spy();
+ $spy->foo(123);
+
+ $spy->shouldHaveReceived()->foo(123);
+ }
+
+ /** @test */
+ public function should_have_received_higher_order_message_call_a_method_with_incorrect_arguments_throws_exception()
+ {
+ $spy = m::spy();
+ $spy->foo(123);
+
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ $spy->shouldHaveReceived()->foo(456);
+ }
+
+ /** @test */
+ public function should_not_have_received_higher_order_message_call_a_method_with_incorrect_arguments()
+ {
+ $spy = m::spy();
+ $spy->foo(123);
+
+ $spy->shouldNotHaveReceived()->foo(456);
+ }
+
+ /** @test */
+ public function should_not_have_received_higher_order_message_call_a_method_with_correct_arguments_throws_an_exception()
+ {
+ $spy = m::spy();
+ $spy->foo(123);
+
+ $this->expectException("Mockery\Exception\InvalidCountException");
+ $spy->shouldNotHaveReceived()->foo(123);
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/Stubs/Animal.php b/vendor/mockery/mockery/tests/Mockery/Stubs/Animal.php
new file mode 100644
index 000000000..50de12939
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/Stubs/Animal.php
@@ -0,0 +1,29 @@
+assertEquals('bar', $trait->foo());
+ }
+
+ /** @test */
+ public function it_creates_abstract_methods_as_necessary()
+ {
+ $trait = mock(TraitWithAbstractMethod::class, ['doBaz' => 'baz']);
+
+ $this->assertEquals('baz', $trait->baz());
+ }
+
+ /** @test */
+ public function it_can_create_an_object_using_multiple_traits()
+ {
+ $trait = mock(SimpleTrait::class, TraitWithAbstractMethod::class, [
+ 'doBaz' => 123,
+ ]);
+
+ $this->assertEquals('bar', $trait->foo());
+ $this->assertEquals(123, $trait->baz());
+ }
+}
+
+trait SimpleTrait
+{
+ public function foo()
+ {
+ return 'bar';
+ }
+}
+
+trait TraitWithAbstractMethod
+{
+ public function baz()
+ {
+ return $this->doBaz();
+ }
+
+ abstract public function doBaz();
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/WithFormatterExpectationTest.php b/vendor/mockery/mockery/tests/Mockery/WithFormatterExpectationTest.php
new file mode 100644
index 000000000..2e3c4f922
--- /dev/null
+++ b/vendor/mockery/mockery/tests/Mockery/WithFormatterExpectationTest.php
@@ -0,0 +1,123 @@
+assertEquals(
+ $expected,
+ Mockery::formatObjects($args)
+ );
+ }
+
+ /**
+ * @expectedException Mockery\Exception\NoMatchingExpectationException
+ *
+ * Note that without the patch checked in with this test, rather than throwing
+ * an exception, the program will go into an infinite recursive loop
+ */
+ public function testFormatObjectsWithMockCalledInGetterDoesNotLeadToRecursion()
+ {
+ $mock = Mockery::mock('stdClass');
+ $mock->shouldReceive('doBar')->with('foo');
+ $obj = new ClassWithGetter($mock);
+ $obj->getFoo();
+ }
+
+ public function formatObjectsDataProvider()
+ {
+ return array(
+ array(
+ array(null),
+ ''
+ ),
+ array(
+ array('a string', 98768, array('a', 'nother', 'array')),
+ ''
+ ),
+ );
+ }
+
+ /** @test */
+ public function format_objects_should_not_call_getters_with_params()
+ {
+ $obj = new ClassWithGetterWithParam();
+ $string = Mockery::formatObjects(array($obj));
+
+ $this->assertNotContains('Missing argument 1 for', $string);
+ }
+
+ public function testFormatObjectsExcludesStaticProperties()
+ {
+ $obj = new ClassWithPublicStaticProperty();
+ $string = Mockery::formatObjects(array($obj));
+
+ $this->assertNotContains('excludedProperty', $string);
+ }
+
+ public function testFormatObjectsExcludesStaticGetters()
+ {
+ $obj = new ClassWithPublicStaticGetter();
+ $string = Mockery::formatObjects(array($obj));
+
+ $this->assertNotContains('getExcluded', $string);
+ }
+}
+
+class ClassWithGetter
+{
+ private $dep;
+
+ public function __construct($dep)
+ {
+ $this->dep = $dep;
+ }
+
+ public function getFoo()
+ {
+ return $this->dep->doBar('bar', $this);
+ }
+}
+
+class ClassWithGetterWithParam
+{
+ public function getBar($bar)
+ {
+ }
+}
+
+class ClassWithPublicStaticProperty
+{
+ public static $excludedProperty;
+}
+
+class ClassWithPublicStaticGetter
+{
+ public static function getExcluded()
+ {
+ }
+}
diff --git a/vendor/mockery/mockery/tests/Mockery/_files/file.txt b/vendor/mockery/mockery/tests/Mockery/_files/file.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/mockery/mockery/tests/PHP56/MockingOldStyleConstructorTest.php b/vendor/mockery/mockery/tests/PHP56/MockingOldStyleConstructorTest.php
new file mode 100644
index 000000000..89e66c07b
--- /dev/null
+++ b/vendor/mockery/mockery/tests/PHP56/MockingOldStyleConstructorTest.php
@@ -0,0 +1,44 @@
+assertInstanceOf(MockInterface::class, mock('MockeryTest_OldStyleConstructor'));
+ }
+}
+
+class MockeryTest_OldStyleConstructor
+{
+ public function MockeryTest_OldStyleConstructor($arg)
+ {
+ }
+}
diff --git a/vendor/mockery/mockery/tests/PHP70/Generator/StringManipulation/Pass/MagicMethodTypeHintsPassTest.php b/vendor/mockery/mockery/tests/PHP70/Generator/StringManipulation/Pass/MagicMethodTypeHintsPassTest.php
new file mode 100644
index 000000000..a1957ff19
--- /dev/null
+++ b/vendor/mockery/mockery/tests/PHP70/Generator/StringManipulation/Pass/MagicMethodTypeHintsPassTest.php
@@ -0,0 +1,392 @@
+pass = new MagicMethodTypeHintsPass;
+ $this->mockedConfiguration = m::mock(
+ 'Mockery\Generator\MockConfiguration'
+ );
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldWork()
+ {
+ $this->assertTrue(true);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldGrabClassMagicMethods()
+ {
+ $targetClass = DefinedTargetClass::factory(
+ 'Mockery\Test\Generator\StringManipulation\Pass\MagicDummy'
+ );
+ $magicMethods = $this->pass->getMagicMethods($targetClass);
+
+ $this->assertCount(6, $magicMethods);
+ $this->assertEquals('__isset', $magicMethods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldGrabInterfaceMagicMethods()
+ {
+ $targetClass = DefinedTargetClass::factory(
+ 'Mockery\Test\Generator\StringManipulation\Pass\MagicInterfaceDummy'
+ );
+ $magicMethods = $this->pass->getMagicMethods($targetClass);
+
+ $this->assertCount(6, $magicMethods);
+ $this->assertEquals('__isset', $magicMethods[0]->getName());
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAddStringTypeHintOnMagicMethod()
+ {
+ $this->configureForClass();
+ $code = $this->pass->apply(
+ 'public function __isset($name) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('string $name', $code);
+
+ $this->configureForInterface();
+ $code = $this->pass->apply(
+ 'public function __isset($name) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('string $name', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAddStringTypeHintOnAllMagicMethods()
+ {
+ $this->configureForInterfaces([
+ 'Mockery\Test\Generator\StringManipulation\Pass\MagicInterfaceDummy',
+ 'Mockery\Test\Generator\StringManipulation\Pass\MagicUnsetInterfaceDummy'
+ ]);
+ $code = $this->pass->apply(
+ 'public function __isset($name) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('string $name', $code);
+ $code = $this->pass->apply(
+ 'public function __unset($name) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('string $name', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAddBooleanReturnOnMagicMethod()
+ {
+ $this->configureForClass();
+ $code = $this->pass->apply(
+ 'public function __isset($name) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains(' : bool', $code);
+
+ $this->configureForInterface();
+ $code = $this->pass->apply(
+ 'public function __isset($name) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains(' : bool', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAddTypeHintsOnToStringMethod()
+ {
+ $this->configureForClass();
+ $code = $this->pass->apply(
+ 'public function __toString() {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains(' : string', $code);
+
+ $this->configureForInterface();
+ $code = $this->pass->apply(
+ 'public function __toString() {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains(' : string', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAddTypeHintsOnCallMethod()
+ {
+ $this->configureForClass();
+ $code = $this->pass->apply(
+ 'public function __call($method, array $args) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('string $method', $code);
+
+ $this->configureForInterface();
+ $code = $this->pass->apply(
+ 'public function __call($method, array $args) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('string $method', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldAddTypeHintsOnCallStaticMethod()
+ {
+ $this->configureForClass();
+ $code = $this->pass->apply(
+ 'public static function __callStatic($method, array $args) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('string $method', $code);
+
+ $this->configureForInterface();
+ $code = $this->pass->apply(
+ 'public static function __callStatic($method, array $args) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('string $method', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldNotAddReturnTypeHintIfOneIsNotFound()
+ {
+ $this->configureForClass('Mockery\Test\Generator\StringManipulation\Pass\MagicReturnDummy');
+ $code = $this->pass->apply(
+ 'public static function __isset($parameter) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains(') {', $code);
+
+ $this->configureForInterface('Mockery\Test\Generator\StringManipulation\Pass\MagicReturnInterfaceDummy');
+ $code = $this->pass->apply(
+ 'public static function __isset($parameter) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains(') {', $code);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldReturnEmptyArrayIfClassDoesNotHaveMagicMethods()
+ {
+ $targetClass = DefinedTargetClass::factory(
+ '\StdClass'
+ );
+ $magicMethods = $this->pass->getMagicMethods($targetClass);
+ $this->assertInternalType('array', $magicMethods);
+ $this->assertEmpty($magicMethods);
+ }
+
+ /**
+ * @test
+ */
+ public function itShouldReturnEmptyArrayIfClassTypeIsNotExpected()
+ {
+ $magicMethods = $this->pass->getMagicMethods(null);
+ $this->assertInternalType('array', $magicMethods);
+ $this->assertEmpty($magicMethods);
+ }
+
+ /**
+ * Tests if the pass correclty replaces all the magic
+ * method parameters with those found in the
+ * Mock class. This is made to avoid variable
+ * conflicts withing Mock's magic methods
+ * implementations.
+ *
+ * @test
+ */
+ public function itShouldGrabAndReplaceAllParametersWithTheCodeStringMatches()
+ {
+ $this->configureForClass();
+ $code = $this->pass->apply(
+ 'public function __call($method, array $args) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('$method', $code);
+ $this->assertContains('array $args', $code);
+
+ $this->configureForInterface();
+ $code = $this->pass->apply(
+ 'public function __call($method, array $args) {}',
+ $this->mockedConfiguration
+ );
+ $this->assertContains('$method', $code);
+ $this->assertContains('array $args', $code);
+ }
+
+ protected function configureForClass(string $className = 'Mockery\Test\Generator\StringManipulation\Pass\MagicDummy')
+ {
+ $targetClass = DefinedTargetClass::factory($className);
+
+ $this->mockedConfiguration
+ ->shouldReceive('getTargetClass')
+ ->andReturn($targetClass)
+ ->byDefault();
+ $this->mockedConfiguration
+ ->shouldReceive('getTargetInterfaces')
+ ->andReturn([])
+ ->byDefault();
+ }
+
+ protected function configureForInterface(string $interfaceName = 'Mockery\Test\Generator\StringManipulation\Pass\MagicDummy')
+ {
+ $targetInterface = DefinedTargetClass::factory($interfaceName);
+
+ $this->mockedConfiguration
+ ->shouldReceive('getTargetClass')
+ ->andReturn(null)
+ ->byDefault();
+ $this->mockedConfiguration
+ ->shouldReceive('getTargetInterfaces')
+ ->andReturn([$targetInterface])
+ ->byDefault();
+ }
+
+ protected function configureForInterfaces(array $interfaceNames)
+ {
+ $targetInterfaces = array_map([DefinedTargetClass::class, 'factory'], $interfaceNames);
+
+ $this->mockedConfiguration
+ ->shouldReceive('getTargetClass')
+ ->andReturn(null)
+ ->byDefault();
+ $this->mockedConfiguration
+ ->shouldReceive('getTargetInterfaces')
+ ->andReturn($targetInterfaces)
+ ->byDefault();
+ }
+}
+
+class MagicDummy
+{
+ public function __isset(string $name) : bool
+ {
+ return false;
+ }
+
+ public function __toString() : string
+ {
+ return '';
+ }
+
+ public function __wakeup()
+ {
+ }
+
+ public function __destruct()
+ {
+ }
+
+ public function __call(string $name, array $arguments) : string
+ {
+ }
+
+ public static function __callStatic(string $name, array $arguments) : int
+ {
+ }
+
+ public function nonMagicMethod()
+ {
+ }
+}
+
+class MagicReturnDummy
+{
+ public function __isset(string $name)
+ {
+ return false;
+ }
+}
+
+interface MagicInterfaceDummy
+{
+ public function __isset(string $name) : bool;
+
+ public function __toString() : string;
+
+ public function __wakeup();
+
+ public function __destruct();
+
+ public function __call(string $name, array $arguments) : string;
+
+ public static function __callStatic(string $name, array $arguments) : int;
+
+ public function nonMagicMethod();
+}
+
+interface MagicReturnInterfaceDummy
+{
+ public function __isset(string $name);
+}
+
+interface MagicUnsetInterfaceDummy
+{
+ public function __unset(string $name);
+}
diff --git a/vendor/mockery/mockery/tests/PHP70/MockingParameterAndReturnTypesTest.php b/vendor/mockery/mockery/tests/PHP70/MockingParameterAndReturnTypesTest.php
new file mode 100644
index 000000000..690625f60
--- /dev/null
+++ b/vendor/mockery/mockery/tests/PHP70/MockingParameterAndReturnTypesTest.php
@@ -0,0 +1,177 @@
+shouldReceive("returnString");
+ $this->assertSame("", $mock->returnString());
+ }
+
+ public function testMockingIntegerReturnType()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldReceive("returnInteger");
+ $this->assertSame(0, $mock->returnInteger());
+ }
+
+ public function testMockingFloatReturnType()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldReceive("returnFloat");
+ $this->assertSame(0.0, $mock->returnFloat());
+ }
+
+ public function testMockingBooleanReturnType()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldReceive("returnBoolean");
+ $this->assertFalse($mock->returnBoolean());
+ }
+
+ public function testMockingArrayReturnType()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldReceive("returnArray");
+ $this->assertSame([], $mock->returnArray());
+ }
+
+ public function testMockingGeneratorReturnTyps()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldReceive("returnGenerator");
+ $this->assertInstanceOf("\Generator", $mock->returnGenerator());
+ }
+
+ public function testMockingCallableReturnType()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldReceive("returnCallable");
+ $this->assertInternalType('callable', $mock->returnCallable());
+ }
+
+ public function testMockingClassReturnTypes()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldReceive("withClassReturnType");
+ $this->assertInstanceOf("test\Mockery\TestWithParameterAndReturnType", $mock->withClassReturnType());
+ }
+
+ public function testMockingParameterTypes()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldReceive("withScalarParameters");
+ $mock->withScalarParameters(1, 1.0, true, 'string');
+ }
+
+ public function testIgnoringMissingReturnsType()
+ {
+ $mock = mock("test\Mockery\TestWithParameterAndReturnType");
+
+ $mock->shouldIgnoreMissing();
+
+ $this->assertSame('', $mock->returnString());
+ $this->assertSame(0, $mock->returnInteger());
+ $this->assertSame(0.0, $mock->returnFloat());
+ $this->assertFalse( $mock->returnBoolean());
+ $this->assertSame([], $mock->returnArray());
+ $this->assertInternalType('callable', $mock->returnCallable());
+ $this->assertInstanceOf("\Generator", $mock->returnGenerator());
+ $this->assertInstanceOf("test\Mockery\TestWithParameterAndReturnType", $mock->withClassReturnType());
+ }
+
+ public function testAutoStubbingSelf()
+ {
+ $spy = \Mockery::spy("test\Mockery\TestWithParameterAndReturnType");
+
+ $this->assertInstanceOf("test\Mockery\TestWithParameterAndReturnType", $spy->returnSelf());
+ }
+
+ public function testItShouldMockClassWithHintedParamsInMagicMethod()
+ {
+ $this->assertNotNull(
+ \Mockery::mock('test\Mockery\MagicParams')
+ );
+ }
+
+ public function testItShouldMockClassWithHintedReturnInMagicMethod()
+ {
+ $this->assertNotNull(
+ \Mockery::mock('test\Mockery\MagicReturns')
+ );
+ }
+}
+
+class MagicParams
+{
+ public function __isset(string $property)
+ {
+ return false;
+ }
+}
+
+class MagicReturns
+{
+ public function __isset($property) : bool
+ {
+ return false;
+ }
+}
+
+abstract class TestWithParameterAndReturnType
+{
+ public function returnString(): string {}
+
+ public function returnInteger(): int {}
+
+ public function returnFloat(): float {}
+
+ public function returnBoolean(): bool {}
+
+ public function returnArray(): array {}
+
+ public function returnCallable(): callable {}
+
+ public function returnGenerator(): \Generator {}
+
+ public function withClassReturnType(): TestWithParameterAndReturnType {}
+
+ public function withScalarParameters(int $integer, float $float, bool $boolean, string $string) {}
+
+ public function returnSelf(): self {}
+}
diff --git a/vendor/mockery/mockery/tests/PHP72/Php72LanguageFeaturesTest.php b/vendor/mockery/mockery/tests/PHP72/Php72LanguageFeaturesTest.php
new file mode 100644
index 000000000..f6fb957a4
--- /dev/null
+++ b/vendor/mockery/mockery/tests/PHP72/Php72LanguageFeaturesTest.php
@@ -0,0 +1,45 @@
+allows()->foo($object);
+
+ $mock->foo($object);
+ }
+
+ /** @test */
+ public function it_can_mock_a_class_with_an_object_return_type_hint()
+ {
+ $mock = spy(ReturnTypeObjectTypeHint::class);
+
+ $object = $mock->foo();
+
+ $this->assertTrue(is_object($object));
+ }
+}
+
+class ArgumentObjectTypeHint
+{
+ public function foo(object $foo)
+ {
+ }
+}
+
+class ReturnTypeObjectTypeHint
+{
+ public function foo(): object
+ {
+ }
+}