PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.8.6
Kubio AI Page Builder v2.8.6
2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / vendor / sebastian / comparator / src / ComparisonFailure.php
kubio / vendor / sebastian / comparator / src Last commit date
exceptions 1 year ago ArrayComparator.php 1 year ago Comparator.php 1 year ago ComparisonFailure.php 1 year ago DOMNodeComparator.php 1 year ago DateTimeComparator.php 1 year ago DoubleComparator.php 1 year ago ExceptionComparator.php 1 year ago Factory.php 1 year ago MockObjectComparator.php 1 year ago NumericComparator.php 1 year ago ObjectComparator.php 1 year ago ResourceComparator.php 1 year ago ScalarComparator.php 1 year ago SplObjectStorageComparator.php 1 year ago TypeComparator.php 1 year ago
ComparisonFailure.php
130 lines
1 <?php declare(strict_types=1);
2 /*
3 * This file is part of sebastian/comparator.
4 *
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10 namespace SebastianBergmann\Comparator;
11
12 use RuntimeException;
13 use SebastianBergmann\Diff\Differ;
14 use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
15
16 /**
17 * Thrown when an assertion for string equality failed.
18 */
19 class ComparisonFailure extends RuntimeException
20 {
21 /**
22 * Expected value of the retrieval which does not match $actual.
23 *
24 * @var mixed
25 */
26 protected $expected;
27
28 /**
29 * Actually retrieved value which does not match $expected.
30 *
31 * @var mixed
32 */
33 protected $actual;
34
35 /**
36 * The string representation of the expected value.
37 *
38 * @var string
39 */
40 protected $expectedAsString;
41
42 /**
43 * The string representation of the actual value.
44 *
45 * @var string
46 */
47 protected $actualAsString;
48
49 /**
50 * @var bool
51 */
52 protected $identical;
53
54 /**
55 * Optional message which is placed in front of the first line
56 * returned by toString().
57 *
58 * @var string
59 */
60 protected $message;
61
62 /**
63 * Initialises with the expected value and the actual value.
64 *
65 * @param mixed $expected expected value retrieved
66 * @param mixed $actual actual value retrieved
67 * @param string $expectedAsString
68 * @param string $actualAsString
69 * @param bool $identical
70 * @param string $message a string which is prefixed on all returned lines
71 * in the difference output
72 */
73 public function __construct($expected, $actual, $expectedAsString, $actualAsString, $identical = false, $message = '')
74 {
75 $this->expected = $expected;
76 $this->actual = $actual;
77 $this->expectedAsString = $expectedAsString;
78 $this->actualAsString = $actualAsString;
79 $this->message = $message;
80 }
81
82 public function getActual()
83 {
84 return $this->actual;
85 }
86
87 public function getExpected()
88 {
89 return $this->expected;
90 }
91
92 /**
93 * @return string
94 */
95 public function getActualAsString()
96 {
97 return $this->actualAsString;
98 }
99
100 /**
101 * @return string
102 */
103 public function getExpectedAsString()
104 {
105 return $this->expectedAsString;
106 }
107
108 /**
109 * @return string
110 */
111 public function getDiff()
112 {
113 if (!$this->actualAsString && !$this->expectedAsString) {
114 return '';
115 }
116
117 $differ = new Differ(new UnifiedDiffOutputBuilder("\n--- Expected\n+++ Actual\n"));
118
119 return $differ->diff($this->expectedAsString, $this->actualAsString);
120 }
121
122 /**
123 * @return string
124 */
125 public function toString()
126 {
127 return $this->message . $this->getDiff();
128 }
129 }
130