| 1 | <?php |
||
| 11 | class AssertJsonResponseForOldVersionAndBrowserKitTest extends PHPUnit_Framework_TestCase |
||
| 12 | { |
||
| 13 | use AssertJsonResponse, MakesHttpRequests; |
||
| 14 | |||
| 15 | public function setUp() |
||
| 16 | { |
||
| 17 | $this->stub = new JsonSerializableMixedResourcesStub; |
||
|
|
|||
| 18 | $this->response = new Response($this->stub); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function testSeeJsonStructureEquals() |
||
| 22 | { |
||
| 23 | $this->assertJsonStructureEquals($this->stub->structure()); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function testJsonResponse() |
||
| 27 | { |
||
| 28 | $this->assertEquals( |
||
| 29 | ['foobar_foo' => 'foo', 'foobar_bar' => 212], |
||
| 30 | $this->jsonResponse('foobar') |
||
| 31 | ); |
||
| 32 | $this->assertEquals(212, $this->jsonResponse('foobar.foobar_bar')); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function testSeeJsonTypedStructure() |
||
| 39 | } |
||
| 40 |
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: