-
Notifications
You must be signed in to change notification settings - Fork 186
/
Copy pathStripStringOverlapTest.php
45 lines (36 loc) Β· 1.03 KB
/
StripStringOverlapTest.php
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
<?php
declare(strict_types = 1);
namespace LanguageServer\Tests\Utils;
use PHPUnit\Framework\TestCase;
use function LanguageServer\stripStringOverlap;
class StripStringOverlapTest extends TestCase
{
public function testNoCharOverlaps()
{
$this->assertEquals('<?php', stripStringOverlap('bla', '<?php'));
}
public function test1CharOverlaps()
{
$this->assertEquals('?php', stripStringOverlap('bla<', '<?php'));
}
public function test2CharsOverlap()
{
$this->assertEquals('php', stripStringOverlap('bla<?', '<?php'));
}
public function testEverythingOverlaps()
{
$this->assertEquals('', stripStringOverlap('bla<?php', '<?php'));
}
public function testEmptyA()
{
$this->assertEquals('<?php', stripStringOverlap('', '<?php'));
}
public function testEmptyB()
{
$this->assertEquals('', stripStringOverlap('bla', ''));
}
public function testBothEmpty()
{
$this->assertEquals('', stripStringOverlap('', ''));
}
}