Skip to content

Commit ef642d5

Browse files
Merge branch '5.4' into 6.2
* 5.4: minor #49253 [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/` (OskarStark)
2 parents 5a2294a + 64165df commit ef642d5

6 files changed

+20
-20
lines changed

Tests/PropertyAccessorArrayAccessTest.php renamed to Tests/PropertyAccessorArrayAccessTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\PropertyAccess\PropertyAccess;
1717
use Symfony\Component\PropertyAccess\PropertyAccessor;
1818

19-
abstract class PropertyAccessorArrayAccessTest extends TestCase
19+
abstract class PropertyAccessorArrayAccessTestCase extends TestCase
2020
{
2121
/**
2222
* @var PropertyAccessor

Tests/PropertyAccessorArrayObjectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\PropertyAccess\Tests;
1313

14-
class PropertyAccessorArrayObjectTest extends PropertyAccessorCollectionTest
14+
class PropertyAccessorArrayObjectTest extends PropertyAccessorCollectionTestCase
1515
{
1616
protected static function getContainer(array $array)
1717
{

Tests/PropertyAccessorArrayTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\PropertyAccess\Tests;
1313

14-
class PropertyAccessorArrayTest extends PropertyAccessorCollectionTest
14+
class PropertyAccessorArrayTest extends PropertyAccessorCollectionTestCase
1515
{
1616
protected static function getContainer(array $array)
1717
{

Tests/PropertyAccessorCollectionTest.php renamed to Tests/PropertyAccessorCollectionTestCase.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
1515

16-
class PropertyAccessorCollectionTest_Car
16+
class PropertyAccessorCollectionTestCase_Car
1717
{
1818
private $axes;
1919

@@ -45,7 +45,7 @@ public function getAxes()
4545
}
4646
}
4747

48-
class PropertyAccessorCollectionTest_CarOnlyAdder
48+
class PropertyAccessorCollectionTestCase_CarOnlyAdder
4949
{
5050
public function addAxis($axis)
5151
{
@@ -56,7 +56,7 @@ public function getAxes()
5656
}
5757
}
5858

59-
class PropertyAccessorCollectionTest_CarOnlyRemover
59+
class PropertyAccessorCollectionTestCase_CarOnlyRemover
6060
{
6161
public function removeAxis($axis)
6262
{
@@ -67,14 +67,14 @@ public function getAxes()
6767
}
6868
}
6969

70-
class PropertyAccessorCollectionTest_CarNoAdderAndRemover
70+
class PropertyAccessorCollectionTestCase_CarNoAdderAndRemover
7171
{
7272
public function getAxes()
7373
{
7474
}
7575
}
7676

77-
class PropertyAccessorCollectionTest_CompositeCar
77+
class PropertyAccessorCollectionTestCase_CompositeCar
7878
{
7979
public function getStructure()
8080
{
@@ -85,7 +85,7 @@ public function setStructure($structure)
8585
}
8686
}
8787

88-
class PropertyAccessorCollectionTest_CarStructure
88+
class PropertyAccessorCollectionTestCase_CarStructure
8989
{
9090
public function addAxis($axis)
9191
{
@@ -100,7 +100,7 @@ public function getAxes()
100100
}
101101
}
102102

103-
abstract class PropertyAccessorCollectionTest extends PropertyAccessorArrayAccessTest
103+
abstract class PropertyAccessorCollectionTestCase extends PropertyAccessorArrayAccessTestCase
104104
{
105105
public function testSetValueCallsAdderAndRemoverForCollections()
106106
{
@@ -111,7 +111,7 @@ public function testSetValueCallsAdderAndRemoverForCollections()
111111

112112
// Don't use a mock in order to test whether the collections are
113113
// modified while iterating them
114-
$car = new PropertyAccessorCollectionTest_Car($axesBefore);
114+
$car = new PropertyAccessorCollectionTestCase_Car($axesBefore);
115115

116116
$this->propertyAccessor->setValue($car, 'axes', $axesMerged);
117117

@@ -151,7 +151,7 @@ public function testSetValueCallsAdderAndRemoverForNestedCollections()
151151
public function testSetValueFailsIfNoAdderNorRemoverFound()
152152
{
153153
$this->expectException(NoSuchPropertyException::class);
154-
$this->expectExceptionMessageMatches('/Could not determine access type for property "axes" in class "Mock_PropertyAccessorCollectionTest_CarNoAdderAndRemover_[^"]*"./');
154+
$this->expectExceptionMessageMatches('/Could not determine access type for property "axes" in class "Mock_PropertyAccessorCollectionTestCase_CarNoAdderAndRemover_[^"]*"./');
155155
$car = $this->createMock(__CLASS__.'_CarNoAdderAndRemover');
156156
$axesBefore = $this->getContainer([1 => 'second', 3 => 'fourth']);
157157
$axesAfter = $this->getContainer([0 => 'first', 1 => 'second', 2 => 'third']);
@@ -165,33 +165,33 @@ public function testSetValueFailsIfNoAdderNorRemoverFound()
165165

166166
public function testIsWritableReturnsTrueIfAdderAndRemoverExists()
167167
{
168-
$car = new PropertyAccessorCollectionTest_Car();
168+
$car = new PropertyAccessorCollectionTestCase_Car();
169169
$this->assertTrue($this->propertyAccessor->isWritable($car, 'axes'));
170170
}
171171

172172
public function testIsWritableReturnsFalseIfOnlyAdderExists()
173173
{
174-
$car = new PropertyAccessorCollectionTest_CarOnlyAdder();
174+
$car = new PropertyAccessorCollectionTestCase_CarOnlyAdder();
175175
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
176176
}
177177

178178
public function testIsWritableReturnsFalseIfOnlyRemoverExists()
179179
{
180-
$car = new PropertyAccessorCollectionTest_CarOnlyRemover();
180+
$car = new PropertyAccessorCollectionTestCase_CarOnlyRemover();
181181
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
182182
}
183183

184184
public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists()
185185
{
186-
$car = new PropertyAccessorCollectionTest_CarNoAdderAndRemover();
186+
$car = new PropertyAccessorCollectionTestCase_CarNoAdderAndRemover();
187187
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
188188
}
189189

190190
public function testSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable()
191191
{
192192
$this->expectException(NoSuchPropertyException::class);
193-
$this->expectExceptionMessageMatches('/The property "axes" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\PropertyAccessorCollectionTest_Car" can be defined with the methods "addAxis\(\)", "removeAxis\(\)" but the new value must be an array or an instance of \\\Traversable\./');
194-
$car = new PropertyAccessorCollectionTest_Car();
193+
$this->expectExceptionMessageMatches('/The property "axes" in class "Symfony\\\Component\\\PropertyAccess\\\Tests\\\PropertyAccessorCollectionTestCase_Car" can be defined with the methods "addAxis\(\)", "removeAxis\(\)" but the new value must be an array or an instance of \\\Traversable\./');
194+
$car = new PropertyAccessorCollectionTestCase_Car();
195195

196196
$this->propertyAccessor->setValue($car, 'axes', 'Not an array or Traversable');
197197
}

Tests/PropertyAccessorNonTraversableArrayObjectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\PropertyAccess\Tests\Fixtures\NonTraversableArrayObject;
1515

16-
class PropertyAccessorNonTraversableArrayObjectTest extends PropertyAccessorArrayAccessTest
16+
class PropertyAccessorNonTraversableArrayObjectTest extends PropertyAccessorArrayAccessTestCase
1717
{
1818
protected static function getContainer(array $array)
1919
{

Tests/PropertyAccessorTraversableArrayObjectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\PropertyAccess\Tests\Fixtures\TraversableArrayObject;
1515

16-
class PropertyAccessorTraversableArrayObjectTest extends PropertyAccessorCollectionTest
16+
class PropertyAccessorTraversableArrayObjectTest extends PropertyAccessorCollectionTestCase
1717
{
1818
protected static function getContainer(array $array)
1919
{

0 commit comments

Comments
 (0)