Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
bfaf4f00
Commit
bfaf4f00
authored
Jan 29, 2014
by
Petr Škoda
Browse files
MDL-43903 prevent adodb error logging output in phpunit execution with
native ms sql driver
parent
7e3f5e79
Changes
2
Hide whitespace changes
Inline
Side-by-side
auth/db/tests/db_test.php
View file @
bfaf4f00
...
...
@@ -28,11 +28,17 @@ defined('MOODLE_INTERNAL') || die();
class
auth_db_testcase
extends
advanced_testcase
{
/** @var string Original error log */
protected
$oldlog
;
protected
function
init_auth_database
()
{
global
$DB
,
$CFG
;
require_once
(
"
$CFG->dirroot
/auth/db/auth.php"
);
// Discard error logs from AdoDB.
$this
->
oldlog
=
ini_get
(
'error_log'
);
ini_set
(
'error_log'
,
"
$CFG->dataroot
/testlog.log"
);
$dbman
=
$DB
->
get_manager
();
set_config
(
'extencoding'
,
'utf-8'
,
'auth/db'
);
...
...
@@ -133,6 +139,8 @@ class auth_db_testcase extends advanced_testcase {
$dbman
=
$DB
->
get_manager
();
$table
=
new
xmldb_table
(
'auth_db_users'
);
$dbman
->
drop_table
(
$table
);
ini_set
(
'error_log'
,
$this
->
oldlog
);
}
public
function
test_plugin
()
{
...
...
enrol/database/tests/sync_test.php
View file @
bfaf4f00
...
...
@@ -31,9 +31,16 @@ class enrol_database_testcase extends advanced_testcase {
protected
static
$users
=
array
();
protected
static
$roles
=
array
();
/** @var string Original error log */
protected
$oldlog
;
protected
function
init_enrol_database
()
{
global
$DB
,
$CFG
;
// Discard error logs from AdoDB.
$this
->
oldlog
=
ini_get
(
'error_log'
);
ini_set
(
'error_log'
,
"
$CFG->dataroot
/testlog.log"
);
$dbman
=
$DB
->
get_manager
();
set_config
(
'dbencoding'
,
'utf-8'
,
'enrol_database'
);
...
...
@@ -160,6 +167,8 @@ class enrol_database_testcase extends advanced_testcase {
self
::
$courses
=
null
;
self
::
$users
=
null
;
self
::
$roles
=
null
;
ini_set
(
'error_log'
,
$this
->
oldlog
);
}
protected
function
reset_enrol_database
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment