|
|
@@ -160,12 +160,16 @@ class ActivityCatalogTest extends TestCase
|
|
|
{
|
|
|
$this->assertSame(HttpStatus::OK, $this->save(['type' => 1, 'click_type' => 'internal', 'link_pc' => '/pc/promo', 'link_h5' => '/h5/promo', 'click_position' => 'cover',
|
|
|
'start_time' => '2000-01-01', 'end_time' => '2099-12-31'])['code']);
|
|
|
- foreach (['PC' => '/pc/promo', 'H5' => '/h5/promo', 'APP' => '/h5/promo'] as $platform => $target) {
|
|
|
- $this->app->instance('request', Request::create('/api/ActivityReward', 'GET', ['platform' => $platform]));
|
|
|
+ foreach (['PC' => '/pc/promo', 'H5' => '/h5/promo', 'APP' => '/h5/promo', 'h5' => '/h5/promo', '' => '/pc/promo'] as $platform => $target) {
|
|
|
+ $request = Request::create('/api/ActivityReward', 'GET', ['platform' => $platform === 'PC' ? 'H5' : 'PC']);
|
|
|
+ if ($platform !== '') $request->headers->set('Platform', $platform);
|
|
|
+ $this->app->instance('request', $request);
|
|
|
$body = (new \App\Http\Controllers\api\ActivityReward())->index()->getData(true);
|
|
|
$this->assertSame(0, $body['code'], $body['msg']);
|
|
|
$this->assertSame($target, $body['data'][0]['link']);
|
|
|
$this->assertTrue($body['data'][0]['can_jump']);
|
|
|
+ $this->assertArrayNotHasKey('link_pc', $body['data'][0]);
|
|
|
+ $this->assertArrayNotHasKey('link_h5', $body['data'][0]);
|
|
|
}
|
|
|
}
|
|
|
|