[HD][Eng-Audio] CakePHP 3 - Run tests automatically with Gulp

Поделиться
HTML-код
  • Опубликовано: 14 май 2014
  • With Gulp we can launch phpuni after save a file(Test/Class) and show a notification with the result.
    dev.raulete.com/2014/05/gulpjs...
    Gist: gist.github.com/raultm/f6db3a...
    Using this workflow @kinetica_mobile (www.kinetica.mobi/)
    Requirements
    -Composer
    -Nodejs
    -PHPUnit
  • НаукаНаука

Комментарии • 8

  • @spartacus4
    @spartacus4 9 лет назад

    This video assumes the person has phpunit executable installed globally. I am running a linux server and phpunit is not installed, so I cannot simply call "phpunit" I would have to specify the bin. How would I go about doing this?

  • @spartacus4
    @spartacus4 9 лет назад

    How to do this for CakePHP 2?

    • @RaulTierno
      @RaulTierno  9 лет назад

      I think there mustn't be any problem.
      In the gulpfile you only need to replace the call to 'phpunit' to './Console/cake test app [whatever you want]'
      And the structure in cake 2 is a little different so you must rewrite the folders to watch in the gulpfile too.

    • @spartacus4
      @spartacus4 9 лет назад

      Raul Tierno This is very helpful, thanks. In your example you run just "phpunit" which I'm guessing runs all tests within cakephp. How do I do the same using the /Console/cake test command - so that is runs all cakephp tests - not just for specified app?

    • @RaulTierno
      @RaulTierno  9 лет назад

      Matt Myers For run ALL THE TESTS of specific project you must run 'Console/cake test app' from folder of the project. Have you got more projects and want to run all the tests together?
      If you're using cake2 and you are not using compose I think you might use phpunit globally.
      In Cake3 you can mark phpunit as a dependency, the runnable will be in APPFOLDER/vendor/bin/phpunit. The testsuites are marked in an xml root file
      github.com/cakephp/cakephp/blob/3.1/phpunit.xml.dist

    • @spartacus4
      @spartacus4 9 лет назад

      Raul Tierno When I run "Console/cake test app" it then prompts with "What test case would you like to run? [q] >". Still don't know how to run all tests with single command.

    • @spartacus4
      @spartacus4 9 лет назад +1

      Matt Myers I think I got it. I was able to add a AllTests class that I can run which will do addTestDirectoryRecursive for all my cases. Thanks for you help with this, I could not have done it without you.