commit(); $this->article1Id = $article1->getId(); $this->article2Id = $article2->getId(); $this->article3Id = $article3->getId(); } function testGetDoArticles() { $response = TestEnv::http()->newRequest() ->get(['api', 'articles']) ->exec(); $articleStructs = $response->parseJson(); $this->assertCount(3, $articleStructs); $this->assertEquals('Title 3', $articleStructs[0]['title']); $this->assertEquals('Title 2', $articleStructs[1]['title']); $this->assertEquals('Title 1', $articleStructs[2]['title']); } function testGetDoArticlesByCategory() { $response = TestEnv::http()->newRequest() ->get(['api', 'articles', 'categoryName']) ->exec(); $articleStructs = $response->parseJson(); $this->assertCount(3, $articleStructs); $this->assertEquals('teaser', $articleStructs[0]['categoryName']); $this->assertEquals('news', $articleStructs[1]['categoryName']); $this->assertEquals('news', $articleStructs[2]['categoryName']); } function testGetDoArticle() { } }