| 1 | <?php |
||
| 11 | class AssertJsonResponseForNewVersionTest extends PHPUnit_Framework_TestCase |
||
| 12 | { |
||
| 13 | use AssertJsonResponse; |
||
| 14 | |||
| 15 | public function setUp() |
||
| 16 | { |
||
| 17 | if (!class_exists(TestResponse::class)) { |
||
| 18 | $this->markTestSkipped('Not compatible with this version.'); |
||
| 19 | } |
||
| 20 | |||
| 21 | $this->stub = new JsonSerializableMixedResourcesStub; |
||
|
|
|||
| 22 | $this->response = new TestResponse(new Response($this->stub)); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function testSeeJsonStructureEquals() |
||
| 26 | { |
||
| 27 | $this->assertTrue(TestResponse::hasMacro('assertJsonStructureEquals')); |
||
| 28 | |||
| 29 | $this->response->assertJsonStructureEquals($this->stub->structure()); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function testSeeJsonTypedStructure() |
||
| 38 | |||
| 39 | public function testJsonResponse() |
||
| 40 | { |
||
| 47 | } |
||
| 48 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: