2017 © Pedro Peláez
 

library phpspec-customsuffix

PHPSpec extension to allow custom class file suffixes ie. MyClass.class.php

image

rdm/phpspec-customsuffix

PHPSpec extension to allow custom class file suffixes ie. MyClass.class.php

  • Thursday, October 15, 2015
  • by svetzal
  • Repository
  • 1 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

rdm-phpspec-customsuffix

PHPSpec is a highly opinionated tool, and is hard-coded to deal with class files that use only the .php filename extension. While this may be a good practice, it keeps people from adopting it as a test framework if their existing code-base doesn't exactly follow it's recommended practices, without a tremendous amount of disruptive change., (*1)

And, disruptive change to an untested code-base is bad, yeah?, (*2)

Within the PHP community, different conventions have been used over the years for filenames. Different communities have different opinions on PHP class file naming conventions, for better or worse. Some communities use suffixes like *.class.php, some use *.inc.php, some even use prefixes like class-*.php (although this plugin doesn't support prefixes at this time)., (*3)

In order to add a little flexibility to PHPSpec, this plugin allows you to specify on a suite-by-suite basis different filename suffix/extension conventions., (*4)

Configuring custom suffixes in phpspec.yml:, (*5)

suites:
  really_old_stuff:
    src_path: thing/includes
    spec_path: thing
    src_extension: .inc.php
  old_stuff:
    src_path: newer_thing/classes
    spec_path: newer_thing
    src_extension: .class.php
extensions: [RDM\CustomSuffix\Extension]

The Versions

15/10 2015

dev-master

9999999-dev

PHPSpec extension to allow custom class file suffixes ie. MyClass.class.php

  Sources   Download

MIT

The Requires

 

by Stacey Vetzal