-
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathPluginShowSupportChannelTest.php
More file actions
57 lines (43 loc) · 1.58 KB
/
PluginShowSupportChannelTest.php
File metadata and controls
57 lines (43 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace Tests\Feature;
use App\Features\ShowPlugins;
use App\Models\Plugin;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Laravel\Pennant\Feature;
use Tests\TestCase;
class PluginShowSupportChannelTest extends TestCase
{
use RefreshDatabase;
protected function setUp(): void
{
parent::setUp();
Feature::define(ShowPlugins::class, true);
}
public function test_long_support_url_is_truncated_in_display_text(): void
{
$plugin = Plugin::factory()->approved()->create([
'support_channel' => 'https://github.com/SRWieZ/nativephp-mobile-packages',
]);
$response = $this->get(route('plugins.show', $plugin->routeParams()));
$response->assertStatus(200);
$response->assertSee('github.com/SRWieZ/nativep...', false);
}
public function test_support_url_display_strips_protocol(): void
{
$plugin = Plugin::factory()->approved()->create([
'support_channel' => 'https://example.com/support',
]);
$response = $this->get(route('plugins.show', $plugin->routeParams()));
$response->assertStatus(200);
$response->assertSee('example.com/support', false);
}
public function test_email_support_channel_is_not_truncated(): void
{
$plugin = Plugin::factory()->approved()->create([
'support_channel' => 'support@example.com',
]);
$response = $this->get(route('plugins.show', $plugin->routeParams()));
$response->assertStatus(200);
$response->assertSee('support@example.com', false);
}
}