Answers.Body: <p>I recommend you install and use buildkit:
  <a href="https://github.com/civicrm/civicrm-buildkit" rel="nofollow">https://github.com/civicrm/civicrm-buildkit</a></p>
  
  <p>It comes with lots of tools - including those you need to run tests.</p>
  
  <p>I use it on MAMP but from what I understand this will work on Windows as well. </p>
  
  <p>Alternatively - if you like you can also:
  <a href="https://github.com/civicrm/civicrm-buildkit-vagrant" rel="nofollow">https://github.com/civicrm/civicrm-buildkit-vagrant</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-27T13:35:59.310Z
Answers.Text: Yup, it works OK on vagrant. Buildkit is good but I've had some trouble getting it up and running on Windows. I'm also not sure if the cv package runs well on Windows.
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-25T17:38:29.330Z
Answers.LastActivityDate: 2016-04-25T17:38:29.330Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>Just adding some steps to check if basic things are met correctly.</p>
  
  <ol>
  <li><p>Make sure you are in civicrm folder when you run the test.</p>
  
  <pre><code>$ cd &lt;site_name&gt;/sites/all/modules/civicrm
  $ export CIVICRM_UF=UnitTests
  $ phpunit4 tests/phpunit/api/v3/ContactTest.php 
  </code></pre></li>
  <li><p>Is your <strong>civicrm.settings.php</strong> file searchable? Add the below line to your <code>~/.bash_profile</code> file.</p>
  
  <pre><code>export CIVICRM_SETTINGS=/Users/jitendra/www/civicrm-master/sites/default/civicrm.settings.php
  </code></pre></li>
  <li><p>If you have cv installed and <code>cv vars:fill</code> runs fine, check if <code>civicrm.settings.php</code> values are correct($civicrm_root, CMS_DSN etc).</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-02T14:02:10.717Z
Answers.LastActivityDate: 2017-04-02T14:02:10.717Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>cv is a command line tool that's not included with CiviCRM. The repo can be found here: <a href="https://github.com/civicrm/cv" rel="nofollow">https://github.com/civicrm/cv</a></p>
  
  <p>This command line utility seems to be required to run phpunit tests in Civi. (Though I'm not sure yet whether it runs on Windows systems).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-25T13:22:10.883Z
Answers.LastActivityDate: 2016-04-25T13:22:10.883Z
Answers.UserDisplayName: John
Body: <p>I'm trying to run CiviCRM's unit tests, but I hit on this error when running scripts/phpunit AllTests:</p>
  
  <pre><code>RuntimeException: Command failed (cv php:boot --level=settings) in ...tests\phpunit\CiviTest\bootstrap.php
  </code></pre>
  
  <p>This is on the master branch of CiviCRM on a local development machine.</p>
  
  <ul>
  <li>Using Windows 7 with a XAMPP stack</li>
  <li>PHP Version 5.6.15</li>
  <li>The civicrm-core directory is up to date with the master branch</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-20T23:00:00.780Z
Comments.Text: Hi John - can you please add some details on you dev environment;
Comments.UserDisplayName: KarinG - Semper IT
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-21T10:27:46.620Z
Comments.Text: Sorry, I should know better, I've done that now.
Comments.UserDisplayName: John
Tags: <developer><testing>
Title: Command failed (cv php:boot --level=settings) when trying to run tests
ThreadText: # Command failed (cv php:boot --level=settings) when trying to run tests
  
  (Asked by: username_0 on 2016-03-30)
  
  I'm trying to run CiviCRM's unit tests, but I hit on this error when running scripts/phpunit AllTests:
  RuntimeException: Command failed (cv php:boot --level=settings) in ...tests\phpunit\CiviTest\bootstrap.php
  
  This is on the master branch of CiviCRM on a local development machine.
  
  Using Windows 7 with a XAMPP stack
  PHP Version 5.6.15
  The civicrm-core directory is up to date with the master branch
  
  **Tags:** developer, testing
  
  > **Comments:**
  > **username_1**: Hi username_0 - can you please add some details on you dev environment;  
  > **username_0**: Sorry, I should know better, I've done that now.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-04-25. Score: 2 | Accepted answer
  
  I recommend you install and use buildkit:
  <https://github.com/civicrm/civicrm-buildkit>
  
  It comes with lots of tools - including those you need to run tests.
  
  I use it on MAMP but from what I understand this will work on Windows as well.
  
  Alternatively - if you like you can also:
  <https://github.com/civicrm/civicrm-buildkit-vagrant>
  
  > **Comments:**
  > **username_0**: Yup, it works OK on vagrant. Buildkit is good but I've had some trouble getting it up and running on Windows. I'm also not sure if the cv package runs well on Windows.  
  
  ---
  
  ### Answer by username_2 on 2017-04-02. Score: 1
  
  Just adding some steps to check if basic things are met correctly.
  
  Make sure you are in civicrm folder when you run the test.
  $ cd /sites/all/modules/civicrm
  $ export CIVICRM_UF=UnitTests
  $ phpunit4 tests/phpunit/api/v3/ContactTest.php 
  
  Is your civicrm.settings.php file searchable? Add the below line to your ~/.bash_profile file.
  export CIVICRM_SETTINGS=/Users/jitendra/www/civicrm-master/sites/default/civicrm.settings.php
  
  If you have cv installed and cv vars:fill runs fine, check if civicrm.settings.php values are correct($civicrm_root, CMS_DSN etc).
  
  
  ---
  
  ### Answer by username_0 on 2016-04-25. Score: 0
  
  cv is a command line tool that's not included with CiviCRM. The repo can be found here: <https://github.com/civicrm/cv>
  
  This command line utility seems to be required to run phpunit tests in Civi. (Though I'm not sure yet whether it runs on Windows systems).
  
  
  ---
  
  