Laravel - CircleCI - Fails on phpunit

僤鯓⒐⒋嵵緔 提交于 2020-01-24 09:13:08

问题


I have started the process of making use on Continuous Integration and I have decided on circleci.

Please let me know if I can supply any other information as I am lost at this point.

When circleci tries to run the phpunit command it returns the following error:

I have failed miserably at solving this issue.

vendor/bin/phpunit
 PHPUnit 3.7.37 by Sebastian Bergmann.

Configuration read from /home/ubuntu/simple/phpunit.xml

PHP Fatal error:  Class 'Illuminate\View\Environment' not found in /home/ubuntu/simple/vendor/laravel/framework/src/Illuminate/View/ViewServiceProvider.php on line 124

 Fatal error: Class 'Illuminate\View\Environment' not found in /home/ubuntu/simple/vendor/laravel/framework/src/Illuminate/View/ViewServiceProvider.php on line 124
vendor/bin/phpunit returned exit code 255

The composer.json file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.1.29",
        "cartalyst/sentry": "2.1.*",
        "vespakoen/menu": "dev-master",
        "venturecraft/revisionable": "1.8.*",
        "dompdf/dompdf" : "0.6.*",
        "baum/baum": "~1.0",
        "thujohn/pdf": "dev-master",
        "yohang/finite": "1.1.x-dev",
        "pimple/pimple": "2.1.*@dev",
        "symfony/security": "2.4.x-dev",
        "maatwebsite/excel": "1.*",
        "codesleeve/asset-pipeline": "dev-master"
    },
    "repositories": [
    {
        "type": "composer",
        "url": "http://packages.cartalyst.com"
    }
    ],
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php",
            "app/lib"
        ],
        "psr-0": {
            "Authority": "app/",
            "Acme": "app/"
        }
    },
    "config": {
        "preferred-install": "dist",
        "frozennode/administrator": "dev-master"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "1.*",
        "way/generators": "2.*",
        "codeception/codeception":"@stable",
        "zizaco/factory-muff": "dev-master",
        "zizaco/testcases-laravel": "dev-master",
        "mockery/mockery": "dev-master",
        "phpspec/phpspec": "~2.0",
        "behat/behat": "~2.5.1",
        "behat/mink": "~1.5.0",
        "behat/mink-extension": "~1.2.0",
        "behat/mink-goutte-driver": "~1.0.9",
        "behat/mink-selenium2-driver": "~1.1.1",
        "phpunit/phpunit": "3.7.37",
        "onigoetz/profiler":"dev-master",
        "benconstable/phpspec-laravel": "~1.0"
    },
    "minimum-stability": "beta"
}

The circle.yml file

machine:
  timezone:
    Africa/Johannesburg
  php:
    version: 5.4.21
  hosts:
    app.test: 127.0.0.1

test:
  override:
    - vendor/bin/phpunit

回答1:


Did you try to run composer before? Try to put this in your circleci.yml:

dependencies:
  override:
    - composer install --prefer-source --no-interaction --no-dev


来源:https://stackoverflow.com/questions/24624538/laravel-circleci-fails-on-phpunit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!