public function testFetchLatest10Posts() { $posts = $this->repository->latest10(); $this->assertEquals(10, count($posts)); // 確認是從 100 ~ 91 倒數 $i = 100; foreach ($posts as $post) { $this->assertEquals('title ' . $i, $post->title); $this->assertEquals('body ' . $i, $post->body); $i -= 1; } }