-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIdentifierTest.php
More file actions
38 lines (29 loc) · 868 Bytes
/
Copy pathIdentifierTest.php
File metadata and controls
38 lines (29 loc) · 868 Bytes
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
<?php
namespace Tests;
use Mniknab\Surl\Traits\Identifier;
/**
* Class IdentifierTest
* @author MohammadNiknab <MohammadNiknab@gmail.com>
*/
class IdentifierTest extends TestCase
{
use Identifier;
/** @test */
public function it_generate_a_correct_identifier_length()
{
$identifier = $this->getSlugOrHashIdentifier();
$this->assertEquals(strlen($identifier), config('surl.identifier_hash_length'));
}
/** @test */
public function it_generate_a_sanitize_identifier()
{
$identifier = $this->getSlugOrHashIdentifier('laravel/ surl!');
$this->assertEquals($identifier, 'laravel-surl');
}
/** @test */
public function it_generate_a_lowered_identifier()
{
$identifier = $this->getSlugOrHashIdentifier('LaRaVeL');
$this->assertEquals($identifier, 'laravel');
}
}