aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/PHPUnitAssertions.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-04-25 11:24:09 +0200
committerMario <mario@mariovavti.com>2019-04-25 11:24:09 +0200
commitf1c07977809ce3221286d53e99f0d91145b1166f (patch)
tree4c067a3b701ea56f10070c386b26a30f93666eb0 /vendor/sabre/vobject/lib/PHPUnitAssertions.php
parent701167bc125700efb3e6ce759b85bcb4d36ee42e (diff)
downloadvolse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.tar.gz
volse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.tar.bz2
volse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.zip
Revert "update composer libs"
This reverts commit e779335d060b3a51d6a144d23af4097ae6801473
Diffstat (limited to 'vendor/sabre/vobject/lib/PHPUnitAssertions.php')
-rw-r--r--vendor/sabre/vobject/lib/PHPUnitAssertions.php28
1 files changed, 17 insertions, 11 deletions
diff --git a/vendor/sabre/vobject/lib/PHPUnitAssertions.php b/vendor/sabre/vobject/lib/PHPUnitAssertions.php
index d77e4b1ed..87ec75e8f 100644
--- a/vendor/sabre/vobject/lib/PHPUnitAssertions.php
+++ b/vendor/sabre/vobject/lib/PHPUnitAssertions.php
@@ -3,7 +3,7 @@
namespace Sabre\VObject;
/**
- * PHPUnit Assertions.
+ * PHPUnit Assertions
*
* This trait can be added to your unittest to make it easier to test iCalendar
* and/or vCards.
@@ -12,8 +12,8 @@ namespace Sabre\VObject;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-trait PHPUnitAssertions
-{
+trait PHPUnitAssertions {
+
/**
* This method tests wether two vcards or icalendar objects are
* semantically identical.
@@ -30,12 +30,13 @@ trait PHPUnitAssertions
*
* @param resource|string|Component $expected
* @param resource|string|Component $actual
- * @param string $message
+ * @param string $message
*/
- public function assertVObjectEqualsVObject($expected, $actual, $message = '')
- {
+ function assertVObjectEqualsVObject($expected, $actual, $message = '') {
+
$self = $this;
- $getObj = function ($input) use ($self) {
+ $getObj = function($input) use ($self) {
+
if (is_resource($input)) {
$input = stream_get_contents($input);
}
@@ -46,11 +47,11 @@ trait PHPUnitAssertions
$this->fail('Input must be a string, stream or VObject component');
}
unset($input->PRODID);
- if ($input instanceof Component\VCalendar && 'GREGORIAN' === (string) $input->CALSCALE) {
+ if ($input instanceof Component\VCalendar && (string)$input->CALSCALE === 'GREGORIAN') {
unset($input->CALSCALE);
}
-
return $input;
+
};
$expected = $getObj($expected)->serialize();
@@ -60,11 +61,13 @@ trait PHPUnitAssertions
preg_match_all('|^([A-Z]+):\\*\\*ANY\\*\\*\r$|m', $expected, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
+
$actual = preg_replace(
- '|^'.preg_quote($match[1], '|').':(.*)\r$|m',
- $match[1].':**ANY**'."\r",
+ '|^' . preg_quote($match[1], '|') . ':(.*)\r$|m',
+ $match[1] . ':**ANY**' . "\r",
$actual
);
+
}
$this->assertEquals(
@@ -72,5 +75,8 @@ trait PHPUnitAssertions
$actual,
$message
);
+
}
+
+
}