pyrocms / lex

A lightweight template parser used by PyroCMS.
110 stars 31 forks source link

phpunit dependency? #5

Closed jackmcdade closed 12 years ago

jackmcdade commented 12 years ago

Hey guys, I'm trying to get your phpunit tests running locally. I have a few features we've added i'd love to get test coverage on and possibly send a few pull requests your way, but i'm really having some issues here getting the tests to run.

The composer package doesn't have any phpunit requirements, so i've added those:

{
    "name": "fuel/lex",
    "type": "library",
    "description": "A lightweight template parser.",
    "keywords": ["template","parser"],
    "license": "MIT",
    "authors": [
        {
            "name": "Dan Horrigan",
            "email": "dan@dhorrigan.com",
            "role": "Lead Developer"
        }
    ],
    "require": {
        "php": ">=5.3.0"
    },
    "require-dev": {
        "phpunit/phpunit": "3.7.*"
    },
    "autoload": {
        "psr-0": { "Lex": "lib/" }
    }
}

And then run the composer --dev install, after which running phpunit --configuration phpunit.xml results in:

Fatal error: Cannot redeclare class Composer\Autoload\ClassLoader in /Users/jack/Projects/lex/vendor/composer/ClassLoader.php on line 44

I can't say for sure if this is something in my own environment or in the Lex test library, but i'm hoping one of you guys might have some insight here.

dhrrgn commented 12 years ago

I will not be adding this dependency. If I were to do that, and then people installed Lex in their own application, it would force them to install phpunit, even if they never want to use it. Dev's can figure out how to install phpunit system-wide in about 3 minutes.

jackmcdade commented 12 years ago

Fair enough.

On Oct 13, 2012, at 3:19 PM, Dan Horrigan notifications@github.com wrote:

I will not be adding this dependency. If I were to do that, and then people installed Lex in their own application, it would force them to install phpunit, even if they never want to use it. Dev's can figure out how to install phpunit system-wide in about 3 minutes.

— Reply to this email directly or view it on GitHub.

philsturgeon commented 12 years ago

You can list it as a dev requirement not a main requirement (if I remember rightly).

Emailing from my iPhone 4S like a BOSS!

On 13 Oct 2012, at 20:19, Jack McDade notifications@github.com wrote:

Fair enough.

On Oct 13, 2012, at 3:19 PM, Dan Horrigan notifications@github.com wrote:

I will not be adding this dependency. If I were to do that, and then people installed Lex in their own application, it would force them to install phpunit, even if they never want to use it. Dev's can figure out how to install phpunit system-wide in about 3 minutes.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

jackmcdade commented 12 years ago

Yep that's what I did. Fairly new to composer, so you'll have to forgive me :) been in rails with bundle for too long.

On Oct 13, 2012, at 5:23 PM, Phil Sturgeon notifications@github.com wrote:

You can list it as a dev requirement not a main requirement (if I remember rightly).

Emailing from my iPhone 4S like a BOSS!

On 13 Oct 2012, at 20:19, Jack McDade notifications@github.com wrote:

Fair enough.

On Oct 13, 2012, at 3:19 PM, Dan Horrigan notifications@github.com wrote:

I will not be adding this dependency. If I were to do that, and then people installed Lex in their own application, it would force them to install phpunit, even if they never want to use it. Dev's can figure out how to install phpunit system-wide in about 3 minutes.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/fuelphp/lex/issues/5#issuecomment-9410463.