FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19976&edit=1

  ID: 19976
  Updated by: gsherwood@squiz.net
  Reported By: cweiske@php.net
  Summary: Run own CS tests without being installed
-Status: Feedback
+Status: Open
  Type: Feature/Change Request
  Package: PHP_CodeSniffer
  Package Version: 1.5.0RC2
  PHP Version: Irrelevant
  Assigned To: squiz
  Roadmap Versions:
  New Comment:

-Status: Feedback
+Status: Open



Previous Comments:
------------------------------------------------------------------------

[2013-07-12 17:20:35] cweiske

Source tree:
.
??? PHP
?   ??? CodeSniffer
?   ??? Standards
?   ??? Netresearch
?   ?   ??? ruleset.xml
?   ?   ??? Sniffs
?   ?   ??? Files
?   ?   ?   ??? DeclareEncodingSniff.php
?? tests
     ??? bootstrap.php
     ??? NRT3AbstractSniffUnitTest.php
     ??? PHP
     ?   ??? CodeSniffer
     ?   ??? Standards
     ?   ??? NRT3
     ?   ??? Sniffs
     ?   ??? Files
     ?   ?   ??? OneClassPerFileSniffUnitTest.inc
     ??? phpunit.xml

Now the question is how to run the tests for the sniffs when the coding
standard is not installed, but PHP_CodeSniffer is installed via PEAR.

I wanted to use AbstractSniffUnitTest.php as base class for my phpunit
test classes, but that class expects the sniff class files in
/usr/share/pear/... because PHP_CodeSniffer is installed there.

------------------------------------------------------------------------

[2013-06-18 06:11:40] squiz

-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
Hi Christian, can you give me a bit more info about how you are trying
to run the
tests and what the structure of your code is?

Do you just have your own directory structure, like:
MyStandard/
     Sniffs/
         ...
     Tests/
         ...
     ruleset.xml

And how are you trying to run the tests? Do you have your own test
suite, or are
you more referring to the fact that there isn't a command you can really
use to run
them?

------------------------------------------------------------------------

[2013-06-12 10:50:00] cweiske

Description:
------------
It is currently not possible to run unit tests for an own ruleset that
has not been installed via PEAR.

This is because AbstractSniffUnitTest.php detects if PHP_CodeSniffer is
installed, and then assumes that the tests to execute are also in the
same path as PHP_CodeSniffer itself.

Now I'd like to run the tests of my not installed ruleset with an
installed version of php_codesniffer :)

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 1, '13 at 5:37a
activeAug 1, '13 at 5:37a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase