Answers.Body: <p>Yes it is possible, see this example plugin by Selvin Ortiz: <a href="https://github.com/selvinortiz/craft.loath" rel="nofollow noreferrer">https://github.com/selvinortiz/craft.loath</a>.</p>
  
  <p>You can also check out <a href="https://github.com/boboldehampsink/import" rel="nofollow noreferrer">https://github.com/boboldehampsink/import</a> for some detailed unit tests.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-04T20:33:32.357Z
Answers.Text: Excellent, thanks Bob, this is exactly what I was looking for!
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-29T11:57:00.530Z
Answers.Text: That plugin uses: `/craft/app/vendor/phpunit/phpunit/phpunit.php`, 
  `/craft/app/tests/bootstrap.php`, 
  and `/craft/app/tests/phpunit.xml` which doesn't ship in the latest version of Craft 2 anyone.
Answers.UserDisplayName: Maarten de Graaf
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-03T10:59:40.333Z
Answers.Text: True. I still provide these files myself for now and I'm not sure what Craft's future philosophy on testing will be.
Answers.UserDisplayName: Bob Olde Hampsink
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-03T12:46:28.600Z
Answers.LastActivityDate: 2017-09-29T11:25:45.260Z
Answers.LastEditDate: 2017-09-29T11:25:45.260Z
Answers.UserDisplayName: Bob Olde Hampsink
Body: <p>Since Craft ships with a copy of PHPUnit, is it possible to use that to run tests on a plugin? Or do we need to have a separate copy installed?</p>
  
Tags: <plugin-development>
Title: Craft ships with PHPUnit... How can we use it to test our plugins?
ThreadText: # Craft ships with PHPUnit... How can we use it to test our plugins?
  
  (Asked by: username_0 on 2014-09-03)
  
  Since Craft ships with a copy of PHPUnit, is it possible to use that to run tests on a plugin? Or do we need to have a separate copy installed?
  
  **Tags:** plugin-development
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-09-03. Score: 6 | Accepted answer
  
  Yes it is possible, see this example plugin by Selvin Ortiz: <https://github.com/selvinortiz/craft.loath>.
  
  You can also check out <https://github.com/username_1/import> for some detailed unit tests.
  
  > **Comments:**
  > **username_0**: Excellent, thanks Bob, this is exactly what I was looking for!  
  > **username_2**: That plugin uses: `/craft/app/vendor/phpunit/phpunit/phpunit.php`,  `/craft/app/tests/bootstrap.php`,  and `/craft/app/tests/phpunit.xml` which doesn't ship in the latest version of Craft 2 anyone.  
  > **username_1**: True. I still provide these files myself for now and I'm not sure what Craft's future philosophy on testing will be.  
  
  ---
  
  