Unverified Commit 46a74880 authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

fix(DrupalPractice): Add autoloader to fix fatal errors when invoking DrupalPractice (#29)

parent cf5db6e3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -30,5 +30,11 @@ before_script:

script:
  - ./vendor/bin/phpunit
  # Check that the sniffs themselves follow the PHPCS coding standard.
  - ./vendor/bin/phpcs -p
  # Ensure that a custom standard can be invoked and the auto-loading of
  # abstract classes works.
  - ./vendor/bin/phpcs -p --standard=coder_sniffer/Drupal/Test/phpcs-ruleset.xml coder_sniffer/Drupal/Test/good/ --ignore=coder_sniffer/Drupal/Test/good/GoodUnitTest.php
  # Ensure that the DrupalPractice standard can be invoked standalone and the
  # auto-loading of abstract classes works.
  - ./vendor/bin/phpcs -p --standard=coder_sniffer/DrupalPractice coder_sniffer/DrupalPractice/Test/good/ --ignore=coder_sniffer/DrupalPractice/Test/good/GoodUnitTest.php
+5 −0
Original line number Diff line number Diff line
@@ -7,6 +7,11 @@

 <arg name="extensions" value="php,module,inc,install,test,profile,theme,yml"/>

 <autoload>../Drupal/autoload.php</autoload>
 <!-- We use a static method from a sniff from the other standard, so we need
 this autoload hack here. -->
 <autoload>../Drupal/Sniffs/InfoFiles/ClassFilesSniff.php</autoload>

 <rule ref="Internal.NoCodeFound">
  <!-- Empty files are fine, might be used for testing. -->
  <exclude-pattern>*</exclude-pattern>