tweaked docs

This commit is contained in:
Fabien Potencier
2012-09-18 11:37:33 +02:00
parent bd7f04e38e
commit 66a8c0b89e
+15 -7
View File
@@ -832,11 +832,17 @@ The ``getTests()`` methods allows to add new test functions::
// ...
}
Testing an Extension
--------------------
.. versionadded:: 1.10
Support for functional tests was added in Twig 1.10.
Functional Tests
~~~~~~~~~~~~~~~~
You can create functional tests for extensions simply by creating the following file structure
in your test directory::
You can create functional tests for extensions simply by creating the
following file structure in your test directory::
Fixtures/
filters/
@@ -868,15 +874,17 @@ The ``IntegrationTest.php`` file should look like this::
}
}
Fixtures examples can be found within the Twig repository ``tests/Twig/Fixtures`` directory.
Fixtures examples can be found within the Twig repository
`tests/Twig/Fixtures`_ directory.
Node Tests
~~~~~~~~~~
Testing the node visitors can be complex, so extend your test cases from
``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository ``tests/Twig/Node`` directory.
``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
`tests/Twig/Node`_ directory.
.. _`spl_autoload_register()`: http://www.php.net/spl_autoload_register
.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
.. _`tests/Twig/Fixtures`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Fixtures
.. _`tests/Twig/Node`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Node
.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
.. _`tests/Twig/Fixtures`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Fixtures
.. _`tests/Twig/Node`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Node