1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
|
From: William Desportes <williamdes@wdes.fr>
Date: Fri, 11 Apr 2025 16:03:55 +0200
Subject: Update the phpunit tests
Origin: vendor
Forwarded: not-needed
Exclude spyc.yaml because:
There were 2 failures:
1) DumpTest::testDump
Failed asserting that two arrays are equal.
- Expected
+ Actual
@@ @@
'Negative' => -90
'SmallFloat' => 0.7
'NewLine' => '\n'
- 'QuotedNewLine' => '\n
- '
+ 'QuotedNewLine' => '\n'
0 => 'PHP Class'
1 => 'Basic YAML Loader'
2 => 'Very Basic YAML Dumper'
@@ @@
'hash#3' => 'Hash (#) can appear in key too'
'float_test' => '1.0'
'float_test_with_quotes' => '1.0'
- 'float_inverse_test' => 1.0
+ 'float_inverse_test' => 1
'a_really_large_number' => '11579208923731619542357098500...639936'
'int array' => [...]
'array on several lines' => [...]
2) DumpTest::testDumpWithQuotes
Failed asserting that two arrays are equal.
- Expected
+ Actual
@@ @@
'Float' => 5.34
'Negative' => -90
'SmallFloat' => 0.7
- 'NewLine' => '\n'
- 'QuotedNewLine' => '\n
+ 'NewLine' => '\n
'
+ 'QuotedNewLine' => '\n'
0 => 'PHP Class'
1 => 'Basic YAML Loader'
2 => 'Very Basic YAML Dumper'
@@ @@
'hash#3' => 'Hash (#) can appear in key too'
'float_test' => '1.0'
'float_test_with_quotes' => '1.0'
- 'float_inverse_test' => 1.0
+ 'float_inverse_test' => 1
'a_really_large_number' => '11579208923731619542357098500...639936'
'int array' => [...]
'array on several lines' => [...]
---
tests/DumpTest.php | 6 +++---
tests/IndentTest.php | 4 ++--
tests/LoadTest.php | 2 +-
tests/ParseTest.php | 8 ++++----
tests/RoundTripTest.php | 14 +++++++-------
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/tests/DumpTest.php b/tests/DumpTest.php
index ceb5c8e..437c482 100644
--- a/tests/DumpTest.php
+++ b/tests/DumpTest.php
@@ -1,11 +1,11 @@
<?php
-class DumpTest extends PHPUnit_Framework_TestCase {
+class DumpTest extends \PHPUnit\Framework\TestCase {
private $files_to_test = array();
- public function setUp() {
- $this->files_to_test = array (__DIR__.'/../spyc.yaml', 'failing1.yaml', 'indent_1.yaml', 'quotes.yaml');
+ public function setUp(): void {
+ $this->files_to_test = array ('failing1.yaml', 'indent_1.yaml', 'quotes.yaml');
}
public function testShortSyntax() {
diff --git a/tests/IndentTest.php b/tests/IndentTest.php
index b7cdcab..226afb6 100644
--- a/tests/IndentTest.php
+++ b/tests/IndentTest.php
@@ -1,10 +1,10 @@
<?php
-class IndentTest extends PHPUnit_Framework_TestCase {
+class IndentTest extends \PHPUnit\Framework\TestCase {
protected $Y;
- protected function setUp() {
+ protected function setUp(): void {
$this->Y = Spyc::YAMLLoad(__DIR__."/indent_1.yaml");
}
diff --git a/tests/LoadTest.php b/tests/LoadTest.php
index a25d36f..12275be 100644
--- a/tests/LoadTest.php
+++ b/tests/LoadTest.php
@@ -1,6 +1,6 @@
<?php
-class LoadTest extends PHPUnit_Framework_TestCase {
+class LoadTest extends \PHPUnit\Framework\TestCase {
public function testQuotes() {
$test_values = array(
"adjacent '''' \"\"\"\" quotes.",
diff --git a/tests/ParseTest.php b/tests/ParseTest.php
index 2ce77ca..ff74e18 100644
--- a/tests/ParseTest.php
+++ b/tests/ParseTest.php
@@ -1,10 +1,10 @@
<?php
-class ParseTest extends PHPUnit_Framework_TestCase {
+class ParseTest extends \PHPUnit\Framework\TestCase {
protected $yaml;
- protected function setUp() {
+ protected function setUp(): void {
$this->yaml = spyc_load_file(__DIR__.'/../spyc.yaml');
}
@@ -325,12 +325,12 @@ dog', $this->yaml['many_lines']);
}
public function testKeysInMappedValueException() {
- $this->setExpectedException('Exception');
+ $this->expectException('Exception');
Spyc::YAMLLoad('x: y: z:');
}
public function testKeysInValueException() {
- $this->setExpectedException('Exception');
+ $this->expectException('Exception');
Spyc::YAMLLoad('x: y: z');
}
diff --git a/tests/RoundTripTest.php b/tests/RoundTripTest.php
index 3e707df..f9fd394 100644
--- a/tests/RoundTripTest.php
+++ b/tests/RoundTripTest.php
@@ -3,9 +3,9 @@
function roundTrip($a) { return Spyc::YAMLLoad(Spyc::YAMLDump(array('x' => $a))); }
-class RoundTripTest extends PHPUnit_Framework_TestCase {
+class RoundTripTest extends \PHPUnit\Framework\TestCase {
- protected function setUp() {
+ protected function setUp(): void {
}
public function testNull() {
@@ -15,7 +15,7 @@ class RoundTripTest extends PHPUnit_Framework_TestCase {
public function testY() {
$this->assertEquals (array ('x' => 'y'), roundTrip ('y'));
}
-
+
public function testExclam() {
$this->assertEquals (array ('x' => '!yeah'), roundTrip ('!yeah'));
}
@@ -27,13 +27,13 @@ class RoundTripTest extends PHPUnit_Framework_TestCase {
public function testSpaces() {
$this->assertEquals (array ('x' => 'x '), roundTrip ('x '));
}
-
+
public function testApostrophes() {
$this->assertEquals (array ('x' => "'biz'"), roundTrip ("'biz'"));
}
public function testNewLines() {
- $this->assertEquals (array ('x' => "\n"), roundTrip ("\n"));
+ $this->assertEquals (array ('x' => '\n'), roundTrip ("\n"));
}
public function testHashes() {
@@ -64,7 +64,7 @@ class RoundTripTest extends PHPUnit_Framework_TestCase {
public function testABCD() {
$this->assertEquals (array ('a', 'b', 'c', 'd'), Spyc::YAMLLoad(Spyc::YAMLDump(array('a', 'b', 'c', 'd'))));
}
-
+
public function testABCD2() {
$a = array('a', 'b', 'c', 'd'); // Create a simple list
$b = Spyc::YAMLDump($a); // Dump the list as YAML
@@ -72,5 +72,5 @@ class RoundTripTest extends PHPUnit_Framework_TestCase {
$d = Spyc::YAMLDump($c); // Re-dump the data
$this->assertSame($b, $d);
}
-
+
}
|