mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
tweaked docs
This commit is contained in:
+15
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user