diff --git a/.travis.yml b/.travis.yml
index c4885bc..618a3f1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,4 +17,5 @@ install:
- travis_retry composer install --dev --no-interaction --prefer-dist
script:
- - ./vendor/bin/phpunit
+ - composer cs-check
+ - composer test
diff --git a/README.md b/README.md
index 348558f..66d8ffa 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ With BDD assertions influenced by Chai, Jasmine, and RSpec your assertions would
[![License](https://img.shields.io/packagist/l/bebat/verify.svg?style=plastic)](https://packagist.org/packages/bebat/verify)
[![Build Status](https://img.shields.io/travis/bbatsche/Verify.svg?style=plastic)](https://travis-ci.org/bbatsche/Verify)
-Most of the original work was done by [@DavertMik](http://github.com/DavertMik) and [@Ragazzo](http://github.com/Ragazzo) in the [Codeception/Verify](http://github.com/Codeception/Verify) repo. This fork was created when it became apparent the original library was missing some key features and was all but abandoned.
+Most of the original work was done by [@DavertMik](http://github.com/DavertMik) and [@Ragazzo](http://github.com/Ragazzo) in the [Codeception/Verify](http://github.com/Codeception/Verify) repo. This fork was created to address some issues and then expand the API & feature set.
## Contents
@@ -309,7 +309,3 @@ Assertion modifiers can be combined with each other, or with attribute assertion
```php
verify($obj)->string_attribute->withoutCase()->equals('some value');
```
-
-## Additional Information
-
-Full API documentation can be found on [GitHub Pages](http://bbatsche.github.io/Verify/). Any issues or questions can be submitted to [Waffle.io](https://waffle.io/bbatsche/Verify).
diff --git a/docs/404.html b/docs/404.html
deleted file mode 100644
index d29ec06..0000000
--- a/docs/404.html
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
You have probably clicked on a link that is outdated and points to a page that does not exist any more or you have made an typing error in the address.
-
To continue please try to find requested page in the menu, or use search field on the top.
This class acts as a simple wrapper for PHPUnit_Framework_Assert. It
-does not add any additional functionality, but it provides a point
-where Mockery can inject itself so we can unit test API calls without
-having to test full integration.
Assert SUT does not contain just instances of a given class or internal PHP type
-
-
-
-
Assert SUT does not contain just instances of a given class or internal PHP type
-
-
This is frankly one of the odder assertions. Just to be clear, SUT may contain
-instances of $type, so long as it also contains values of an additional type.
-
-
-
Parameters
-
-
$type
-
Class name or internal PHP type expected to not be the exclusive type in SUT
<p>When called with a single parameter, will be used as the
- Subject Under Test (SUT). When called with two parameters,
- will be used as a description to display if the assertion fails.</p>
-
-
-
mixed
-
$actual,…
-
Optional value for SUT when called with two arguments
<p>When called with a single parameter, will be used as the Subject
- Under Test (SUT) file name. When called with two parameters,
- will be used as a description to display if the assertion fails.</p>
-
-
-
string
-
$actual,…
-
Optional file name for SUT when called with two arguments
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
<?phpnamespace BeBat\Verify;
-
-/**
- * Assert Class
- *
- * This class acts as a simple wrapper for PHPUnit_Framework_Assert. It
- * does not add any additional functionality, but it provides a point
- * where Mockery can inject itself so we can unit test API calls without
- * having to test full integration.
- *
- * @package BeBat\Verify
- * @abstract
- */
-abstractclassAssertextends \PHPUnit_Framework_Assert {}
-
<?phpnamespace BeBat\Verify;
-
-use BeBat\Verify\Assertas a;
-
-/**
- * Verify Class
- *
- * Bassic set of assertions
- *
- * @package BeBat\Verify
- * @uses \BeBat\Verify\Assert
- */
-class Verify extends VerifyBase
-{
-/**
- * Name of object attribute to evaluate (rather than the object itsefl)
- *
- * @var null|string
- */
-protected$attributeName;
-
-/**
- * Acceptable range when checking for floating point equality
- *
- * @var float
- */
-protected$floatDelta = 0.0;
-
-/**
- * Maximum depth when checking array equality
- *
- * PHPUnit does not use this value in any way, it's included here for consistency.
- * There is no exposed API for modifying this value.
- *
- * @var int
- */
-protected$maxDepth = 10;
-
-/**
- * Check for object identity when checking array contents in SUT
- *
- * @var bool
- */
-protected$objectIdentity = true;
-
-/**
- * Check internal datatype when checking SUT contents
- *
- * @var bool
- */
-protected$dataType = false;
-
-/**
- * Compare attributes when checking XML structure of SUT
- *
- * @var bool
- */
-protected$xmlAttributes = false;
-
-/**
- * Sets the attribute name to check
- *
- * @param string $attr Name of attribute
- * @return self
- */
-publicfunction __get($attr)
- {
-return$this->attribute($attr);
- }
-
-/**
- * Sets the attribute name to check
- *
- * @param string $attr Name of attribute
- * @return self
- */
-publicfunction attribute($attr)
- {
-$this->attributeName = $attr;
-
-return$this;
- }
-
-/**
- * Specify an acceptable range when checking a floating point SUT's equality
- *
- * @param float $delta range within which floating point values will be considered "equal"
- * @return self
- */
-publicfunction within($delta)
- {
-$this->floatDelta = $delta;
-
-return$this;
- }
-
-/**
- * Include element ordering when comparing SUT to an array
- *
- * @return self
- */
-publicfunction withOrder()
- {
-$this->ignoreOrder = false;
-
-return$this;
- }
-
-/**
- * Ignore element ordering when comparing SUT to an array
- *
- * @return self
- */
-publicfunction withoutOrder()
- {
-$this->ignoreOrder = true;
-
-return$this;
- }
-
-/**
- * Compare objects within SUT based on their identity, not just value
- *
- * @return self
- */
-publicfunction withIdentity()
- {
-$this->objectIdentity = true;
-
-return$this;
- }
-
-/**
- * Compare objects within SUT based solely on their value
- *
- * @return self
- */
-publicfunction withoutIdentity()
- {
-$this->objectIdentity = false;
-
-return$this;
- }
-
-/**
- * Compare both type and value for elements in SUT
- *
- * @return self
- */
-publicfunction withType()
- {
-$this->dataType = true;
-
-return$this;
- }
-
-/**
- * Ignore type when comparing elements in SUT
- *
- * @return self
- */
-publicfunction withoutType()
- {
-$this->dataType = false;
-
-return$this;
- }
-
-/**
- * Check element attributes when comparing SUT to an XML document
- *
- * @return self
- */
-publicfunction withAttributes()
- {
-$this->xmlAttributes = true;
-
-return$this;
- }
-
-/**
- * Ignore element attributes when comparing SUT to an XML document
- *
- * @return self
- */
-publicfunction withoutAttributes()
- {
-$this->xmlAttributes = false;
-
-return$this;
- }
-
-/**
- * Assert SUT equals a given value
- *
- * @param mixed $expected Expected value for SUT
- * @return void
- */
-publicfunction equals($expected)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeEquals(
-$expected,
-$this->attributeName,
-$this->actual,
-$this->description,
-$this->floatDelta,
-$this->maxDepth,
-$this->ignoreOrder,
-$this->ignoreCase
- );
- } else {
- a::assertEquals(
-$expected,
-$this->actual,
-$this->description,
-$this->floatDelta,
-$this->maxDepth,
-$this->ignoreOrder,
-$this->ignoreCase
- );
- }
- }
-
-/**
- * Assert SUT does not equal a given value
- *
- * @param mixed $expected Value SUT is expected to differ from
- * @return void
- */
-publicfunction doesNotEqual($expected)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeNotEquals(
-$expected,
-$this->attributeName,
-$this->actual,
-$this->description,
-$this->floatDelta,
-$this->maxDepth,
-$this->ignoreOrder,
-$this->ignoreCase
- );
- } else {
- a::assertNotEquals(
-$expected,
-$this->actual,
-$this->description,
-$this->floatDelta,
-$this->maxDepth,
-$this->ignoreOrder,
-$this->ignoreCase
- );
- }
- }
-
-/**
- * Assert SUT contains a given value
- *
- * @param mixed $needle Value expected to be in SUT
- * @return void
- */
-publicfunction contains($needle)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeContains(
-$needle,
-$this->attributeName,
-$this->actual,
-$this->description,
-$this->ignoreCase,
-$this->objectIdentity,
-$this->dataType
- );
- } else {
- a::assertContains(
-$needle,
-$this->actual,
-$this->description,
-$this->ignoreCase,
-$this->objectIdentity,
-$this->dataType
- );
- }
- }
-
-/**
- * Assert SUT does not contain a given value
- *
- * @param mixed $needle Value expected to be abscent from SUT
- * @return void
- */
-publicfunction doesNotContain($needle)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeNotContains(
-$needle,
-$this->attributeName,
-$this->actual,
-$this->description,
-$this->ignoreCase,
-$this->objectIdentity,
-$this->dataType
- );
- } else {
- a::assertNotContains(
-$needle,
-$this->actual,
-$this->description,
-$this->ignoreCase,
-$this->objectIdentity,
-$this->dataType
- );
- }
- }
-
-/**
- * Assert SUT contains a given subset of values
- *
- * @param array $array Subset expected to be in SUT
- * @return void
- */
-publicfunction hasSubset($array)
- {
- a::assertArraySubset($array, $this->actual, $this->dataType, $this->description);
- }
-
-/**
- * Assert SUT is greater than a given value
- *
- * @param int|float $expected Value SUT is expected to be greater than
- * @return void
- */
-publicfunction isGreaterThan($expected)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeGreaterThan($expected, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertGreaterThan($expected, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT is less than a given value
- *
- * @param int|float $expected Value SUT is expected to be less than
- * @return void
- */
-publicfunction isLessThan($expected)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeLessThan($expected, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertLessThan($expected, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT is greater than or equal to a given value
- *
- * @param int|float $expected Value SUT is expected to be greater than or equal to
- * @return void
- */
-publicfunction isGreaterOrEqualTo($expected)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeGreaterThanOrEqual($expected, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertGreaterThanOrEqual($expected, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT is less than or equal to a given value
- *
- * @param int|float $expected Value SUT is expected to be less than or equal to
- * @return void
- */
-publicfunction isLessOrEqualTo($expected)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeLessThanOrEqual($expected, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertLessThanOrEqual($expected, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert that SUT is true
- *
- * @return void
- */
-publicfunction isTrue()
- {
- a::assertTrue($this->actual, $this->description);
- }
-
-/**
- * Assert SUT is not true
- *
- * @return void
- */
-publicfunction isNotTrue()
- {
- a::assertNotTrue($this->actual, $this->description);
- }
-
-/**
- * Assert SUT is false
- *
- * @return void
- */
-publicfunction isFalse()
- {
- a::assertFalse($this->actual, $this->description);
- }
-
-/**
- * Assert SUT is not false
- *
- * @return void
- */
-publicfunction isNotFalse()
- {
- a::assertNotFalse($this->actual, $this->description);
- }
-
-/**
- * Assert SUT is null
- *
- * @return void
- */
-publicfunction isNull()
- {
- a::assertNull($this->actual, $this->description);
- }
-
-/**
- * Assert SUT is not null
- *
- * @return void
- */
-publicfunction isNotNull()
- {
- a::assertNotNull($this->actual, $this->description);
- }
-
-/**
- * Assert SUT is empty
- *
- * @return void
- */
-publicfunction isEmpty()
- {
-if (isset($this->attributeName)) {
- a::assertAttributeEmpty($this->attributeName, $this->actual, $this->description);
- } else {
- a::assertEmpty($this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT is not empty
- *
- * @return void
- */
-publicfunction isNotEmpty()
- {
-if (isset($this->attributeName)) {
- a::assertAttributeNotEmpty($this->attributeName, $this->actual, $this->description);
- } else {
- a::assertNotEmpty($this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT has a given key
- *
- * @param int|string $key Key expected to be in SUT
- * @return void
- */
-publicfunction hasKey($key)
- {
- a::assertArrayHasKey($key, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not have a given key
- *
- * @param int|string $key Key expected to be abscent from SUT
- * @return void
- */
-publicfunction doesNotHaveKey($key)
- {
- a::assertArrayNotHasKey($key, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT is an instance of a given class
- *
- * @param string $class Name of class SUT is expected to be an instance of
- * @return void
- */
-publicfunction isInstanceOf($class)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeInstanceOf($class, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertInstanceOf($class, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT is not an instance of a given class
- *
- * @param string $class Name of class SUT is expect to not be
- * @return void
- */
-publicfunction isNotInstanceOf($class)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeNotInstanceOf($class, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertNotInstanceOf($class, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT is a given PHP data type
- *
- * @param string $type Data type SUT is expected to be
- * @return void
- */
-publicfunction isInternalType($type)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeInternalType($type, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertInternalType($type, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT is not a given PHP data type
- *
- * @param string $type Data type SUT is expected to not be
- * @return void
- */
-publicfunction isNotInternalType($type)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeNotInternalType($type, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertNotInternalType($type, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT has a given class attribute
- *
- * @param string $attribute Name of attribute expected to be in SUT
- * @return void
- */
-publicfunction hasAttribute($attribute)
- {
-if (is_string($this->actual)) {
- a::assertClassHasAttribute($attribute, $this->actual, $this->description);
- } else {
- a::assertObjectHasAttribute($attribute, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT does not have a given class attribute
- *
- * @param string $attribute Name of attribute expected to be abscent from SUT
- * @return void
- */
-publicfunction doesNotHaveAttribute($attribute)
- {
-if (is_string($this->actual)) {
- a::assertClassNotHasAttribute($attribute, $this->actual, $this->description);
- } else {
- a::assertObjectNotHasAttribute($attribute, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT has a given static attribute
- *
- * @param string $attribute Name of attribute expected to be in SUT
- * @return void
- */
-publicfunction hasStaticAttribute($attribute)
- {
- a::assertClassHasStaticAttribute($attribute, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not contain a given static attribute
- *
- * @param string $attribute Name of static attribute expected to be abscent from SUT
- * @return void
- */
-publicfunction doesNotHaveStaticAttribute($attribute)
- {
- a::assertClassNotHasStaticAttribute($attribute, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT contains only instances of a given class or internal PHP type
- *
- * @param string $type Class name or internal PHP type expected to be in SUT
- * @return void
- */
-publicfunction containsOnly($type)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeContainsOnly($type, $this->attributeName, $this->actual, null, $this->description);
- } else {
- a::assertContainsOnly($type, $this->actual, null, $this->description);
- }
- }
-
-/**
- * Assert SUT does not contain just instances of a given class or internal PHP type
- *
- * This is frankly one of the odder assertions. Just to be clear, SUT *may* contain
- * instances of $type, so long as it *also* contains values of an additional type.
- *
- * @param string $type Class name or internal PHP type expected to not be the exclusive type in SUT
- * @return void
- */
-publicfunction doesNotContainOnly($type)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeNotContainsOnly($type, $this->attributeName, $this->actual, null, $this->description);
- } else {
- a::assertNotContainsOnly($type, $this->actual, null, $this->description);
- }
- }
-
-/**
- * Assert SUT has a given number of elements
- *
- * @param int $count Expected number of elements to be in SUT
- * @return void
- */
-publicfunction hasCount($count)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeCount($count, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertCount($count, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT does not have a given number of elements
- *
- * @param int $count Number of elements SUT is not expected to contain
- * @return void
- */
-publicfunction doesNotHaveCount($count)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeNotCount($count, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertNotCount($count, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT has the same number of elements as given array (or `Countable` or `Traversable` objects)
- *
- * @param array|Countable|Traversable $expected Value SUT is expected to be the same size as
- * @return void
- */
-publicfunction sameSizeAs($expected)
- {
- a::assertSameSize($expected, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not thave the same number of elements as a given array (or `Countable` or `Traversable` objects)
- *
- * @param array|Countable|Traversable $expected Value SUT is expected to have a different number of elements from
- * @return void
- */
-publicfunction notSameSizeAs($expected)
- {
- a::assertNotSameSize($expected, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT is a string containing valid JSON data
- *
- * @return void
- */
-publicfunction isJson()
- {
- a::assertJson($this->actual, $this->description);
- }
-
-/**
- * Assert SUT's JSON value equals a given JSON value
- *
- * @param string $string JSON value SUT is expected to be equal to
- * @return void
- */
-publicfunction equalsJsonString($string)
- {
- a::assertJsonStringEqualsJsonString($string, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's JSON value differs from a given JSON value
- *
- * @param string $string JSON value SUT is expected to be different from
- * @return void
- */
-publicfunction doesNotEqualJsonString($string)
- {
- a::assertJsonStringNotEqualsJsonString($string, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's JSON value is the same as JSON in a given file
- *
- * @param string $file Name of file with JSON expected to match SUT
- * @return void
- */
-publicfunction equalsJsonFile($file)
- {
- a::assertJsonStringEqualsJsonFile($file, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's JSON value is different from JSON stored in given file
- *
- * @param string $file Name of file with JSON SUT is epxected to be different from
- * @return void
- */
-publicfunction doesNotEqualJsonFile($file)
- {
- a::assertJsonStringNotEqualsJsonFile($file, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT matches a given regular expression
- *
- * @param string $expression Regular expression SUT is expected to match
- * @return void
- */
-publicfunction matchesRegExp($expression)
- {
- a::assertRegExp($expression, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not match a given regular expression
- *
- * @param string $expression Regular expression SUT is exted to not match
- * @return void
- */
-publicfunction doesNotMatchRegExp($expression)
- {
- a::assertNotRegExp($expression, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT matches a given format
- *
- * @param string $format Format code(s) SUT is expected to match
- * @see https://phpunit.de/manual/current/en/appendixes.assertions.html#appendixes.assertions.assertStringMatchesFormat
- * @return void
- */
-publicfunction matchesFormat($format)
- {
- a::assertStringMatchesFormat($format, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not match a given format
- *
- * @param string $format Format code(s) SUT is exptected to differ from
- * @see https://phpunit.de/manual/current/en/appendixes.assertions.html#appendixes.assertions.assertStringMatchesFormat
- * @return void
- */
-publicfunction doesNotMatchFormat($format)
- {
- a::assertStringNotMatchesFormat($format, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT matches a format stored in a given file
- *
- * @param string $formatFile Filename to read format code(s) from
- * @see https://phpunit.de/manual/current/en/appendixes.assertions.html#appendixes.assertions.assertStringMatchesFormat
- * @return void
- */
-publicfunction matchesFormatFile($formatFile)
- {
- a::assertStringMatchesFormatFile($formatFile, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not match a format stored in a given file
- *
- * @param string $formatFile Filename to read format code(s) from
- * @see https://phpunit.de/manual/current/en/appendixes.assertions.html#appendixes.assertions.assertStringMatchesFormat
- * @return void
- */
-publicfunction doesNotMatchFormatFile($formatFile)
- {
- a::assertStringNotMatchesFormatFile($formatFile, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT has both the same value and type as a given value
- *
- * @param mixed $expected Value SUT is exptected to match
- * @return void
- */
-publicfunction sameAs($expected)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeSame($expected, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertSame($expected, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT does not have the same value and type as a given value
- *
- * @param string $expected Value SUT is expected to differ from
- * @return void
- */
-publicfunction notSameAs($expected)
- {
-if (isset($this->attributeName)) {
- a::assertAttributeNotSame($expected, $this->attributeName, $this->actual, $this->description);
- } else {
- a::assertNotSame($expected, $this->actual, $this->description);
- }
- }
-
-/**
- * Assert SUT starts with a given value
- *
- * @param string $prefix Value SUT is expected to start with
- * @return void
- */
-publicfunction startsWith($prefix)
- {
- a::assertStringStartsWith($prefix, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not start with a given value
- *
- * @param string $prefix Value SUT is expected to not start with
- * @return void
- */
-publicfunction doesNotStartWith($prefix)
- {
- a::assertStringStartsNotWith($prefix, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT ends with a given value
- *
- * @param string $suffix Value SUT is expected to end with
- * @return void
- */
-publicfunction endsWith($suffix)
- {
- a::assertStringEndsWith($suffix, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not end with a given value
- *
- * @param string $suffix Value SUT is expected to not end with
- * @return void
- */
-publicfunction doesNotEndWith($suffix)
- {
- a::assertStringEndsNotWith($suffix, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT equals the contents of a given file
- *
- * @param string $file Name of file SUT is expected to match
- * @return void
- */
-publicfunction equalsFile($file)
- {
-// $canonicalize hardcoded to false
- a::assertStringEqualsFile($file, $this->actual, $this->description, false, $this->ignoreCase);
- }
-
-/**
- * Assert SUT does not equal the contents of a given file
- *
- * @param string $file Name of file SUT is expected to differ from
- * @return void
- */
-publicfunction doesNotEqualFile($file)
- {
-// $canonicalize hardcoded to false
- a::assertStringNotEqualsFile($file, $this->actual, $this->description, false, $this->ignoreCase);
- }
-
-/**
- * Assert SUT has the same XML structur as a given DOMElement
- *
- * @param \DOMElement $xml Structure SUT is expected to match
- * @return void
- */
-publicfunction equalsXmlStructure($xml)
- {
- a::assertEqualXMLStructure($xml, $this->actual, $this->xmlAttributes, $this->description);
- }
-
-/**
- * Assert SUT's XML value is equal to the XML stored in a given file
- *
- * @param string $file Name of XML file SUT is expected to match
- * @return void
- */
-publicfunction equalsXmlFile($file)
- {
- a::assertXmlStringEqualsXmlFile($file, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's XML value differs from the XML stored in a given file
- *
- * @param string $file Name of XML file SUT is expected to differ from
- * @return void
- */
-publicfunction doesNotEqualXmlFile($file)
- {
- a::assertXmlStringNotEqualsXmlFile($file, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's XML value is the same as a given string of XML
- *
- * @param string $xmlString XML data SUT is expected to equal
- * @return void
- */
-publicfunction equalsXmlString($xmlString)
- {
- a::assertXmlStringEqualsXmlString($xmlString, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's XML value differs from a given string of XML
- *
- * @param string $xmlString XML data SUT is expected to differ from
- * @return void
- */
-publicfunction doesNotEqualXmlString($xmlString)
- {
- a::assertXmlStringNotEqualsXmlString($xmlString, $this->actual, $this->description);
- }
-}
-
<?phpnamespace BeBat\Verify;
-
-use BeBat\Verify\Assertas a;
-
-/**
- * Verify Files
- *
- * Collection of assertions specific to filesystem objects.
- *
- * @package BeBat\Verify
- */
-class VerifyFile extends VerifyBase
-{
-/**
- * Assert contents of SUT are equal to another given file's contents
- *
- * @param string $expected Name of file SUT is expected to be equal to
- * @return void
- */
-publicfunction equals($expected)
- {
- a::assertFileEquals($expected, $this->actual, $this->description, $this->ignoreOrder, $this->ignoreCase);
- }
-
-/**
- * Assert contents of SUT are not the same as another given file
- *
- * @param string $expected Name of file SUT is expected to differ from
- * @return void
- */
-publicfunction doesNotEqual($expected)
- {
- a::assertFileNotEquals($expected, $this->actual, $this->description, $this->ignoreOrder, $this->ignoreCase);
- }
-
-/**
- * Assert SUT exists in the filesystem
- *
- * @return void
- */
-publicfunction exists()
- {
- a::assertFileExists($this->actual, $this->description);
- }
-
-/**
- * Assert SUT does not exist in the filesystem
- *
- * @return void
- */
-publicfunction doesNotExist()
- {
- a::assertFileNotExists($this->actual, $this->description);
- }
-
-/**
- * Assert SUT's contents as JSON value are equal to the JSON contents of a given file
- *
- * @param string $file JSON file SUT is expected to be the same as
- * @return void
- */
-publicfunction equalsJsonFile($file)
- {
- a::assertJsonFileEqualsJsonFile($file, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's contents as a JSON value are not the same as the JSON contents of a given file
- *
- * @param string $file JSON file SUT is expected to differ from
- * @return void
- */
-publicfunction doesNotEqualJsonFile($file)
- {
- a::assertJsonFileNotEqualsJsonFile($file, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's contents as XML are the same as the XML in a given file
- *
- * @param string $file XML file SUT is expected to be the same as
- * @return void
- */
-publicfunction equalsXmlFile($file)
- {
- a::assertXmlFileEqualsXmlFile($file, $this->actual, $this->description);
- }
-
-/**
- * Assert SUT's contents as XML are not the same as the XML in a given file
- *
- * @param string $file XML file SUT is expected to differ from
- * @return void
- */
-publicfunction doesNotEqualXmlFile($file)
- {
- a::assertXmlFileNotEqualsXmlFile($file, $this->actual, $this->description);
- }
-}
-
<?php
-
-use BeBat\Verify\Verify;
-use BeBat\Verify\VerifyFile;
-
-if (!function_exists('verify')) {
-/**
- * Interface into Verify library and main set of assertions
- *
- * @param string|mixed $description When called with a single parameter, will be used as the
- * Subject Under Test (SUT). When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param mixed $actual Optional value for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\Verify
- */
-function verify()
- {
-switch(func_num_args()) {
-case1:
-returnnew Verify(func_get_arg(0));
-case2:
-returnnew Verify(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify() must be called with exactly 1 or 2 arguments.');
- }
- }
-
-/**
- * Assert a value is not empty or "true"
- *
- * @param mixed $truth SUT expected to be not empty
- * @return void
- */
-function verify_that($truth)
- {
- verify($truth)->isNotEmpty();
- }
-
-/**
- * Assert a value is empty or "false"
- *
- * @param mixed $fallacy SUT expected to be empty
- * @return void
- */
-function verify_not($fallacy)
- {
- verify($fallacy)->isEmpty();
- }
-}
-
-if (!function_exists('expect')) {
-/**
- * Alternate function for verify()
- *
- * @see verify()
- */
-function expect()
- {
-returncall_user_func_array('verify', func_get_args());
- }
-
-/**
- * Alternate function for verify_that()
- *
- * @see verify_that()
- */
-function expect_that($truth)
- {
- expect($truth)->isNotEmpty();
- }
-
-/**
- * ALternate function for verify_not()
- *
- * @see verify_not()
- */
-function expect_not($fallacy)
- {
- expect($fallacy)->isEmpty();
- }
-
-}
-
-if (!function_exists('verify_file')) {
-/**
- * Interface into Verify with assertions specific to file system objects
- *
- * @param string $description When called with a single parameter, will be used as the Subject
- * Under Test (SUT) file name. When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param string $actual Optional file name for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\VerifyFile
- */
-function verify_file()
- {
-switch(func_num_args()) {
-case1:
-returnnew VerifyFile(func_get_arg(0));
-case2:
-returnnew VerifyFile(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify_file() must be called with exactly 1 or 2 arguments.');
- }
- }
-}
-
-if (!function_exists('expect_file')) {
-/**
- * Alternate function for verify_file()
- *
- * @see verify_file()
- */
-function expect_file()
- {
-returncall_user_func_array('verify_file', func_get_args());
- }
-}
-
<?php
-
-use BeBat\Verify\Verify;
-use BeBat\Verify\VerifyFile;
-
-if (!function_exists('verify')) {
-/**
- * Interface into Verify library and main set of assertions
- *
- * @param string|mixed $description When called with a single parameter, will be used as the
- * Subject Under Test (SUT). When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param mixed $actual Optional value for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\Verify
- */
-function verify()
- {
-switch(func_num_args()) {
-case1:
-returnnew Verify(func_get_arg(0));
-case2:
-returnnew Verify(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify() must be called with exactly 1 or 2 arguments.');
- }
- }
-
-/**
- * Assert a value is not empty or "true"
- *
- * @param mixed $truth SUT expected to be not empty
- * @return void
- */
-function verify_that($truth)
- {
- verify($truth)->isNotEmpty();
- }
-
-/**
- * Assert a value is empty or "false"
- *
- * @param mixed $fallacy SUT expected to be empty
- * @return void
- */
-function verify_not($fallacy)
- {
- verify($fallacy)->isEmpty();
- }
-}
-
-if (!function_exists('expect')) {
-/**
- * Alternate function for verify()
- *
- * @see verify()
- */
-function expect()
- {
-returncall_user_func_array('verify', func_get_args());
- }
-
-/**
- * Alternate function for verify_that()
- *
- * @see verify_that()
- */
-function expect_that($truth)
- {
- expect($truth)->isNotEmpty();
- }
-
-/**
- * ALternate function for verify_not()
- *
- * @see verify_not()
- */
-function expect_not($fallacy)
- {
- expect($fallacy)->isEmpty();
- }
-
-}
-
-if (!function_exists('verify_file')) {
-/**
- * Interface into Verify with assertions specific to file system objects
- *
- * @param string $description When called with a single parameter, will be used as the Subject
- * Under Test (SUT) file name. When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param string $actual Optional file name for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\VerifyFile
- */
-function verify_file()
- {
-switch(func_num_args()) {
-case1:
-returnnew VerifyFile(func_get_arg(0));
-case2:
-returnnew VerifyFile(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify_file() must be called with exactly 1 or 2 arguments.');
- }
- }
-}
-
-if (!function_exists('expect_file')) {
-/**
- * Alternate function for verify_file()
- *
- * @see verify_file()
- */
-function expect_file()
- {
-returncall_user_func_array('verify_file', func_get_args());
- }
-}
-
<?php
-
-use BeBat\Verify\Verify;
-use BeBat\Verify\VerifyFile;
-
-if (!function_exists('verify')) {
-/**
- * Interface into Verify library and main set of assertions
- *
- * @param string|mixed $description When called with a single parameter, will be used as the
- * Subject Under Test (SUT). When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param mixed $actual Optional value for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\Verify
- */
-function verify()
- {
-switch(func_num_args()) {
-case1:
-returnnew Verify(func_get_arg(0));
-case2:
-returnnew Verify(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify() must be called with exactly 1 or 2 arguments.');
- }
- }
-
-/**
- * Assert a value is not empty or "true"
- *
- * @param mixed $truth SUT expected to be not empty
- * @return void
- */
-function verify_that($truth)
- {
- verify($truth)->isNotEmpty();
- }
-
-/**
- * Assert a value is empty or "false"
- *
- * @param mixed $fallacy SUT expected to be empty
- * @return void
- */
-function verify_not($fallacy)
- {
- verify($fallacy)->isEmpty();
- }
-}
-
-if (!function_exists('expect')) {
-/**
- * Alternate function for verify()
- *
- * @see verify()
- */
-function expect()
- {
-returncall_user_func_array('verify', func_get_args());
- }
-
-/**
- * Alternate function for verify_that()
- *
- * @see verify_that()
- */
-function expect_that($truth)
- {
- expect($truth)->isNotEmpty();
- }
-
-/**
- * ALternate function for verify_not()
- *
- * @see verify_not()
- */
-function expect_not($fallacy)
- {
- expect($fallacy)->isEmpty();
- }
-
-}
-
-if (!function_exists('verify_file')) {
-/**
- * Interface into Verify with assertions specific to file system objects
- *
- * @param string $description When called with a single parameter, will be used as the Subject
- * Under Test (SUT) file name. When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param string $actual Optional file name for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\VerifyFile
- */
-function verify_file()
- {
-switch(func_num_args()) {
-case1:
-returnnew VerifyFile(func_get_arg(0));
-case2:
-returnnew VerifyFile(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify_file() must be called with exactly 1 or 2 arguments.');
- }
- }
-}
-
-if (!function_exists('expect_file')) {
-/**
- * Alternate function for verify_file()
- *
- * @see verify_file()
- */
-function expect_file()
- {
-returncall_user_func_array('verify_file', func_get_args());
- }
-}
-
<?php
-
-use BeBat\Verify\Verify;
-use BeBat\Verify\VerifyFile;
-
-if (!function_exists('verify')) {
-/**
- * Interface into Verify library and main set of assertions
- *
- * @param string|mixed $description When called with a single parameter, will be used as the
- * Subject Under Test (SUT). When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param mixed $actual Optional value for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\Verify
- */
-function verify()
- {
-switch(func_num_args()) {
-case1:
-returnnew Verify(func_get_arg(0));
-case2:
-returnnew Verify(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify() must be called with exactly 1 or 2 arguments.');
- }
- }
-
-/**
- * Assert a value is not empty or "true"
- *
- * @param mixed $truth SUT expected to be not empty
- * @return void
- */
-function verify_that($truth)
- {
- verify($truth)->isNotEmpty();
- }
-
-/**
- * Assert a value is empty or "false"
- *
- * @param mixed $fallacy SUT expected to be empty
- * @return void
- */
-function verify_not($fallacy)
- {
- verify($fallacy)->isEmpty();
- }
-}
-
-if (!function_exists('expect')) {
-/**
- * Alternate function for verify()
- *
- * @see verify()
- */
-function expect()
- {
-returncall_user_func_array('verify', func_get_args());
- }
-
-/**
- * Alternate function for verify_that()
- *
- * @see verify_that()
- */
-function expect_that($truth)
- {
- expect($truth)->isNotEmpty();
- }
-
-/**
- * ALternate function for verify_not()
- *
- * @see verify_not()
- */
-function expect_not($fallacy)
- {
- expect($fallacy)->isEmpty();
- }
-
-}
-
-if (!function_exists('verify_file')) {
-/**
- * Interface into Verify with assertions specific to file system objects
- *
- * @param string $description When called with a single parameter, will be used as the Subject
- * Under Test (SUT) file name. When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param string $actual Optional file name for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\VerifyFile
- */
-function verify_file()
- {
-switch(func_num_args()) {
-case1:
-returnnew VerifyFile(func_get_arg(0));
-case2:
-returnnew VerifyFile(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify_file() must be called with exactly 1 or 2 arguments.');
- }
- }
-}
-
-if (!function_exists('expect_file')) {
-/**
- * Alternate function for verify_file()
- *
- * @see verify_file()
- */
-function expect_file()
- {
-returncall_user_func_array('verify_file', func_get_args());
- }
-}
-
<?php
-
-use BeBat\Verify\Verify;
-use BeBat\Verify\VerifyFile;
-
-if (!function_exists('verify')) {
-/**
- * Interface into Verify library and main set of assertions
- *
- * @param string|mixed $description When called with a single parameter, will be used as the
- * Subject Under Test (SUT). When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param mixed $actual Optional value for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\Verify
- */
-function verify()
- {
-switch(func_num_args()) {
-case1:
-returnnew Verify(func_get_arg(0));
-case2:
-returnnew Verify(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify() must be called with exactly 1 or 2 arguments.');
- }
- }
-
-/**
- * Assert a value is not empty or "true"
- *
- * @param mixed $truth SUT expected to be not empty
- * @return void
- */
-function verify_that($truth)
- {
- verify($truth)->isNotEmpty();
- }
-
-/**
- * Assert a value is empty or "false"
- *
- * @param mixed $fallacy SUT expected to be empty
- * @return void
- */
-function verify_not($fallacy)
- {
- verify($fallacy)->isEmpty();
- }
-}
-
-if (!function_exists('expect')) {
-/**
- * Alternate function for verify()
- *
- * @see verify()
- */
-function expect()
- {
-returncall_user_func_array('verify', func_get_args());
- }
-
-/**
- * Alternate function for verify_that()
- *
- * @see verify_that()
- */
-function expect_that($truth)
- {
- expect($truth)->isNotEmpty();
- }
-
-/**
- * ALternate function for verify_not()
- *
- * @see verify_not()
- */
-function expect_not($fallacy)
- {
- expect($fallacy)->isEmpty();
- }
-
-}
-
-if (!function_exists('verify_file')) {
-/**
- * Interface into Verify with assertions specific to file system objects
- *
- * @param string $description When called with a single parameter, will be used as the Subject
- * Under Test (SUT) file name. When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param string $actual Optional file name for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\VerifyFile
- */
-function verify_file()
- {
-switch(func_num_args()) {
-case1:
-returnnew VerifyFile(func_get_arg(0));
-case2:
-returnnew VerifyFile(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify_file() must be called with exactly 1 or 2 arguments.');
- }
- }
-}
-
-if (!function_exists('expect_file')) {
-/**
- * Alternate function for verify_file()
- *
- * @see verify_file()
- */
-function expect_file()
- {
-returncall_user_func_array('verify_file', func_get_args());
- }
-}
-
<?php
-
-use BeBat\Verify\Verify;
-use BeBat\Verify\VerifyFile;
-
-if (!function_exists('verify')) {
-/**
- * Interface into Verify library and main set of assertions
- *
- * @param string|mixed $description When called with a single parameter, will be used as the
- * Subject Under Test (SUT). When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param mixed $actual Optional value for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\Verify
- */
-function verify()
- {
-switch(func_num_args()) {
-case1:
-returnnew Verify(func_get_arg(0));
-case2:
-returnnew Verify(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify() must be called with exactly 1 or 2 arguments.');
- }
- }
-
-/**
- * Assert a value is not empty or "true"
- *
- * @param mixed $truth SUT expected to be not empty
- * @return void
- */
-function verify_that($truth)
- {
- verify($truth)->isNotEmpty();
- }
-
-/**
- * Assert a value is empty or "false"
- *
- * @param mixed $fallacy SUT expected to be empty
- * @return void
- */
-function verify_not($fallacy)
- {
- verify($fallacy)->isEmpty();
- }
-}
-
-if (!function_exists('expect')) {
-/**
- * Alternate function for verify()
- *
- * @see verify()
- */
-function expect()
- {
-returncall_user_func_array('verify', func_get_args());
- }
-
-/**
- * Alternate function for verify_that()
- *
- * @see verify_that()
- */
-function expect_that($truth)
- {
- expect($truth)->isNotEmpty();
- }
-
-/**
- * ALternate function for verify_not()
- *
- * @see verify_not()
- */
-function expect_not($fallacy)
- {
- expect($fallacy)->isEmpty();
- }
-
-}
-
-if (!function_exists('verify_file')) {
-/**
- * Interface into Verify with assertions specific to file system objects
- *
- * @param string $description When called with a single parameter, will be used as the Subject
- * Under Test (SUT) file name. When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param string $actual Optional file name for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\VerifyFile
- */
-function verify_file()
- {
-switch(func_num_args()) {
-case1:
-returnnew VerifyFile(func_get_arg(0));
-case2:
-returnnew VerifyFile(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify_file() must be called with exactly 1 or 2 arguments.');
- }
- }
-}
-
-if (!function_exists('expect_file')) {
-/**
- * Alternate function for verify_file()
- *
- * @see verify_file()
- */
-function expect_file()
- {
-returncall_user_func_array('verify_file', func_get_args());
- }
-}
-
<?php
-
-use BeBat\Verify\Verify;
-use BeBat\Verify\VerifyFile;
-
-if (!function_exists('verify')) {
-/**
- * Interface into Verify library and main set of assertions
- *
- * @param string|mixed $description When called with a single parameter, will be used as the
- * Subject Under Test (SUT). When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param mixed $actual Optional value for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\Verify
- */
-function verify()
- {
-switch(func_num_args()) {
-case1:
-returnnew Verify(func_get_arg(0));
-case2:
-returnnew Verify(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify() must be called with exactly 1 or 2 arguments.');
- }
- }
-
-/**
- * Assert a value is not empty or "true"
- *
- * @param mixed $truth SUT expected to be not empty
- * @return void
- */
-function verify_that($truth)
- {
- verify($truth)->isNotEmpty();
- }
-
-/**
- * Assert a value is empty or "false"
- *
- * @param mixed $fallacy SUT expected to be empty
- * @return void
- */
-function verify_not($fallacy)
- {
- verify($fallacy)->isEmpty();
- }
-}
-
-if (!function_exists('expect')) {
-/**
- * Alternate function for verify()
- *
- * @see verify()
- */
-function expect()
- {
-returncall_user_func_array('verify', func_get_args());
- }
-
-/**
- * Alternate function for verify_that()
- *
- * @see verify_that()
- */
-function expect_that($truth)
- {
- expect($truth)->isNotEmpty();
- }
-
-/**
- * ALternate function for verify_not()
- *
- * @see verify_not()
- */
-function expect_not($fallacy)
- {
- expect($fallacy)->isEmpty();
- }
-
-}
-
-if (!function_exists('verify_file')) {
-/**
- * Interface into Verify with assertions specific to file system objects
- *
- * @param string $description When called with a single parameter, will be used as the Subject
- * Under Test (SUT) file name. When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param string $actual Optional file name for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\VerifyFile
- */
-function verify_file()
- {
-switch(func_num_args()) {
-case1:
-returnnew VerifyFile(func_get_arg(0));
-case2:
-returnnew VerifyFile(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify_file() must be called with exactly 1 or 2 arguments.');
- }
- }
-}
-
-if (!function_exists('expect_file')) {
-/**
- * Alternate function for verify_file()
- *
- * @see verify_file()
- */
-function expect_file()
- {
-returncall_user_func_array('verify_file', func_get_args());
- }
-}
-
<?php
-
-use BeBat\Verify\Verify;
-use BeBat\Verify\VerifyFile;
-
-if (!function_exists('verify')) {
-/**
- * Interface into Verify library and main set of assertions
- *
- * @param string|mixed $description When called with a single parameter, will be used as the
- * Subject Under Test (SUT). When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param mixed $actual Optional value for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\Verify
- */
-function verify()
- {
-switch(func_num_args()) {
-case1:
-returnnew Verify(func_get_arg(0));
-case2:
-returnnew Verify(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify() must be called with exactly 1 or 2 arguments.');
- }
- }
-
-/**
- * Assert a value is not empty or "true"
- *
- * @param mixed $truth SUT expected to be not empty
- * @return void
- */
-function verify_that($truth)
- {
- verify($truth)->isNotEmpty();
- }
-
-/**
- * Assert a value is empty or "false"
- *
- * @param mixed $fallacy SUT expected to be empty
- * @return void
- */
-function verify_not($fallacy)
- {
- verify($fallacy)->isEmpty();
- }
-}
-
-if (!function_exists('expect')) {
-/**
- * Alternate function for verify()
- *
- * @see verify()
- */
-function expect()
- {
-returncall_user_func_array('verify', func_get_args());
- }
-
-/**
- * Alternate function for verify_that()
- *
- * @see verify_that()
- */
-function expect_that($truth)
- {
- expect($truth)->isNotEmpty();
- }
-
-/**
- * ALternate function for verify_not()
- *
- * @see verify_not()
- */
-function expect_not($fallacy)
- {
- expect($fallacy)->isEmpty();
- }
-
-}
-
-if (!function_exists('verify_file')) {
-/**
- * Interface into Verify with assertions specific to file system objects
- *
- * @param string $description When called with a single parameter, will be used as the Subject
- * Under Test (SUT) file name. When called with two parameters,
- * will be used as a description to display if the assertion fails.
- * @param string $actual Optional file name for SUT when called with two arguments
- *
- * @throws \BadMethodCallException When called with 0 arguments, or more than two arguments
- *
- * @return \BeBat\Verify\VerifyFile
- */
-function verify_file()
- {
-switch(func_num_args()) {
-case1:
-returnnew VerifyFile(func_get_arg(0));
-case2:
-returnnew VerifyFile(func_get_arg(1), func_get_arg(0));
-default:
-thrownew \BadMethodCallException('verify_file() must be called with exactly 1 or 2 arguments.');
- }
- }
-}
-
-if (!function_exists('expect_file')) {
-/**
- * Alternate function for verify_file()
- *
- * @see verify_file()
- */
-function expect_file()
- {
-returncall_user_func_array('verify_file', func_get_args());
- }
-}
-