getDocBlockResponses($tags); $this->assertEquals($expected[0]['status'], $results[0]['status']); $this->assertEquals($expected[1]['status'], $results[1]['status']); $this->assertEquals($expected[0]['description'], $results[0]['description']); $this->assertEquals($expected[1]['description'], $results[1]['description']); $this->assertEquals($expected[0]['content'], json_decode($results[0]['content'], true)); $this->assertEquals($expected[1]['content'], json_decode($results[1]['content'], true)); } public static function responseTags() { $response1 = '{ "id": 4, "name": "banana" }'; $response2 = '{ "message": "Unauthorized" }'; return [ "with status as initial position" => [ [ new Tag('response', $response1), new Tag('response', "401 $response2"), ], [ [ 'status' => 200, 'description' => '', 'content' => [ 'id' => 4, 'name' => 'banana', ], ], [ 'status' => 401, 'description' => '', 'content' => [ 'message' => 'Unauthorized', ], ], ], ], "with fields" => [ [ new Tag('response', "scenario=\"success\" $response1"), new Tag('response', "status=401 scenario='auth problem' $response2"), ], [ [ 'status' => 200, 'description' => 'success', 'content' => [ 'id' => 4, 'name' => 'banana', ], ], [ 'status' => 401, 'description' => 'auth problem', 'content' => [ 'message' => 'Unauthorized', ], ], ], ], ]; } }