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

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

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.


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

[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
postedJul 12, '13 at 3:16p
activeJul 12, '13 at 3:16p
posts1
users1
websitepear.php.net

1 user in discussion

Cweiske: 1 post

People

Translate

site design / logo © 2022 Grokbase