PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.4
Booking for Appointments and Events Calendar – Amelia v2.4.4
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / sabre / vobject / lib / PHPUnitAssertions.php
ameliabooking / vendor / sabre / vobject / lib Last commit date
Component 6 months ago ITip 6 months ago Parser 6 months ago Property 6 months ago Recur 6 months ago Splitter 6 months ago TimezoneGuesser 6 months ago timezonedata 1 year ago BirthdayCalendarGenerator.php 6 months ago Cli.php 6 months ago Component.php 6 months ago DateTimeParser.php 6 months ago Document.php 6 months ago ElementList.php 6 months ago EofException.php 6 months ago FreeBusyData.php 6 months ago FreeBusyGenerator.php 6 months ago InvalidDataException.php 6 months ago Node.php 6 months ago PHPUnitAssertions.php 6 months ago Parameter.php 6 months ago ParseException.php 6 months ago Property.php 6 months ago Reader.php 6 months ago Settings.php 6 months ago StringUtil.php 6 months ago TimeZoneUtil.php 6 months ago UUIDUtil.php 6 months ago VCardConverter.php 6 months ago Version.php 6 months ago Writer.php 6 months ago
PHPUnitAssertions.php
62 lines
1 <?php
2
3 namespace AmeliaVendor\Sabre\VObject;
4
5 /**
6 * PHPUnit Assertions.
7 *
8 * This trait can be added to your unittest to make it easier to test iCalendar
9 * and/or vCards.
10 *
11 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
12 * @author Evert Pot (http://evertpot.com/)
13 * @license http://sabre.io/license/ Modified BSD License
14 */
15 trait PHPUnitAssertions
16 {
17 /**
18 * This method tests whether two vcards or icalendar objects are
19 * semantically identical.
20 *
21 * It supports objects being supplied as strings, streams or
22 * Sabre\VObject\Component instances.
23 *
24 * PRODID is removed from both objects as this is often changes and would
25 * just get in the way.
26 *
27 * CALSCALE will automatically get removed if it's set to GREGORIAN.
28 *
29 * Any property that has the value **ANY** will be treated as a wildcard.
30 *
31 * @param resource|string|Component $expected
32 * @param resource|string|Component $actual
33 * @param string $message
34 */
35 public function assertVObjectEqualsVObject($expected, $actual, $message = '')
36 {
37 $getObj = function ($input) {
38 if (is_resource($input)) {
39 $input = stream_get_contents($input);
40 }
41 if (is_string($input)) {
42 $input = Reader::read($input);
43 }
44 if (!$input instanceof Component) {
45 $this->fail('Input must be a string, stream or VObject component');
46 }
47 unset($input->PRODID);
48 if ($input instanceof \AmeliaVendor\Sabre\VObject\Component\VCalendar && 'GREGORIAN' === (string) $input->CALSCALE) {
49 unset($input->CALSCALE);
50 }
51 return $input;
52 };
53 $expected = $getObj($expected)->serialize();
54 $actual = $getObj($actual)->serialize();
55 // Finding wildcards in expected.
56 preg_match_all('|^([A-Z]+):\*\*ANY\*\*\r$|m', $expected, $matches, PREG_SET_ORDER);
57 foreach ($matches as $match) {
58 $actual = preg_replace('|^' . preg_quote($match[1], '|') . ':(.*)\r$|m', $match[1] . ':**ANY**' . "\r", $actual);
59 }
60 $this->assertEquals($expected, $actual, $message);
61 }
62 }