jadjoubran / laravel5-angular-material-starter

Get started with Laravel 5.3 and AngularJS (material)
https://laravel-angular.readme.io/
MIT License
1.67k stars 401 forks source link

run gulp and php unit test failed #74

Closed masterpowers closed 8 years ago

masterpowers commented 8 years ago

Hi i got a fresh new install of your repo why is your test failing? Sorry but i need to know why

[17:58:39] Starting 'phpUnit'...

Fetching PhpUnit Source Files...
   - tests/**/*Test.php

[17:58:39]

       *** Debug Cmd: .\vendor\bin\phpunit --colors --debug -c phpunit.xml ***

210
[17:58:39] '.\vendor\bin\phpunit' is not recognized as an internal or external command,
operable program or batch file.

[17:58:39] { [Error: Command failed: C:\Windows\system32\cmd.exe /s /c ".\vendor\bin\phpunit --colors --debug -c phpunit.xml"
'.\vendor\bin\phpunit' is not recognized as an internal or external command,
operable program or batch file.
]
  killed: false,
  code: 1,
  signal: null,
  cmd: 'C:\\Windows\\system32\\cmd.exe /s /c ".\\vendor\\bin\\phpunit --colors --debug -c phpunit.xml"' }
[17:58:39] gulp-notify: [Red!] Your phpUnit tests failed!
[17:58:39] Finished 'phpUnit' after 57 ms
jadjoubran commented 8 years ago

Hi @masterpowers

Sure thing.

From this error log fragment: '.\vendor\bin\phpunit' is not recognized as an internal or external command, operable program or batch file. it seems that you don't have local phpunit installed..

Are you running composer install --no-dev? Also please paste in your composer.json

masterpowers commented 8 years ago

this is my composer.json file

{
    "name": "jadjoubran/laravel5-angular-material-starter",
    "description": "Laravel 5 angular material starter project with elixir setup",
    "keywords": ["laravel", "angular", "material", "starter", "ui-router", "api"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "barryvdh/laravel-debugbar": "~2.0",
        "tymon/jwt-auth": "0.5.*",
        "dingo/api": "1.0.x@dev"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php -r \"copy('.env.example', '.env');\"",
            "php -r \"unlink('code_of_conduct.md');\"",
            "php -r \"unlink('CHANGELOG.md');\"",
            "php -r \"unlink('.codeclimate.yml');\"",
            "php -r \"unlink('.travis.yml');\"",
            "php artisan key:generate",
            "php artisan jwt:generate"
        ]
    }
}
masterpowers commented 8 years ago

im not running composer install --no dev im just using the normal composer install

masterpowers commented 8 years ago

i try to run php unit and got this Ok , but for Gulp still failing

C:\Users\Andrew Galang\Code\rfnbeta>phpunit
PHPUnit 4.8.10 by Sebastian Bergmann and contributors.

......

Time: 5.63 seconds, Memory: 15.75Mb

OK (6 tests, 17 assertions)
jadjoubran commented 8 years ago

Maybe you can the fix described here

If it doesn't work, try installing php unit globally: composer global require "phpunit/phpunit=4.0.*"

jadjoubran commented 8 years ago

I just saw your comment. So it means the first suggestion should fix it - npm cache clear and then npm install

masterpowers commented 8 years ago

still got the same results it failed

masterpowers commented 8 years ago

this is what is inside gulpfile.js

elixir(function(mix){
    mix
        .bower()
        .angular('./angular/')
        .less('./angular/**/*.less', 'public/css')
        .copy('./angular/app/**/*.html', 'public/views/app/')
        .copy('./angular/directives/**/*.html', 'public/views/directives/')
        .copy('./angular/dialogs/**/*.html', 'public/views/dialogs/')
        .livereload([
            'public/js/vendor.js',
            'public/js/app.js',
            'public/css/vendor.css',
            'public/css/app.css',
            'public/views/**/*.html'
        ], {liveCSS: true})
        .phpUnit();
});

if i remove phpUnit(); is doesnt throw error, but with it when u test it failed dont know why

jadjoubran commented 8 years ago

Please check if this stackoverflow fixes it.

This is not a problem with this package. If you run a few installation for Laravel and add .phpUnit() to your gulpfile you're going to see the same error.

Please update this thread if you were able to solve it Thanks!

mzvast commented 8 years ago

what's the solution?I same issue.

jadjoubran commented 8 years ago

@mzvast make sure you did the following:

then if you run the tests it should work