Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Apr 21, 2023
1 parent a0815e4 commit dbf3eca
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/expected_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ PHP CODE SNIFFER REPORT SUMMARY
----------------------------------------------------------------------
FILE ERRORS WARNINGS
----------------------------------------------------------------------
tests/input/annotation-name.php 8 0
tests/input/array_indentation.php 10 0
tests/input/arrow-functions-format.php 10 0
tests/input/assignment-operators.php 4 0
tests/input/attributes.php 15 0
tests/input/binary_operators.php 9 0
tests/input/class-references.php 10 0
tests/input/class-references.php 10 2
tests/input/ClassPropertySpacing.php 2 0
tests/input/concatenation_spacing.php 49 0
tests/input/constants-no-lsb.php 2 0
Expand Down Expand Up @@ -52,9 +53,9 @@ tests/input/use-ordering.php 1 0
tests/input/useless-semicolon.php 2 0
tests/input/UselessConditions.php 21 0
----------------------------------------------------------------------
A TOTAL OF 453 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
A TOTAL OF 461 ERRORS AND 2 WARNINGS WERE FOUND IN 49 FILES
----------------------------------------------------------------------
PHPCBF CAN FIX 375 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


25 changes: 25 additions & 0 deletions tests/fixed/annotation-name.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

interface Foo
{
/**
* This method does something
*/
public function doSomething(): void;

/**
* This method does not perform any action
*/
public function nothing(): void;
}

final class Bar implements Foo
{
/** @inheritDoc */
public function doSomething(): void;

/** {@inheritDoc} */
public function nothing(): void;
}
25 changes: 25 additions & 0 deletions tests/input/annotation-name.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

interface Foo
{
/**
* This method does something
*/
public function doSomething(): void;

/**
* This method does not perform any action
*/
public function nothing(): void;
}

final class Bar implements Foo
{
/** @inheritdoc */
public function doSomething(): void;

/** {@inheritdoc} */
public function nothing(): void;
}

0 comments on commit dbf3eca

Please sign in to comment.