forked from pestphp/pest-plugin-profanity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoHaveProfanity.php
More file actions
54 lines (42 loc) · 2.22 KB
/
toHaveProfanity.php
File metadata and controls
54 lines (42 loc) · 2.22 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
<?php
declare(strict_types=1);
use Pest\Arch\Exceptions\ArchExpectationFailedException;
it('fails if a file contains profanity in class name', function () {
expect('Tests\Fixtures\HasProfanityInShitClass')
->toHaveNoProfanity();
})->throws(ArchExpectationFailedException::class);
it('fails if a file contains profanity in a comment', function () {
expect('Tests\Fixtures\HasProfanityInComment')
->toHaveNoProfanity();
})->throws(ArchExpectationFailedException::class);
it('fails if a file contains profanity in a method', function () {
expect('Tests\Fixtures\HasProfanityInMethod')
->toHaveNoProfanity();
})->throws(ArchExpectationFailedException::class);
it('fails if a file contains profanity in a property', function () {
expect('Tests\Fixtures\HasProfanityInProperty')
->toHaveNoProfanity();
})->throws(ArchExpectationFailedException::class);
it('fails if a file contains russian profanity', function () {
expect('Tests\Fixtures\HasExplicitRussianProfanity')->toHaveNoProfanity(language: 'ru');
})->throws(ArchExpectationFailedException::class);
it('fails if file contains profanity manually included', function () {
expect('Tests\Fixtures\HasUncoveredProfanity')
->toHaveNoProfanity(including: ['dagnabbit']);
})->throws(ArchExpectationFailedException::class);
it('fails if file contains profanity when a specific language has been set', function () {
expect('Tests\Fixtures\HasProfanityInComment')
->toHaveNoProfanity(language: 'en');
})->throws(ArchExpectationFailedException::class);
it('fails if file contains profanity of multiple specified language', function () {
expect('Tests\Fixtures\HasProfanityInComment')
->toHaveNoProfanity(language: ['en', 'ar']);
})->throws(ArchExpectationFailedException::class);
it('fails if file contains profanity in middle of snake_case', function () {
expect('Tests\Fixtures\HasProfanityInAttributeAsArrayKeySnakeCase')
->toHaveNoProfanity();
})->throws(ArchExpectationFailedException::class);
it('fails if file contains profanity in camelCase', function () {
expect('Tests\Fixtures\HasProfanityInClassWithCamelCaseProfanityMethod')
->toHaveNoProfanity();
})->throws(ArchExpectationFailedException::class);