Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 14... Línea 14...
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea 16...
16
 
16
 
Línea -... Línea 17...
-
 
17
namespace core_analytics;
-
 
18
 
17
namespace core_analytics;
19
use core_analytics\tests\mlbackend_helper_trait;
Línea 18... Línea 20...
18
 
20
 
19
defined('MOODLE_INTERNAL') || die();
21
defined('MOODLE_INTERNAL') || die();
Línea 27... Línea 29...
27
 * @package     core_analytics
29
 * @package     core_analytics
28
 * @category    test
30
 * @category    test
29
 * @copyright 2019 David Mudrák <david@moodle.com>
31
 * @copyright 2019 David Mudrák <david@moodle.com>
30
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31
 */
33
 */
32
class stats_test extends \advanced_testcase {
34
final class stats_test extends \advanced_testcase {
-
 
35
    use mlbackend_helper_trait;
Línea 33... Línea 36...
33
 
36
 
34
    /**
37
    /**
35
     * Set up the test environment.
38
     * Set up the test environment.
36
     */
39
     */
-
 
40
    public function setUp(): void {
Línea 37... Línea 41...
37
    public function setUp(): void {
41
        parent::setUp();
38
 
42
 
Línea 39... Línea 43...
39
        $this->setAdminUser();
43
        $this->setAdminUser();
Línea 67... Línea 71...
67
 
71
 
68
    /**
72
    /**
69
     * Test the {@link \core_analytics\stats::predictions()} implementation.
73
     * Test the {@link \core_analytics\stats::predictions()} implementation.
70
     */
74
     */
-
 
75
    public function test_predictions(): void {
-
 
76
        if (!self::is_mlbackend_python_configured()) {
-
 
77
            $this->markTestSkipped('mlbackend_python is not configured.');
Línea 71... Línea 78...
71
    public function test_predictions(): void {
78
        }
Línea 72... Línea 79...
72
 
79
 
73
        $this->resetAfterTest(true);
80
        $this->resetAfterTest(true);
Línea 113... Línea 120...
113
    /**
120
    /**
114
     * Test the {@link \core_analytics\stats::actions()} and {@link \core_analytics\stats::actions_not_useful()} implementation.
121
     * Test the {@link \core_analytics\stats::actions()} and {@link \core_analytics\stats::actions_not_useful()} implementation.
115
     */
122
     */
116
    public function test_actions(): void {
123
    public function test_actions(): void {
117
        global $DB;
124
        global $DB;
-
 
125
 
-
 
126
        if (!self::is_mlbackend_python_configured()) {
-
 
127
            $this->markTestSkipped('mlbackend_python is not configured.');
-
 
128
        }
-
 
129
 
118
        $this->resetAfterTest(true);
130
        $this->resetAfterTest(true);
Línea 119... Línea 131...
119
 
131
 
120
        $model = \core_analytics\model::create(
132
        $model = \core_analytics\model::create(
121
            \core_analytics\manager::get_target('test_target_shortname'),
133
            \core_analytics\manager::get_target('test_target_shortname'),