MediaWiki REL1_33
checkLess.php
Go to the documentation of this file.
1<?php
24require_once __DIR__ . '/Maintenance.php';
25
29class CheckLess extends Maintenance {
30
31 public function __construct() {
32 parent::__construct();
33 $this->addDescription(
34 'Checks LESS files for errors by running the LessTestSuite PHPUnit test suite' );
35 }
36
37 public function execute() {
38 global $IP;
39
40 // NOTE (phuedx, 2014-03-26) wgAutoloadClasses isn't set up
41 // by either of the dependencies at the top of the file, so
42 // require it here.
44
45 // If phpunit isn't available by autoloader try pulling it in
46 if ( !class_exists( 'PHPUnit\\Framework\\TestCase' ) ) {
47 require_once 'PHPUnit/Autoload.php';
48 }
49
50 // RequestContext::resetMain() will print warnings unless this
51 // is defined.
52 if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
53 define( 'MW_PHPUNIT_TEST', true );
54 }
55
56 $textUICommand = new PHPUnit_TextUI_Command();
57 $argv = [
58 "$IP/tests/phpunit/phpunit.php",
59 "$IP/tests/phpunit/suites/LessTestSuite.php"
60 ];
61 $textUICommand->run( $argv );
62 }
63}
64
65$maintClass = CheckLess::class;
66require_once RUN_MAINTENANCE_IF_MAIN;
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$maintClass
Definition checkLess.php:65
__construct()
Default constructor.
Definition checkLess.php:31
execute()
Do the actual work.
Definition checkLess.php:37
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
static requireTestsAutoloader()
Call this to set up the autoloader to allow classes to be used from the tests directory.
addDescription( $text)
Set the description text.
$IP
Definition update.php:3
require_once RUN_MAINTENANCE_IF_MAIN