1: <?php
2: namespace Peridot\Leo\Interfaces\Assert;
3:
4: 5: 6: 7: 8: 9:
10: trait ObjectAssertTrait
11: {
12: 13: 14: 15: 16: 17: 18:
19: public function isInstanceOf($object, $class, $message = "")
20: {
21: $this->assertion->setActual($object);
22: return $this->assertion->is->instanceof($class, $message);
23: }
24:
25: 26: 27: 28: 29: 30: 31:
32: public function notInstanceOf($object, $class, $message = "")
33: {
34: $this->assertion->setActual($object);
35: return $this->assertion->is->not->instanceof($class, $message);
36: }
37:
38: 39: 40: 41: 42: 43: 44:
45: public function property($object, $property, $message = "")
46: {
47: $this->assertion->setActual($object);
48: return $this->assertion->to->have->property($property, null, $message);
49: }
50:
51: 52: 53: 54: 55: 56: 57:
58: public function notProperty($object, $property, $message = "")
59: {
60: $this->assertion->setActual($object);
61: return $this->assertion->to->not->have->property($property, null, $message);
62: }
63:
64: 65: 66: 67: 68: 69: 70:
71: public function deepProperty($object, $property, $message = "")
72: {
73: $this->assertion->setActual($object);
74: return $this->assertion->to->have->deep->property($property, null, $message);
75: }
76:
77: 78: 79: 80: 81: 82: 83:
84: public function notDeepProperty($object, $property, $message = "")
85: {
86: $this->assertion->setActual($object);
87: return $this->assertion->to->not->have->deep->property($property, null, $message);
88: }
89:
90: 91: 92: 93: 94: 95: 96: 97:
98: public function propertyVal($object, $property, $value, $message = "")
99: {
100: $this->assertion->setActual($object);
101: return $this->assertion->to->have->property($property, $value, $message);
102: }
103:
104: 105: 106: 107: 108: 109: 110: 111:
112: public function propertyNotVal($object, $property, $value, $message = "")
113: {
114: $this->assertion->setActual($object);
115: return $this->assertion->to->not->have->property($property, $value, $message);
116: }
117:
118: 119: 120: 121: 122: 123: 124: 125:
126: public function deepPropertyVal($object, $property, $value, $message = "")
127: {
128: $this->assertion->setActual($object);
129: return $this->assertion->to->have->deep->property($property, $value, $message);
130: }
131:
132: 133: 134: 135: 136: 137: 138: 139:
140: public function deepPropertyNotVal($object, $property, $value, $message = "")
141: {
142: $this->assertion->setActual($object);
143: return $this->assertion->to->not->have->deep->property($property, $value, $message);
144: }
145: }
146: