123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace Tests\ContentManage\Output;
- // use Illuminate\Foundation\Testing\RefreshDatabase;
- use Tests\TestCase;
- /**
- * 输出测试
- */
- class OutputTest extends TestCase
- {
- private string $query = 'channel_name=zhuishuyun&channel_key=123456';
- private string $prefix = '/api/output/';
- /**
- *
- *书籍列表
- * @return void
- */
- public function test_book_list()
- {
- $response = $this->getJson($this->prefix.'booklist?'.$this->query);
- print_r(json_decode($response->getContent(),1));
- $response->assertStatus(200);
- }
- public function test_book_detail()
- {
- $response = $this->getJson($this->prefix.'bookdetail/1?'.$this->query);
- print_r(json_decode($response->getContent(),1));
- $response->assertStatus(200);
- }
- public function test_chapter_list()
- {
- $response = $this->getJson($this->prefix.'chapterlist/1?'.$this->query);
- //print_r(json_decode($response->getContent(),1));
- $response->assertStatus(200);
- }
- public function test_chapter_content()
- {
- $response = $this->getJson($this->prefix.'chaptercontent/1/chapterid/1?'.$this->query);
- print_r(json_decode($response->getContent(),1));
- $response->assertStatus(200)->assertJsonPath('code', 10000);
- }
- public function test_categories()
- {
- $response = $this->getJson($this->prefix.'listCategories?'.$this->query);
- print_r(json_decode($response->getContent(),1));
- $response->assertStatus(200)->assertJsonPath('code', 10000);
- }
- }
|