| 1 | <?php |
||
| 36 | class ObjectEnsuranceTest extends TestCase |
||
| 37 | { |
||
| 38 | public function testIsInstanceOf() |
||
| 39 | { |
||
| 40 | $ea = new EA(); |
||
| 41 | |||
| 42 | ensure($ea)->isObject()->isInstanceOf(EA::class); |
||
| 43 | } |
||
| 44 | |||
| 45 | public function testIs() |
||
| 46 | { |
||
| 47 | $ea = new EA(); |
||
| 48 | |||
| 49 | ensure($ea)->isObject()->is(EA::class); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function testIsSome() |
||
| 53 | { |
||
| 54 | $eb = new EB(); |
||
| 55 | |||
| 56 | ensure($eb)->isObject()->isSome(EA::class); |
||
| 57 | } |
||
| 58 | |||
| 59 | public function testExtends() |
||
| 60 | { |
||
| 61 | $eb = new EB(); |
||
| 62 | |||
| 63 | ensure($eb)->isObject()->extends(EA::class); |
||
| 64 | } |
||
| 65 | |||
| 66 | public function testImplements() |
||
| 67 | { |
||
| 68 | $ec = new EC(); |
||
| 69 | |||
| 70 | ensure($ec)->isObject()->implements(EI::class); |
||
| 71 | } |
||
| 72 | |||
| 73 | public function testIsParentOf() |
||
| 74 | { |
||
| 75 | $ea = new EA(); |
||
| 76 | |||
| 77 | ensure($ea)->isObject()->isParentOf(EB::class); |
||
| 78 | } |
||
| 79 | |||
| 80 | public function testUses() |
||
| 81 | { |
||
| 82 | $ed = new ED(); |
||
| 83 | |||
| 84 | ensure($ed)->isObject()->uses(ET::class); |
||
| 85 | } |
||
| 86 | |||
| 87 | public function testHasProperty() |
||
| 88 | { |
||
| 89 | $ea = new EA(); |
||
| 90 | |||
| 91 | ensure($ea)->isObject()->hasProperty('test'); |
||
| 92 | } |
||
| 93 | |||
| 94 | public function testHasMethod() |
||
| 95 | { |
||
| 96 | $ea = new EA(); |
||
| 97 | |||
| 98 | ensure($ea)->isObject()->hasMethod('foo'); |
||
| 99 | } |
||
| 100 | } |