Skip to content

Commit 99271ae

Browse files
committed
Deprecate all attribute related constraints and traits.
more information can be found here: https://thephp.cc/news/2019/02/help-my-tests-stopped-working#assertions-and-non-public-attributes
1 parent 12af992 commit 99271ae

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/Constraint/DefaultAttributesValues.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Constraint to assert the existence and default values of attributes.
1616
*
1717
* @author Mathias Gelhausen <[email protected]>
18+
* @deprecated Testing internal object state is bad practice.
19+
* (see: https://thephp.cc/news/2019/02/help-my-tests-stopped-working#assertions-and-non-public-attributes)
1820
*/
1921
class DefaultAttributesValues extends \PHPUnit_Framework_Constraint
2022
{

src/TestCase/AssertDefaultAttributesValuesTrait.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
* @method static void assertThat($value, \PHPUnit_Framework_Constraint $constraint, $message = '')
2121
*
2222
* @author Mathias Gelhausen <[email protected]>
23+
*
24+
* @deprecated Testing internal object state is bad practice.
25+
* (see: https://thephp.cc/news/2019/02/help-my-tests-stopped-working#assertions-and-non-public-attributes)
2326
*/
2427
trait AssertDefaultAttributesValuesTrait
2528
{

src/TestCase/TestDefaultAttributesTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
* @property array $defaultAttributes
2727
*
2828
* @author Mathias Gelhausen <[email protected]>
29+
* @deprecated Testing internal object state is bad practice.
30+
* (see: https://thephp.cc/news/2019/02/help-my-tests-stopped-working#assertions-and-non-public-attributes)
2931
*/
3032
trait TestDefaultAttributesTrait
3133
{

0 commit comments

Comments
 (0)