-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathexit_code_test.sh
More file actions
73 lines (68 loc) · 3.26 KB
/
exit_code_test.sh
File metadata and controls
73 lines (68 loc) · 3.26 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
function tear_down() {
rm -f tests/EndToEnd/Fixtures/*.fixed
}
function test_phpcs_exit_code_clean_file() {
bin/phpcs --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc
assert_exit_code 0
}
function test_phpcs_exit_code_clean_stdin() {
bin/phpcs --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist < tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc
assert_exit_code 0
}
function test_phpcbf_exit_code_clean_file() {
bin/phpcbf --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc
assert_exit_code 0
}
function test_phpcbf_exit_code_clean_stdin() {
bin/phpcbf --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist < tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc
assert_exit_code 0
}
function test_phpcs_exit_code_fixable_file() {
bin/phpcs --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc
assert_exit_code 1
}
function test_phpcs_exit_code_fixable_stdin() {
bin/phpcs --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist < tests/EndToEnd/Fixtures/ClassWithStyleError.inc
assert_exit_code 1
}
function test_phpcbf_exit_code_fixable_file() {
bin/phpcbf --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc
assert_exit_code 0
}
function test_phpcbf_exit_code_fixable_stdin() {
bin/phpcbf --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist < tests/EndToEnd/Fixtures/ClassWithStyleError.inc
assert_exit_code 0
}
function test_phpcs_exit_code_non_fixable_file() {
bin/phpcs --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithUnfixableStyleError.inc
assert_exit_code 2
}
function test_phpcs_exit_code_non_fixable_stdin() {
bin/phpcs --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist < tests/EndToEnd/Fixtures/ClassWithUnfixableStyleError.inc
assert_exit_code 2
}
function test_phpcbf_exit_code_non_fixable_file() {
bin/phpcbf --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithUnfixableStyleError.inc
assert_exit_code 2
}
function test_phpcbf_exit_code_non_fixable_stdin() {
bin/phpcbf --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist < tests/EndToEnd/Fixtures/ClassWithUnfixableStyleError.inc
assert_exit_code 2
}
function test_phpcs_exit_code_fixable_and_non_fixable_file() {
bin/phpcs --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithTwoStyleErrors.inc
assert_exit_code 3
}
function test_phpcs_exit_code_fixable_and_non_fixable_stdin() {
bin/phpcs --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist < tests/EndToEnd/Fixtures/ClassWithTwoStyleErrors.inc
assert_exit_code 3
}
function test_phpcbf_exit_code_fixable_and_non_fixable_file() {
bin/phpcbf --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithTwoStyleErrors.inc
assert_exit_code 2
}
function test_phpcbf_exit_code_fixable_and_non_fixable_stdin() {
bin/phpcbf --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist < tests/EndToEnd/Fixtures/ClassWithTwoStyleErrors.inc
assert_exit_code 2
}