Skip to content

Commit 2b95b8a

Browse files
committed
Test trailing slashes
1 parent 2ff69f5 commit 2b95b8a

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@
22

33
namespace GnaHotelSolutions\LaravelTrailingSlash\Tests;
44

5-
use Orchestra\Testbench\TestCase;
5+
use Orchestra\Testbench\TestCase as BaseTestCase;
66
use GnaHotelSolutions\LaravelTrailingSlash\LaravelTrailingSlashServiceProvider;
77

8-
class ExampleTest extends TestCase
8+
class TestCase extends BaseTestCase
99
{
1010

1111
protected function getPackageProviders($app)
1212
{
1313
return [LaravelTrailingSlashServiceProvider::class];
1414
}
15-
16-
/** @test */
17-
public function true_is_true()
18-
{
19-
$this->assertTrue(true);
20-
}
15+
2116
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace GnaHotelSolutions\LaravelTrailingSlash\Tests;
4+
5+
class TrailingSlashUrlGeneratorTest extends TestCase
6+
{
7+
public function setUp(): void
8+
{
9+
parent::setUp();
10+
}
11+
12+
/** @test */
13+
public function if_configuration_activator_is_enabled_url_ends_with_trailing_slash()
14+
{
15+
$this->assertTrue(substr(url('profile'), -1) === '/');
16+
}
17+
18+
/** @test */
19+
public function if_configuration_activator_is_disabled_url_ends_with_no_trailing_slash()
20+
{
21+
config()->set('laravel-trailing-slash.active', false);
22+
$this->assertFalse(substr(url('profile'), -1) === '/');
23+
}
24+
}

0 commit comments

Comments
 (0)