Testing and QA

 
 
Tim at Lone Pine Koala Sanctuary
Re: phpunit --group annotation
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

No, you have not done that. You have put a PHPdoc comment at the start of the .php file. You have not put a PHPdoc comment immediately before the class statement.

 
Average of ratings: -
Picture of Rian Stockbower
Re: phpunit --group annotation
 

OK, I've done that:

<?php

defined('MOODLE_INTERNAL') || die();

global $CFG;
require_once($CFG->dirroot . '/filter/Link2Wiki/filter.php');

/**
 * Unit tests for Link2Wiki filter
 * @group CompanyExtensions
 * @group Link2Wiki
 */
class filter_Link2Wiki_test extends basic_testcase {

    /**
     * @dataProvider buildWikiUrlDataProvider
     */
    public function test_buildWikiUrl($articleName, $linkText, $expected) {
        //...
    } //...

Then I ran init.php again. This is the output of --list-groups:

Available test group(s):
 - Andrew Nicols
 - Charles Severance csev@unmich.edu
 - Chris Scribner
 - David Jimenez
 - Jordi Piguillem
 - Josep Arus
 - Kenneth Riba
 - Marc Alier
 - Marc Alier (marc.alier@upc.edu)
 - Mark Nielsen
 - Nikolas Galanis
 - Petr Skoda {@link http://skodak.org}
 - Sam Marshall
 - T.J.Hunt@open.ac.uk
 - Yuliya Bozhko <yuliya.bozhko@totaralms.com>
 - __nogroup__
 - core_plugin
 - nicolas@moodle.com

We are running 2.5 right now, if that matters.

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: phpunit --group annotation
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Yes, but what happens when you run

phpunit --group Link2Wiki

or

phpunit --group CompanyExtensions

 
Average of ratings: -
Picture of Rian Stockbower
Re: phpunit --group annotation
 

Nothing.

 

$ phpu --group Link2Wiki
Moodle 2.5 (Build: 20130514), mysqli
PHPUnit 3.7.24 by Sebastian Bergmann.

Configuration read from /var/www/html/moodle/phpunit.xml



Time: 0 ms, Memory: 197.50Mb

No tests executed!
vadev@rianjsmoodle: /var/www/html/moodle
$ phpu --group CompanyExtensions
Moodle 2.5 (Build: 20130514), mysqli
PHPUnit 3.7.24 by Sebastian Bergmann.

Configuration read from /var/www/html/moodle/phpunit.xml



Time: 0 ms, Memory: 198.00Mb

By contrast:

$ phpu filter_Link2Vistawiki_test ./filter/Link2Wiki/tests/filter_test.php
Moodle 2.5 (Build: 20130514), mysqli
PHPUnit 3.7.24 by Sebastian Bergmann.

Configuration read from /var/www/html/moodle/phpunit.xml

.........

Time: 1.81 seconds, Memory: 56.50Mb

OK (9 tests, 9 assertions)
 
Average of ratings: -