forked from vim-test/vim-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpunit_spec.vim
More file actions
111 lines (77 loc) · 3 KB
/
phpunit_spec.vim
File metadata and controls
111 lines (77 loc) · 3 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
source spec/support/helpers.vim
describe "PHPUnit"
before
cd spec/fixtures/phpunit
end
after
call Teardown()
cd -
end
it "runs file tests"
view NormalTest.php
TestFile
Expect g:test#last_command == 'phpunit --colors NormalTest.php'
end
it "runs nearest tests"
view +1 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors NormalTest.php"
view +9 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::testShouldAddTwoNumbers' NormalTest.php"
view +14 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::testShouldSubtractTwoNumbers' NormalTest.php"
view +30 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::testShouldAddToExpectedValue' NormalTest.php"
end
it "runs nearest test marked with @test annotation"
view +40 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::aTestMarkedWithTestAnnotation' NormalTest.php"
view +50 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::aTestMarkedWithTestAnnotationAndCrazyDocblock' NormalTest.php"
end
it "runs nearest test containing an anonymous class"
view +61 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::testWithAnAnonymousClass' NormalTest.php"
view +76 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::aTestMakedWithTestAnnotationAndWithAnAnonymousClass' NormalTest.php"
end
" Fix for: https://github.com/janko/vim-test/issues/361
it "runs nearest test with a one line @test annotation"
view +83 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::aTestMarkedWithTestAnnotationOnOneLine' NormalTest.php"
end
it "runs nearest test with a one line #[Test] attribute"
view +87 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::aTestMarkedWithTestAttributeOnOneLine' NormalTest.php"
end
it "runs nearest test with a one line #[Test] attribute in a group"
view +93 NormalTest.php
TestNearest
Expect g:test#last_command == "phpunit --colors --filter '::aTestMarkedWithTestAttributeInGroupOnOneLine' NormalTest.php"
end
" Skipped because I didn't managed to find a way to make it work without allowing false positive
" it "runs nearest test with a multi lines #[Test] attribute in a group"
" view +102 NormalTest.php
" TestNearest
" Expect g:test#last_command == "phpunit --colors --filter '::aTestMarkedWithTestAttributeInGroupOnMultipleLines' NormalTest.php"
" end
it "runs test suites"
view NormalTest.php
TestSuite
Expect g:test#last_command == 'phpunit --colors'
end
it "doesn't recognize files that don't end with 'Test'"
view normal.php
TestFile
Expect exists('g:test#last_command') == 0
end
end