original->getData()['props']), JSON_OBJECT_AS_ARRAY); if ($key) { return Arr::get($props, $key); } return $props; }); TestResponse::macro('assertHasProp', function ($key) { Assert::assertTrue(Arr::has($this->props(), $key)); return $this; }); TestResponse::macro('assertPropValue', function ($key, $value) { $this->assertHasProp($key); if (is_callable($value)) { $value($this->props($key)); } else { Assert::assertEquals($this->props($key), $value); } return $this; }); TestResponse::macro('assertPropCount', function ($key, $count) { $this->assertHasProp($key); Assert::assertCount($count, $this->props($key)); return $this; }); } }