@@ -24,26 +24,56 @@ public function __construct(object $object)
2424 /**
2525 * Expect that an object does not have a specified attribute.
2626 *
27+ * @deprecated Deprecated in favour of notToHaveProperty
28+ *
2729 * @param string $attributeName
2830 * @param string $message
2931 * @return self
3032 */
3133 public function notToHaveAttribute (string $ attributeName , string $ message = '' ): self
3234 {
33- Assert::assertObjectNotHasAttribute ($ attributeName , $ this ->actual , $ message );
35+ Assert::assertObjectNotHasProperty ($ attributeName , $ this ->actual , $ message );
3436 return $ this ;
3537 }
3638
3739 /**
3840 * Expect that an object has a specified attribute.
3941 *
42+ * @deprecated Deprecated in favour of toHaveProperty
43+ *
4044 * @param string $attributeName
4145 * @param string $message
4246 * @return self
4347 */
4448 public function toHaveAttribute (string $ attributeName , string $ message = '' ): self
4549 {
46- Assert::assertObjectHasAttribute ($ attributeName , $ this ->actual , $ message );
50+ Assert::assertObjectHasProperty ($ attributeName , $ this ->actual , $ message );
51+ return $ this ;
52+ }
53+
54+ /**
55+ * Expect that an object does not have a specified property.
56+ *
57+ * @param string $propertyName
58+ * @param string $message
59+ * @return self
60+ */
61+ public function notToHaveProperty (string $ propertyName , string $ message = '' ): self
62+ {
63+ Assert::assertObjectNotHasProperty ($ propertyName , $ this ->actual , $ message );
64+ return $ this ;
65+ }
66+
67+ /**
68+ * Expect that an object has a specified property.
69+ *
70+ * @param string $propertyName
71+ * @param string $message
72+ * @return self
73+ */
74+ public function toHaveProperty (string $ propertyName , string $ message = '' ): self
75+ {
76+ Assert::assertObjectHasProperty ($ propertyName , $ this ->actual , $ message );
4777 return $ this ;
4878 }
4979}
0 commit comments