Skip to content

Commit 2608604

Browse files
author
Vincent Langlet
committed
🚨 Add tests
1 parent 08bbe0a commit 2608604

File tree

5 files changed

+97
-1
lines changed

5 files changed

+97
-1
lines changed

Symfony3Custom/Sniffs/Classes/PropertyDeclarationSniff.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
class Symfony3Custom_Sniffs_Classes_PropertyDeclarationSniff
1919
implements PHP_CodeSniffer_Sniff
2020
{
21-
2221
/**
2322
* A list of tokenizers this sniff supports.
2423
*
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
class Class1
4+
{
5+
}
6+
7+
class Class2
8+
{
9+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/**
4+
* Unit test class for the MultipleClassesOneFile sniff.
5+
*
6+
* A sniff unit test checks a .inc file for expected violations of a single
7+
* coding standard. Expected errors and warnings are stored in this class.
8+
*/
9+
class Symfony3Custom_Tests_Classes_MultipleClassesOneFileUnitTest
10+
extends AbstractSniffUnitTest
11+
{
12+
/**
13+
* Returns the lines where errors should occur.
14+
*
15+
* The key of the array should represent the line number and the value
16+
* should represent the number of errors that should occur on that line.
17+
*
18+
* @return array<int, int>
19+
*/
20+
public function getErrorList()
21+
{
22+
return array(
23+
7 => 1,
24+
);
25+
}
26+
27+
/**
28+
* Returns the lines where warnings should occur.
29+
*
30+
* The key of the array should represent the line number and the value
31+
* should represent the number of errors that should occur on that line.
32+
*
33+
* @return array(int => int)
34+
*/
35+
public function getWarningList()
36+
{
37+
return array();
38+
}
39+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
class ClassTest
4+
{
5+
public function functionTest() {
6+
7+
}
8+
9+
private $property;
10+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/**
4+
* Unit test class for the PropertyDeclaration sniff.
5+
*
6+
* A sniff unit test checks a .inc file for expected violations of a single
7+
* coding standard. Expected errors and warnings are stored in this class.
8+
*/
9+
class Symfony3Custom_Tests_Classes_PropertyDeclarationUnitTest
10+
extends AbstractSniffUnitTest
11+
{
12+
/**
13+
* Returns the lines where errors should occur.
14+
*
15+
* The key of the array should represent the line number and the value
16+
* should represent the number of errors that should occur on that line.
17+
*
18+
* @return array<int, int>
19+
*/
20+
public function getErrorList()
21+
{
22+
return array(
23+
9 => 1,
24+
);
25+
}
26+
27+
/**
28+
* Returns the lines where warnings should occur.
29+
*
30+
* The key of the array should represent the line number and the value
31+
* should represent the number of errors that should occur on that line.
32+
*
33+
* @return array(int => int)
34+
*/
35+
public function getWarningList()
36+
{
37+
return array();
38+
}
39+
}

0 commit comments

Comments
 (0)