Skip to content

Commit f1fb373

Browse files
committed
add test cases for sniffs
1 parent e2a7682 commit f1fb373

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Disallow usage of multiline slash comments.
4+
*
5+
* @expectedError Pantheon_WP_Minimum.Commenting.DisallowMultilineSlashComment.Found
6+
* @expectedWarning Pantheon_WP_Minimum.Commenting.DisallowMultilineSlashComment.LongLine
7+
*
8+
* @package Pantheon-WP-Coding-Standards
9+
*/
10+
11+
// This comment should fail with a warning.
12+
// Multiline comments should use /* ... */ syntax, not multiple // comments.
13+
// What's with the life preserver? Doc, she's beautiful. She's crazy about me. Look at this,
14+
// look what she wrote me, Doc. That says it all. Doc, you're my only hope. Oh, uh, hey you,
15+
// get your damn hands off her. Do you really think I oughta swear? Well, now we gotta sneak
16+
// this back into my laboratory, we've gotta get you home. Jennifer.
17+
18+
/*
19+
* This comment should not fail but should trigger an info to break the comment up. What's with the life preserver? Doc, she's beautiful. She's crazy about me. Look at this, look what she wrote me, Doc. That says it all. Doc, you're my only hope. Oh, uh, hey you, get your damn hands off her. Do you really think I oughta swear? Well, now we gotta sneak this back into my laboratory, we've gotta get you home. Jennifer.
20+
*/
21+
22+
/*
23+
* This comment is ideal. It uses the correct syntax and is not too long.
24+
* What's with the life preserver? Doc, she's beautiful. She's crazy about me.
25+
* Look at this, look what she wrote me, Doc. That says it all. Doc, you're my
26+
* only hope. Oh, uh, hey you, get your damn hands off her. Do you really think
27+
* I oughta swear? Well, now we gotta sneak this back into my laboratory, we've
28+
* gotta get you home. Jennifer.
29+
*/

0 commit comments

Comments
 (0)