Merge branch 'MDL-60611' of git://github.com/stronk7/moodle
This commit is contained in:
+4
-4
@@ -13,7 +13,7 @@ language: php
|
||||
|
||||
php:
|
||||
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.0
|
||||
|
||||
addons:
|
||||
@@ -30,7 +30,7 @@ env:
|
||||
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
|
||||
# start first so that the total run time is not too high.
|
||||
#
|
||||
# We only run MySQL on PHP 7.1, so run that first.
|
||||
# We only run MySQL on PHP 7.2, so run that first.
|
||||
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
|
||||
# Postgres is significantly is pretty reasonable in its run-time.
|
||||
|
||||
@@ -54,12 +54,12 @@ matrix:
|
||||
|
||||
include:
|
||||
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
|
||||
- php: 7.1
|
||||
- php: 7.2
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='8.9'
|
||||
|
||||
exclude:
|
||||
# MySQL - it's just too slow.
|
||||
# Exclude it on all versions except for 7.1
|
||||
# Exclude it on all versions except for 7.2
|
||||
|
||||
- env: DB=mysqli TASK=PHPUNIT
|
||||
php: 7.0
|
||||
|
||||
@@ -74,7 +74,7 @@ if ($options['run']) {
|
||||
}
|
||||
}
|
||||
$_SERVER['argv'] = array_values($_SERVER['argv']);
|
||||
PHPUnit_TextUI_Command::main();
|
||||
PHPUnit\TextUI\Command::main();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@
|
||||
"type": "project",
|
||||
"homepage": "https://moodle.org",
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "5.5.*",
|
||||
"phpunit/dbUnit": "1.4.*",
|
||||
"phpunit/phpunit": "6.4.*",
|
||||
"phpunit/dbUnit": "3.0.*",
|
||||
"moodlehq/behat-extension": "3.34.1",
|
||||
"mikey179/vfsStream": "^1.6"
|
||||
}
|
||||
|
||||
Generated
+403
-217
File diff suppressed because it is too large
Load Diff
@@ -149,7 +149,8 @@ class core_files_file_system_filedir_testcase extends advanced_testcase {
|
||||
->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2);
|
||||
|
||||
// This should generate an exception.
|
||||
$this->setExpectedExceptionRegexp('file_exception',
|
||||
$this->expectException('file_exception');
|
||||
$this->expectExceptionMessageRegExp(
|
||||
'/Can not create local file pool directories, please verify permissions in dataroot./');
|
||||
|
||||
new file_system_filedir();
|
||||
@@ -170,7 +171,8 @@ class core_files_file_system_filedir_testcase extends advanced_testcase {
|
||||
->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2);
|
||||
|
||||
// This should generate an exception.
|
||||
$this->setExpectedExceptionRegexp('file_exception',
|
||||
$this->expectException('file_exception');
|
||||
$this->expectExceptionMessageRegExp(
|
||||
'/Can not create local file pool directories, please verify permissions in dataroot./');
|
||||
|
||||
new file_system_filedir();
|
||||
@@ -693,7 +695,8 @@ class core_files_file_system_filedir_testcase extends advanced_testcase {
|
||||
// Setup the filedir.
|
||||
$vfileroot = $this->setup_vfile_root();
|
||||
|
||||
$this->setExpectedExceptionRegexp('file_exception',
|
||||
$this->expectException('file_exception');
|
||||
$this->expectExceptionMessageRegExp(
|
||||
'/Cannot read file\. Either the file does not exist or there is a permission problem\./');
|
||||
|
||||
$fs = new file_system_filedir();
|
||||
@@ -785,10 +788,9 @@ class core_files_file_system_filedir_testcase extends advanced_testcase {
|
||||
->chmod(0444)
|
||||
->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2);
|
||||
|
||||
$this->setExpectedException(
|
||||
'file_exception',
|
||||
"Can not create local file pool directories, please verify permissions in dataroot."
|
||||
);
|
||||
$this->expectException('file_exception');
|
||||
$this->expectExceptionMessageRegExp(
|
||||
"/Can not create local file pool directories, please verify permissions in dataroot./");
|
||||
|
||||
// Attempt to add the file to the file pool.
|
||||
$fs = new file_system_filedir();
|
||||
@@ -840,10 +842,9 @@ class core_files_file_system_filedir_testcase extends advanced_testcase {
|
||||
->chmod(0444)
|
||||
->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2);
|
||||
|
||||
$this->setExpectedException(
|
||||
'file_exception',
|
||||
"Can not create local file pool directories, please verify permissions in dataroot."
|
||||
);
|
||||
$this->expectException('file_exception');
|
||||
$this->expectExceptionMessageRegExp(
|
||||
"/Can not create local file pool directories, please verify permissions in dataroot./");
|
||||
|
||||
// Attempt to add the file to the file pool.
|
||||
$fs = new file_system_filedir();
|
||||
|
||||
@@ -463,7 +463,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p
|
||||
$result = $zip_archive->close();
|
||||
} catch (Exception $e) {
|
||||
// New PHP versions print PHP Warning.
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
$this->assertContains('ZipArchive::close', $e->getMessage());
|
||||
}
|
||||
// This is crazy, but it shows how some PHP versions do return true.
|
||||
@@ -472,7 +472,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p
|
||||
$this->assertFalse($result);
|
||||
} catch (Exception $e) {
|
||||
// But others do insist into returning true (5.6.13...). Only can accept them.
|
||||
$this->assertInstanceOf('PHPUnit_Framework_ExpectationFailedException', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\ExpectationFailedException', $e);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
$this->assertFileNotExists($archive);
|
||||
|
||||
@@ -72,7 +72,7 @@ if (defined('CLI_SCRIPT')) {
|
||||
}
|
||||
define('CLI_SCRIPT', true);
|
||||
|
||||
$phpunitversion = PHPUnit_Runner_Version::id();
|
||||
$phpunitversion = PHPUnit\Runner\Version::id();
|
||||
if ($phpunitversion === '@package_version@') {
|
||||
// library checked out from git, let's hope dev knows that 3.6.0 is required
|
||||
} else if (version_compare($phpunitversion, '3.6.0', 'lt')) {
|
||||
@@ -80,10 +80,6 @@ if ($phpunitversion === '@package_version@') {
|
||||
}
|
||||
unset($phpunitversion);
|
||||
|
||||
if (!include_once('PHPUnit/Extensions/Database/Autoload.php')) {
|
||||
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITEXTMISSING, 'phpunit/DbUnit');
|
||||
}
|
||||
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
// only load CFG from config.php, stop ASAP in lib/setup.php
|
||||
|
||||
@@ -135,9 +135,9 @@ abstract class advanced_testcase extends base_testcase {
|
||||
// make sure test did not forget to close transaction
|
||||
if ($DB->is_transaction_started()) {
|
||||
self::resetAllData();
|
||||
if ($this->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_PASSED
|
||||
or $this->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED
|
||||
or $this->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE) {
|
||||
if ($this->getStatus() == PHPUnit\Runner\BaseTestRunner::STATUS_PASSED
|
||||
or $this->getStatus() == PHPUnit\Runner\BaseTestRunner::STATUS_SKIPPED
|
||||
or $this->getStatus() == PHPUnit\Runner\BaseTestRunner::STATUS_INCOMPLETE) {
|
||||
throw new coding_exception('Test '.$this->getName().' did not close database transaction');
|
||||
}
|
||||
}
|
||||
@@ -147,20 +147,20 @@ abstract class advanced_testcase extends base_testcase {
|
||||
* Creates a new FlatXmlDataSet with the given $xmlFile. (absolute path.)
|
||||
*
|
||||
* @param string $xmlFile
|
||||
* @return PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet
|
||||
* @return PHPUnit\DbUnit\DataSet\FlatXmlDataSet
|
||||
*/
|
||||
protected function createFlatXMLDataSet($xmlFile) {
|
||||
return new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet($xmlFile);
|
||||
return new PHPUnit\DbUnit\DataSet\FlatXmlDataSet($xmlFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new XMLDataSet with the given $xmlFile. (absolute path.)
|
||||
*
|
||||
* @param string $xmlFile
|
||||
* @return PHPUnit_Extensions_Database_DataSet_XmlDataSet
|
||||
* @return PHPUnit\DbUnit\DataSet\XmlDataSet
|
||||
*/
|
||||
protected function createXMLDataSet($xmlFile) {
|
||||
return new PHPUnit_Extensions_Database_DataSet_XmlDataSet($xmlFile);
|
||||
return new PHPUnit\DbUnit\DataSet\XmlDataSet($xmlFile);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,10 +170,10 @@ abstract class advanced_testcase extends base_testcase {
|
||||
* @param string $delimiter
|
||||
* @param string $enclosure
|
||||
* @param string $escape
|
||||
* @return PHPUnit_Extensions_Database_DataSet_CsvDataSet
|
||||
* @return PHPUnit\DbUnit\DataSet\CsvDataSet
|
||||
*/
|
||||
protected function createCsvDataSet($files, $delimiter = ',', $enclosure = '"', $escape = '"') {
|
||||
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet($delimiter, $enclosure, $escape);
|
||||
$dataSet = new PHPUnit\DbUnit\DataSet\CsvDataSet($delimiter, $enclosure, $escape);
|
||||
foreach($files as $table=>$file) {
|
||||
$dataSet->addTable($table, $file);
|
||||
}
|
||||
@@ -195,10 +195,10 @@ abstract class advanced_testcase extends base_testcase {
|
||||
*
|
||||
* Note: it is usually better to use data generators
|
||||
*
|
||||
* @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataset
|
||||
* @param PHPUnit\DbUnit\DataSet\IDataSet $dataset
|
||||
* @return void
|
||||
*/
|
||||
protected function loadDataSet(PHPUnit_Extensions_Database_DataSet_IDataSet $dataset) {
|
||||
protected function loadDataSet(PHPUnit\DbUnit\DataSet\IDataSet $dataset) {
|
||||
global $DB;
|
||||
|
||||
$structure = phpunit_util::get_tablestructure();
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class phpunit_ArrayDataSet extends PHPUnit_Extensions_Database_DataSet_AbstractDataSet {
|
||||
class phpunit_ArrayDataSet extends PHPUnit\DbUnit\DataSet\AbstractDataSet {
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@@ -58,8 +58,8 @@ class phpunit_ArrayDataSet extends PHPUnit_Extensions_Database_DataSet_AbstractD
|
||||
$columns = array_keys($firstrow);
|
||||
}
|
||||
|
||||
$metaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($tableName, $columns);
|
||||
$table = new PHPUnit_Extensions_Database_DataSet_DefaultTable($metaData);
|
||||
$metaData = new PHPUnit\DbUnit\DataSet\DefaultTableMetaData($tableName, $columns);
|
||||
$table = new PHPUnit\DbUnit\DataSet\DefaultTable($metaData);
|
||||
|
||||
foreach ($rows AS $row) {
|
||||
if ($columnsInFirstRow) {
|
||||
@@ -72,7 +72,7 @@ class phpunit_ArrayDataSet extends PHPUnit_Extensions_Database_DataSet_AbstractD
|
||||
}
|
||||
|
||||
protected function createIterator($reverse = FALSE) {
|
||||
return new PHPUnit_Extensions_Database_DataSet_DefaultTableIterator($this->tables, $reverse);
|
||||
return new PHPUnit\DbUnit\DataSet\DefaultTableIterator($this->tables, $reverse);
|
||||
}
|
||||
|
||||
public function getTable($tableName) {
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* @copyright 2013 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader {
|
||||
class phpunit_autoloader implements \PHPUnit\Runner\TestSuiteLoader {
|
||||
public function load($suiteClassName, $suiteClassFile = '') {
|
||||
global $CFG;
|
||||
|
||||
@@ -66,13 +66,13 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader {
|
||||
}
|
||||
|
||||
if ($suiteClassFile) {
|
||||
PHPUnit_Util_Fileloader::checkAndLoad($suiteClassFile);
|
||||
PHPUnit\Util\Fileloader::checkAndLoad($suiteClassFile);
|
||||
if (class_exists($suiteClassName, false)) {
|
||||
$class = new ReflectionClass($suiteClassName);
|
||||
return $class;
|
||||
}
|
||||
|
||||
throw new PHPUnit_Framework_Exception(
|
||||
throw new PHPUnit\Framework\Exception(
|
||||
sprintf("Class '%s' could not be found in '%s'.", $suiteClassName, $suiteClassFile)
|
||||
);
|
||||
}
|
||||
@@ -155,7 +155,7 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader {
|
||||
}
|
||||
}
|
||||
|
||||
throw new PHPUnit_Framework_Exception(
|
||||
throw new PHPUnit\Framework\Exception(
|
||||
sprintf("Class '%s' could not be found in '%s'.", $suiteClassName, $suiteClassFile)
|
||||
);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader {
|
||||
// class name. Let's throw fatal error if there are more testcases in one file.
|
||||
|
||||
$classes = get_declared_classes();
|
||||
PHPUnit_Util_Fileloader::checkAndLoad($file);
|
||||
PHPUnit\Util\Fileloader::checkAndLoad($file);
|
||||
$includePathFilename = stream_resolve_include_path($file);
|
||||
$loadedClasses = array_diff(get_declared_classes(), $classes);
|
||||
|
||||
@@ -174,7 +174,7 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader {
|
||||
foreach ($loadedClasses as $loadedClass) {
|
||||
$class = new ReflectionClass($loadedClass);
|
||||
|
||||
if ($class->isSubclassOf('PHPUnit_Framework_TestCase') and !$class->isAbstract()) {
|
||||
if ($class->isSubclassOf('PHPUnit\Framework\TestCase') and !$class->isAbstract()) {
|
||||
if (realpath($includePathFilename) === realpath($class->getFileName())) {
|
||||
$candidates[] = $loadedClass;
|
||||
}
|
||||
@@ -182,13 +182,13 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader {
|
||||
}
|
||||
|
||||
if (count($candidates) == 0) {
|
||||
throw new PHPUnit_Framework_Exception(
|
||||
throw new PHPUnit\Framework\Exception(
|
||||
sprintf("File '%s' does not contain any test cases.", $file)
|
||||
);
|
||||
}
|
||||
|
||||
if (count($candidates) > 1) {
|
||||
throw new PHPUnit_Framework_Exception(
|
||||
throw new PHPUnit\Framework\Exception(
|
||||
sprintf("File '%s' contains multiple test cases: ".implode(', ', $candidates), $file)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
* @copyright 2015 Blackboard (http://www.blackboard.com)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
abstract class base_testcase extends PHPUnit_Framework_TestCase {
|
||||
abstract class base_testcase extends PHPUnit\Framework\TestCase {
|
||||
// @codingStandardsIgnoreStart
|
||||
// Following code is legacy code from phpunit to support assertTag
|
||||
// and assertNotTag.
|
||||
@@ -53,7 +53,7 @@ abstract class base_testcase extends PHPUnit_Framework_TestCase {
|
||||
* @deprecated 3.0
|
||||
*/
|
||||
public static function assertTag($matcher, $actual, $message = '', $ishtml = true) {
|
||||
$dom = PHPUnit_Util_XML::load($actual, $ishtml);
|
||||
$dom = PHPUnit\Util\XML::load($actual, $ishtml);
|
||||
$tags = self::findNodes($dom, $matcher, $ishtml);
|
||||
$matched = count($tags) > 0 && $tags[0] instanceof DOMNode;
|
||||
self::assertTrue($matched, $message);
|
||||
@@ -71,7 +71,7 @@ abstract class base_testcase extends PHPUnit_Framework_TestCase {
|
||||
* @deprecated 3.0
|
||||
*/
|
||||
public static function assertNotTag($matcher, $actual, $message = '', $ishtml = true) {
|
||||
$dom = PHPUnit_Util_XML::load($actual, $ishtml);
|
||||
$dom = PHPUnit\Util\XML::load($actual, $ishtml);
|
||||
$tags = self::findNodes($dom, $matcher, $ishtml);
|
||||
$matched = (is_array($tags) && count($tags) > 0) && $tags[0] instanceof DOMNode;
|
||||
self::assertFalse($matched, $message);
|
||||
@@ -85,7 +85,7 @@ abstract class base_testcase extends PHPUnit_Framework_TestCase {
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws PHPUnit_Framework_Exception
|
||||
* @throws PHPUnit\Framework\Exception
|
||||
*/
|
||||
public static function assertValidKeys(array $hash, array $validKeys) {
|
||||
$valids = array();
|
||||
@@ -106,7 +106,7 @@ abstract class base_testcase extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
if (!empty($unknown)) {
|
||||
throw new PHPUnit_Framework_Exception(
|
||||
throw new PHPUnit\Framework\Exception(
|
||||
'Unknown key(s): ' . implode(', ', $unknown)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* @copyright 2015 Andrew Nicols <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit_Framework_Constraint_IsEqual {
|
||||
class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit\Framework\Constraint\IsEqual {
|
||||
|
||||
/**
|
||||
* @var array $keys The list of exceptions.
|
||||
@@ -41,7 +41,7 @@ class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit_Framewo
|
||||
|
||||
/**
|
||||
* Add an exception for the named key to use a different comparison
|
||||
* method. Any assertion provided by PHPUnit_Framework_Assert is
|
||||
* method. Any assertion provided by PHPUnit\Framework\Assert is
|
||||
* acceptable.
|
||||
*
|
||||
* @param string $key The key to except.
|
||||
@@ -65,13 +65,13 @@ class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit_Framewo
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $shouldreturnesult Whether to return a result or throw an exception
|
||||
* @return mixed
|
||||
* @throws PHPUnit_Framework_ExpectationFailedException
|
||||
* @throws PHPUnit\Framework\ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $shouldreturnesult = false) {
|
||||
foreach ($this->keys as $key => $comparison) {
|
||||
if (isset($other->$key) || isset($this->value->$key)) {
|
||||
// One of the keys is present, therefore run the comparison.
|
||||
PHPUnit_Framework_Assert::$comparison($this->value->$key, $other->$key);
|
||||
PHPUnit\Framework\Assert::$comparison($this->value->$key, $other->$key);
|
||||
|
||||
// Unset the keys, otherwise the standard evaluation will take place.
|
||||
unset($other->$key);
|
||||
|
||||
@@ -33,12 +33,12 @@
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class Hint_ResultPrinter extends PHPUnit_TextUI_ResultPrinter {
|
||||
class Hint_ResultPrinter extends PHPUnit\TextUI\ResultPrinter {
|
||||
public function __construct() {
|
||||
// ARRGH - PHPUnit does not give us commandline arguments or xml config, so let's hack hard!
|
||||
if (defined('DEBUG_BACKTRACE_PROVIDE_OBJECT')) {
|
||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT);
|
||||
if (isset($backtrace[2]['object']) and ($backtrace[2]['object'] instanceof PHPUnit_TextUI_Command)) {
|
||||
if (isset($backtrace[2]['object']) and ($backtrace[2]['object'] instanceof PHPUnit\TextUI\Command)) {
|
||||
list($verbose, $colors, $debug) = Hacky_TextUI_Command_reader::get_settings_hackery($backtrace[2]['object']);
|
||||
parent::__construct(null, $verbose, $colors, $debug);
|
||||
return;
|
||||
@@ -48,7 +48,7 @@ class Hint_ResultPrinter extends PHPUnit_TextUI_ResultPrinter {
|
||||
parent::__construct(null, false, self::COLOR_DEFAULT, false);
|
||||
}
|
||||
|
||||
protected function printDefectTrace(PHPUnit_Framework_TestFailure $defect) {
|
||||
protected function printDefectTrace(PHPUnit\Framework\TestFailure $defect) {
|
||||
global $CFG;
|
||||
|
||||
parent::printDefectTrace($defect);
|
||||
@@ -129,10 +129,10 @@ class Hint_ResultPrinter extends PHPUnit_TextUI_ResultPrinter {
|
||||
* @copyright 2012 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class Hacky_TextUI_Command_reader extends PHPUnit_TextUI_Command {
|
||||
public static function get_settings_hackery(PHPUnit_TextUI_Command $toread) {
|
||||
class Hacky_TextUI_Command_reader extends PHPUnit\TextUI\Command {
|
||||
public static function get_settings_hackery(PHPUnit\TextUI\Command $toread) {
|
||||
$arguments = $toread->arguments;
|
||||
$config = PHPUnit_Util_Configuration::getInstance($arguments['configuration'])->getPHPUnitConfiguration();
|
||||
$config = PHPUnit\Util\Configuration::getInstance($arguments['configuration'])->getPHPUnitConfiguration();
|
||||
|
||||
$verbose = isset($config['verbose']) ? $config['verbose'] : false;
|
||||
$verbose = isset($arguments['verbose']) ? $arguments['verbose'] : $verbose;
|
||||
|
||||
@@ -621,7 +621,7 @@ class phpunit_util extends testing_util {
|
||||
|
||||
foreach ($backtrace as $bt) {
|
||||
if (isset($bt['object']) and is_object($bt['object'])
|
||||
&& $bt['object'] instanceof PHPUnit_Framework_TestCase) {
|
||||
&& $bt['object'] instanceof PHPUnit\Framework\TestCase) {
|
||||
$debug = new stdClass();
|
||||
$debug->message = $message;
|
||||
$debug->level = $level;
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
<xs:attribute name="convertNoticesToExceptions" type="xs:boolean" default="true"/>
|
||||
<xs:attribute name="convertWarningsToExceptions" type="xs:boolean" default="true"/>
|
||||
<xs:attribute name="forceCoversAnnotation" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="printerClass" type="xs:string" default="PHPUnit_TextUI_ResultPrinter"/>
|
||||
<xs:attribute name="printerClass" type="xs:string" default="PHPUnit\TextUI\ResultPrinter"/>
|
||||
<xs:attribute name="printerFile" type="xs:anyURI"/>
|
||||
<xs:attribute name="processIsolation" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stopOnError" type="xs:boolean" default="false"/>
|
||||
@@ -221,7 +221,7 @@
|
||||
<xs:attribute name="timeoutForSmallTests" type="xs:integer" default="1"/>
|
||||
<xs:attribute name="timeoutForMediumTests" type="xs:integer" default="10"/>
|
||||
<xs:attribute name="timeoutForLargeTests" type="xs:integer" default="60"/>
|
||||
<xs:attribute name="testSuiteLoaderClass" type="xs:string" default="PHPUnit_Runner_StandardTestSuiteLoader"/>
|
||||
<xs:attribute name="testSuiteLoaderClass" type="xs:string" default="PHPUnit\Runner\StandardTestSuiteLoader"/>
|
||||
<xs:attribute name="testSuiteLoaderFile" type="xs:anyURI"/>
|
||||
<xs:attribute name="verbose" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stderr" type="xs:boolean" default="false"/>
|
||||
|
||||
@@ -223,7 +223,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase {
|
||||
try {
|
||||
self::resetAllData(true);
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
}
|
||||
$this->assertEquals(1, $DB->get_field('user', 'confirmed', array('id'=>2)));
|
||||
|
||||
@@ -234,7 +234,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase {
|
||||
try {
|
||||
self::resetAllData(true);
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
$this->assertContains('xx', $e->getMessage());
|
||||
$this->assertContains('admin', $e->getMessage());
|
||||
$this->assertContains('rolesactive', $e->getMessage());
|
||||
@@ -276,7 +276,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase {
|
||||
try {
|
||||
self::resetAllData(true);
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
$this->assertEquals(1, $SITE->id);
|
||||
$this->assertSame($SITE, $COURSE);
|
||||
$this->assertSame($SITE, $COURSE);
|
||||
@@ -287,7 +287,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase {
|
||||
try {
|
||||
self::resetAllData(true);
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
$this->assertEquals(0, $USER->id);
|
||||
}
|
||||
}
|
||||
@@ -377,7 +377,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase {
|
||||
$this->assertTimeCurrent(time()+10);
|
||||
$this->fail('Failed assert expected');
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_ExpectationFailedException', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\ExpectationFailedException', $e);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -385,7 +385,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase {
|
||||
$this->assertTimeCurrent(time()-10);
|
||||
$this->fail('Failed assert expected');
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_ExpectationFailedException', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\ExpectationFailedException', $e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,19 +600,19 @@ class core_phpunit_advanced_testcase extends advanced_testcase {
|
||||
try {
|
||||
$this->setTimezone('Pacific/Auckland', '');
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->setTimezone('Pacific/Auckland', 'xxxx');
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->setTimezone('Pacific/Auckland', null);
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -637,7 +637,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase {
|
||||
try {
|
||||
self::resetAllData(true);
|
||||
} catch (Exception $e) {
|
||||
$this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
|
||||
$this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e);
|
||||
}
|
||||
|
||||
if ($CFG->ostype === 'WINDOWS') {
|
||||
|
||||
@@ -851,7 +851,7 @@ class core_event_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_Error_Notice
|
||||
* @expectedException PHPUnit\Framework\Error\Notice
|
||||
*/
|
||||
public function test_context_not_used() {
|
||||
$event = \core_tests\event\context_used_in_event::create(array('other' => array('sample' => 1, 'xx' => 10)));
|
||||
|
||||
@@ -1824,7 +1824,7 @@ class core_moodlelib_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_Error_Warning
|
||||
* @expectedException PHPUnit\Framework\Error\Warning
|
||||
*/
|
||||
public function test_get_string_limitation() {
|
||||
// This is one of the limitations to the lang_string class. It can't be
|
||||
|
||||
@@ -55,6 +55,12 @@ class core_session_redis_testcase extends advanced_testcase {
|
||||
if (!defined('TEST_SESSION_REDIS_HOST')) {
|
||||
$this->markTestSkipped('Session test server not set. define: TEST_SESSION_REDIS_HOST');
|
||||
}
|
||||
$version = phpversion('Redis');
|
||||
if (!$version) {
|
||||
$this->markTestSkipped('Redis extension version missing');
|
||||
} else if (version_compare($version, '2.0') <= 0) {
|
||||
$this->markTestSkipped('Redis extension version must be at least 2.0: now running "' . $version . '"');
|
||||
}
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
|
||||
@@ -188,16 +188,16 @@ class core_statslib_testcase extends advanced_testcase {
|
||||
static $replacements = null;
|
||||
|
||||
$raw = $this->createXMLDataSet($file);
|
||||
$clean = new PHPUnit_Extensions_Database_DataSet_ReplacementDataSet($raw);
|
||||
$clean = new PHPUnit\DbUnit\DataSet\ReplacementDataSet($raw);
|
||||
|
||||
foreach ($this->replacements as $placeholder => $value) {
|
||||
$clean->addFullReplacement($placeholder, $value);
|
||||
}
|
||||
|
||||
$logs = new PHPUnit_Extensions_Database_DataSet_DataSetFilter($clean);
|
||||
$logs = new PHPUnit\DbUnit\DataSet\Filter($clean);
|
||||
$logs->addIncludeTables(array('log'));
|
||||
|
||||
$stats = new PHPUnit_Extensions_Database_DataSet_DataSetFilter($clean);
|
||||
$stats = new PHPUnit\DbUnit\DataSet\Filter($clean);
|
||||
$stats->addIncludeTables(array('stats_daily', 'stats_user_daily'));
|
||||
|
||||
return array($logs, $stats);
|
||||
|
||||
@@ -264,7 +264,7 @@ class mod_feedback_external_testcase extends externallib_advanced_testcase {
|
||||
*/
|
||||
public function test_view_feedback_invalid_id() {
|
||||
// Test invalid instance id.
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_feedback_external::view_feedback(0);
|
||||
}
|
||||
/**
|
||||
@@ -273,7 +273,7 @@ class mod_feedback_external_testcase extends externallib_advanced_testcase {
|
||||
public function test_view_feedback_not_enrolled_user() {
|
||||
$usernotenrolled = self::getDataGenerator()->create_user();
|
||||
$this->setUser($usernotenrolled);
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_feedback_external::view_feedback(0);
|
||||
}
|
||||
/**
|
||||
@@ -284,7 +284,7 @@ class mod_feedback_external_testcase extends externallib_advanced_testcase {
|
||||
// We need a explicit prohibit since this capability is allowed for students by default.
|
||||
assign_capability('mod/feedback:view', CAP_PROHIBIT, $this->studentrole->id, $this->context->id);
|
||||
accesslib_clear_all_caches_for_unit_testing();
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_feedback_external::view_feedback(0);
|
||||
}
|
||||
/**
|
||||
@@ -671,7 +671,7 @@ class mod_feedback_external_testcase extends externallib_advanced_testcase {
|
||||
*/
|
||||
public function test_get_non_respondents_no_permissions() {
|
||||
$this->setUser($this->student);
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_feedback_external::get_non_respondents($this->feedback->id);
|
||||
}
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase {
|
||||
* Test test_view_lesson invalid id.
|
||||
*/
|
||||
public function test_view_lesson_invalid_id() {
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_lesson_external::view_lesson(0);
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase {
|
||||
// Test not-enrolled user.
|
||||
$usernotenrolled = self::getDataGenerator()->create_user();
|
||||
$this->setUser($usernotenrolled);
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_lesson_external::view_lesson($this->lesson->id);
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase {
|
||||
course_modinfo::clear_instance_cache();
|
||||
|
||||
$this->setUser($this->student);
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_lesson_external::view_lesson($this->lesson->id);
|
||||
}
|
||||
|
||||
@@ -814,7 +814,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase {
|
||||
// Should fails as student.
|
||||
$this->setUser($this->student);
|
||||
// Now, try to review this attempt. We should not be able because is a non-finished attempt.
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_lesson_external::launch_attempt($this->lesson->id, '', 1, true);
|
||||
}
|
||||
|
||||
@@ -893,7 +893,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase {
|
||||
|
||||
// Fail as student.
|
||||
$this->setUser($this->student);
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_lesson_external::launch_attempt($this->lesson->id, '', 1, true);
|
||||
}
|
||||
|
||||
@@ -966,7 +966,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase {
|
||||
// Now check using a normal student account.
|
||||
$this->setUser($this->student);
|
||||
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
$result = mod_lesson_external::get_page_data($this->lesson->id, $this->page2->id, '', false, true);
|
||||
}
|
||||
|
||||
@@ -1245,7 +1245,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase {
|
||||
$this->assertEquals(1, $result['userstats']['gradeinfo']['total']); // Total correct answers.
|
||||
$this->assertEquals(100, $result['userstats']['gradeinfo']['grade']); // Correct answer.
|
||||
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
$result = mod_lesson_external::get_user_attempt($this->lesson->id, $this->teacher->id, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class quiz_report_responses_from_steps_testcase extends mod_quiz_attempt_walkthr
|
||||
* Create a quiz add questions to it, walk through quiz attempts and then check results.
|
||||
*
|
||||
* @param array $quizsettings settings to override default settings for quiz created by generator. Taken from quizzes.csv.
|
||||
* @param PHPUnit_Extensions_Database_DataSet_ITable[] $csvdata of data read from csv file "questionsXX.csv",
|
||||
* @param PHPUnit\DbUnit\DataSet\ITable[] $csvdata of data read from csv file "questionsXX.csv",
|
||||
* "stepsXX.csv" and "responsesXX.csv".
|
||||
* @dataProvider get_data_for_walkthrough
|
||||
*/
|
||||
|
||||
@@ -66,7 +66,7 @@ class quiz_report_statistics_from_steps_testcase extends mod_quiz_attempt_walkth
|
||||
/**
|
||||
* Create a quiz add questions to it, walk through quiz attempts and then check results.
|
||||
*
|
||||
* @param PHPUnit_Extensions_Database_DataSet_ITable[] of data read from csv file "questionsXX.csv",
|
||||
* @param PHPUnit\DbUnit\DataSet\ITable[] of data read from csv file "questionsXX.csv",
|
||||
* "stepsXX.csv" and "resultsXX.csv".
|
||||
* @dataProvider get_data_for_walkthrough
|
||||
*/
|
||||
@@ -89,7 +89,7 @@ class quiz_report_statistics_from_steps_testcase extends mod_quiz_attempt_walkth
|
||||
/**
|
||||
* Check actual question stats are the same as that found in csv file.
|
||||
*
|
||||
* @param $qstats PHPUnit_Extensions_Database_DataSet_ITable data from csv file.
|
||||
* @param $qstats PHPUnit\DbUnit\DataSet\ITable data from csv file.
|
||||
* @param $questionstats \core_question\statistics\questions\all_calculated_for_qubaid_condition Calculated stats.
|
||||
*/
|
||||
protected function check_question_stats($qstats, $questionstats) {
|
||||
@@ -358,7 +358,7 @@ class quiz_report_statistics_from_steps_testcase extends mod_quiz_attempt_walkth
|
||||
/**
|
||||
* Check the question stats and the response counts used in the statistics report. If the appropriate files exist in fixtures/.
|
||||
*
|
||||
* @param PHPUnit_Extensions_Database_DataSet_ITable[] $csvdata Data loaded from csv files for this test.
|
||||
* @param PHPUnit\DbUnit\DataSet\ITable[] $csvdata Data loaded from csv files for this test.
|
||||
* @param string $whichattempts
|
||||
* @param string $whichtries
|
||||
* @param \core\dml\sql_join $groupstudentsjoins
|
||||
|
||||
@@ -57,7 +57,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase {
|
||||
* directory.
|
||||
*
|
||||
* @param array $quizsettings of settings read from csv file quizzes.csv
|
||||
* @param PHPUnit_Extensions_Database_DataSet_ITable[] $csvdata of data read from csv file "questionsXX.csv",
|
||||
* @param PHPUnit\DbUnit\DataSet\ITable[] $csvdata of data read from csv file "questionsXX.csv",
|
||||
* "stepsXX.csv" and "resultsXX.csv".
|
||||
* @dataProvider get_data_for_walkthrough
|
||||
*/
|
||||
@@ -141,7 +141,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase {
|
||||
* Create quiz, simulate attempts and check results (if resultsXX.csv exists).
|
||||
*
|
||||
* @param array $quizsettings Quiz overrides for this quiz.
|
||||
* @param PHPUnit_Extensions_Database_DataSet_ITable[] $csvdata Data loaded from csv files for this test.
|
||||
* @param PHPUnit\DbUnit\DataSet\ITable[] $csvdata Data loaded from csv files for this test.
|
||||
*/
|
||||
protected function create_quiz_simulate_attempts_and_check_results($quizsettings, $csvdata) {
|
||||
$this->resetAfterTest(true);
|
||||
@@ -172,7 +172,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase {
|
||||
*
|
||||
* @param string $setname
|
||||
* @param string $test
|
||||
* @return \PHPUnit_Extensions_Database_DataSet_ITable
|
||||
* @return PHPUnit\DbUnit\DataSet\ITable
|
||||
*/
|
||||
protected function load_csv_data_file($setname, $test='') {
|
||||
$files = array($setname => $this->get_full_path_of_csv_file($setname, $test));
|
||||
@@ -228,7 +228,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $steps PHPUnit_Extensions_Database_DataSet_ITable the step data from the csv file.
|
||||
* @param $steps PHPUnit\DbUnit\DataSet\ITable the step data from the csv file.
|
||||
* @return array attempt no as in csv file => the id of the quiz_attempt as stored in the db.
|
||||
*/
|
||||
protected function walkthrough_attempts($steps) {
|
||||
@@ -289,7 +289,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $results PHPUnit_Extensions_Database_DataSet_ITable the results data from the csv file.
|
||||
* @param $results PHPUnit\DbUnit\DataSet\ITable the results data from the csv file.
|
||||
* @param $attemptids array attempt no as in csv file => the id of the quiz_attempt as stored in the db.
|
||||
*/
|
||||
protected function check_attempts_results($results, $attemptids) {
|
||||
|
||||
@@ -1260,7 +1260,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase {
|
||||
// Switch to closed phase.
|
||||
$this->setUser($this->anotherstudentg1);
|
||||
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_workshop_external::get_assessment($assessmentid);
|
||||
}
|
||||
|
||||
@@ -1283,7 +1283,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase {
|
||||
$DB->set_field('workshop', 'phase', workshop::PHASE_CLOSED, array('id' => $this->workshop->id));
|
||||
$this->setUser($this->anotherstudentg2);
|
||||
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_workshop_external::get_assessment($assessmentid);
|
||||
}
|
||||
|
||||
@@ -1359,7 +1359,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase {
|
||||
$DB->set_field('workshop', 'phase', workshop::PHASE_EVALUATION, array('id' => $this->workshop->id));
|
||||
$this->setUser($this->student);
|
||||
// Since we are not reviewers we can't see the assessment until the workshop is closed.
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_workshop_external::get_assessment_form_definition($assessmentid);
|
||||
}
|
||||
|
||||
@@ -1414,7 +1414,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase {
|
||||
$DB->set_field('workshop', 'phase', workshop::PHASE_ASSESSMENT, array('id' => $this->workshop->id));
|
||||
// Try to get other user assessments.
|
||||
$this->setUser($this->student);
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_workshop_external::get_reviewer_assessments($this->workshop->id, $this->anotherstudentg1->id);
|
||||
}
|
||||
|
||||
@@ -1427,7 +1427,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase {
|
||||
$DB->set_field('workshop', 'phase', workshop::PHASE_SUBMISSION, array('id' => $this->workshop->id));
|
||||
// Try to get other user assessments.
|
||||
$this->setUser($this->student);
|
||||
$this->setExpectedException('moodle_exception');
|
||||
$this->expectException('moodle_exception');
|
||||
mod_workshop_external::get_reviewer_assessments($this->workshop->id, $this->anotherstudentg1->id);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
stopOnFailure="false"
|
||||
stopOnIncomplete="false"
|
||||
stopOnSkipped="false"
|
||||
beStrictAboutTestsThatDoNotTestAnything="false"
|
||||
printerClass="Hint_ResultPrinter"
|
||||
testSuiteLoaderClass="phpunit_autoloader"
|
||||
>
|
||||
|
||||
@@ -1225,7 +1225,7 @@ class core_user_externallib_testcase extends externallib_advanced_testcase {
|
||||
$user2 = self::getDataGenerator()->create_user();
|
||||
$this->setUser($user1);
|
||||
|
||||
$this->setExpectedException('required_capability_exception');
|
||||
$this->expectException('required_capability_exception');
|
||||
// Try to retrieve other user private files info.
|
||||
core_user_external::get_private_files_info($user2->id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user