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
|
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Wed, 12 Feb 2025 18:24:27 +0100
Subject: Compatibility with recent PHPUnit (12)
---
tests/DeepCopyTest/DeepCopyTest.php | 3 +++
tests/DeepCopyTest/Filter/ReplaceFilterTest.php | 2 ++
tests/DeepCopyTest/Matcher/Doctrine/DoctrineProxyMatcherTest.php | 2 ++
tests/DeepCopyTest/Matcher/PropertyMatcherTest.php | 2 ++
tests/DeepCopyTest/Matcher/PropertyNameMatcherTest.php | 2 ++
tests/DeepCopyTest/Matcher/PropertyTypeMatcherTest.php | 2 ++
tests/DeepCopyTest/Reflection/ReflectionHelperTest.php | 2 ++
tests/DeepCopyTest/TypeMatcher/TypeMatcherTest.php | 2 ++
8 files changed, 17 insertions(+)
diff --git a/tests/DeepCopyTest/DeepCopyTest.php b/tests/DeepCopyTest/DeepCopyTest.php
index a4cf8e1..7e3157e 100644
--- a/tests/DeepCopyTest/DeepCopyTest.php
+++ b/tests/DeepCopyTest/DeepCopyTest.php
@@ -33,6 +33,7 @@ use DeepCopy\Matcher\PropertyTypeMatcher;
use DeepCopy\TypeFilter\ReplaceFilter;
use DeepCopy\TypeFilter\ShallowCopyFilter;
use DeepCopy\TypeMatcher\TypeMatcher;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use RecursiveArrayIterator;
use SplDoublyLinkedList;
@@ -47,6 +48,7 @@ class DeepCopyTest extends TestCase
/**
* @dataProvider provideScalarValues
*/
+ #[DataProvider('provideScalarValues')]
public function test_it_can_copy_scalar_values($value)
{
$copy = deep_copy($value);
@@ -95,6 +97,7 @@ class DeepCopyTest extends TestCase
/**
* @dataProvider provideObjectWithScalarValues
*/
+ #[DataProvider('provideObjectWithScalarValues')]
public function test_it_can_copy_an_object_with_scalar_properties($object, $expectedVal)
{
$copy = deep_copy($object);
diff --git a/tests/DeepCopyTest/Filter/ReplaceFilterTest.php b/tests/DeepCopyTest/Filter/ReplaceFilterTest.php
index f0e0c21..57bc390 100644
--- a/tests/DeepCopyTest/Filter/ReplaceFilterTest.php
+++ b/tests/DeepCopyTest/Filter/ReplaceFilterTest.php
@@ -3,6 +3,7 @@
namespace DeepCopyTest\Filter;
use DeepCopy\Filter\ReplaceFilter;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use stdClass;
@@ -14,6 +15,7 @@ class ReplaceFilterTest extends TestCase
/**
* @dataProvider provideCallbacks
*/
+ #[DataProvider('provideCallbacks')]
public function test_it_applies_the_callback_to_the_specified_property(callable $callback, array $expected)
{
$object = new stdClass();
diff --git a/tests/DeepCopyTest/Matcher/Doctrine/DoctrineProxyMatcherTest.php b/tests/DeepCopyTest/Matcher/Doctrine/DoctrineProxyMatcherTest.php
index 30196cf..f05f195 100644
--- a/tests/DeepCopyTest/Matcher/Doctrine/DoctrineProxyMatcherTest.php
+++ b/tests/DeepCopyTest/Matcher/Doctrine/DoctrineProxyMatcherTest.php
@@ -5,6 +5,7 @@ namespace DeepCopyTest\Matcher\Doctrine;
use BadMethodCallException;
use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher;
use Doctrine\Persistence\Proxy;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use stdClass;
@@ -16,6 +17,7 @@ class DoctrineProxyMatcherTest extends TestCase
/**
* @dataProvider providePairs
*/
+ #[DataProvider('providePairs')]
public function test_it_matches_the_given_objects($object, $expected)
{
$matcher = new DoctrineProxyMatcher();
diff --git a/tests/DeepCopyTest/Matcher/PropertyMatcherTest.php b/tests/DeepCopyTest/Matcher/PropertyMatcherTest.php
index 5bcb184..aa8991a 100644
--- a/tests/DeepCopyTest/Matcher/PropertyMatcherTest.php
+++ b/tests/DeepCopyTest/Matcher/PropertyMatcherTest.php
@@ -3,6 +3,7 @@
namespace DeepCopyTest\Matcher;
use DeepCopy\Matcher\PropertyMatcher;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
/**
@@ -13,6 +14,7 @@ class PropertyMatcherTest extends TestCase
/**
* @dataProvider providePairs
*/
+ #[DataProvider('providePairs')]
public function test_it_matches_the_given_objects($object, $prop, $expected)
{
$matcher = new PropertyMatcher(X::class, 'foo');
diff --git a/tests/DeepCopyTest/Matcher/PropertyNameMatcherTest.php b/tests/DeepCopyTest/Matcher/PropertyNameMatcherTest.php
index 2eef4e8..356b387 100644
--- a/tests/DeepCopyTest/Matcher/PropertyNameMatcherTest.php
+++ b/tests/DeepCopyTest/Matcher/PropertyNameMatcherTest.php
@@ -3,6 +3,7 @@
namespace DeepCopyTest\Matcher;
use DeepCopy\Matcher\PropertyNameMatcher;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use stdClass;
@@ -14,6 +15,7 @@ class PropertyNameMatcherTest extends TestCase
/**
* @dataProvider providePairs
*/
+ #[DataProvider('providePairs')]
public function test_it_matches_the_given_property($object, $prop, $expected)
{
$matcher = new PropertyNameMatcher('foo');
diff --git a/tests/DeepCopyTest/Matcher/PropertyTypeMatcherTest.php b/tests/DeepCopyTest/Matcher/PropertyTypeMatcherTest.php
index 269884c..697ebcb 100644
--- a/tests/DeepCopyTest/Matcher/PropertyTypeMatcherTest.php
+++ b/tests/DeepCopyTest/Matcher/PropertyTypeMatcherTest.php
@@ -4,6 +4,7 @@ namespace DeepCopyTest\Matcher;
use DeepCopy\f009;
use DeepCopy\Matcher\PropertyTypeMatcher;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use stdClass;
@@ -15,6 +16,7 @@ class PropertyTypeMatcherTest extends TestCase
/**
* @dataProvider providePairs
*/
+ #[DataProvider('providePairs')]
public function test_it_matches_the_given_property($object, $expected)
{
$matcher = new PropertyTypeMatcher(PropertyTypeMatcherTestFixture2::class);
diff --git a/tests/DeepCopyTest/Reflection/ReflectionHelperTest.php b/tests/DeepCopyTest/Reflection/ReflectionHelperTest.php
index 34800d9..a6fcfea 100644
--- a/tests/DeepCopyTest/Reflection/ReflectionHelperTest.php
+++ b/tests/DeepCopyTest/Reflection/ReflectionHelperTest.php
@@ -4,6 +4,7 @@ namespace DeepCopyTest\Reflection;
use DeepCopy\Exception\PropertyException;
use DeepCopy\Reflection\ReflectionHelper;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use ReflectionProperty;
@@ -41,6 +42,7 @@ class ReflectionHelperTest extends TestCase
/**
* @dataProvider provideProperties
*/
+ #[DataProvider('provideProperties')]
public function test_it_can_retrieve_an_object_property($name)
{
$object = new ReflectionHelperTestChild();
diff --git a/tests/DeepCopyTest/TypeMatcher/TypeMatcherTest.php b/tests/DeepCopyTest/TypeMatcher/TypeMatcherTest.php
index 2f18be1..c2e332a 100644
--- a/tests/DeepCopyTest/TypeMatcher/TypeMatcherTest.php
+++ b/tests/DeepCopyTest/TypeMatcher/TypeMatcherTest.php
@@ -3,6 +3,7 @@
namespace DeepCopyTest\TypeMatcher;
use DeepCopy\TypeMatcher\TypeMatcher;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use stdClass;
@@ -14,6 +15,7 @@ class TypeMatcherTest extends TestCase
/**
* @dataProvider provideElements
*/
+ #[DataProvider('provideElements')]
public function test_it_retrieves_the_object_properties($type, $element, $expected)
{
$matcher = new TypeMatcher($type);
|