10.04.2018 Views

Doctrine_manual-1-2-en

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 27: Unit Testing 356<br />

Chapter 27<br />

Unit Testing<br />

<strong>Doctrine</strong> is programmatically tested using UnitTests. You can read more about unit testing<br />

here 45 on Wikipedia.<br />

Running tests<br />

In order to run the tests that come with doctrine you need to check out the <strong>en</strong>tire project, not<br />

just the lib folder.<br />

Listing<br />

27-1<br />

$ svn co http://svn.doctrine-project.org/1.0 /path/to/co/doctrine<br />

Now change directory to the checked out copy of doctrine.<br />

Listing<br />

27-2<br />

$ cd /path/to/co/doctrine<br />

You should see the following files and directories listed.<br />

Listing<br />

27-3<br />

CHANGELOG<br />

COPYRIGHT<br />

lib/<br />

LICENSE<br />

package.xml<br />

tests/<br />

tools/<br />

v<strong>en</strong>dor/<br />

It is not uncommon for the test suite to have fails that we are aware of. Oft<strong>en</strong> <strong>Doctrine</strong> will<br />

have test cases for bugs or <strong>en</strong>hancem<strong>en</strong>t requests that cannot be committed until later<br />

versions. Or we simply don't have a fix for the issue yet and the test remains failing. You<br />

can ask on the mailing list or in IRC for how many fails should be expected in each version<br />

of <strong>Doctrine</strong>.<br />

CLI<br />

To run tests on the command line, you must have php-cli installed.<br />

Navigate to the /path/to/co/doctrine/tests folder and execute the run.php script:<br />

Listing<br />

27-4<br />

45. http://<strong>en</strong>.wikipedia.org/wiki/Unit_testing<br />

----------------- Brought to you by

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!