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
3ee3b8c5
Commit
3ee3b8c5
authored
Aug 18, 2008
by
nicolasconnault
Browse files
MDL-15837 Fix errors in unit tests
parent
47cfd331
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/dml/simpletest/testdml.php
View file @
3ee3b8c5
...
...
@@ -1009,15 +1009,15 @@ class dml_test extends UnitTestCase {
$dbman
->
create_table
(
$table
);
$this
->
tables
[
$table
->
getName
()]
=
$table
;
$clob
=
file_get_contents
(
$CFG
->
libdir
.
'/dml/simpletest/clob.txt'
,
FILE_TEXT
);
$blob
=
file_get_contents
(
$CFG
->
libdir
.
'/dml/simpletest/randombinary'
,
FILE_BINARY
);
$clob
=
file_get_contents
(
$CFG
->
libdir
.
'/dml/simpletest/clob.txt'
);
$blob
=
file_get_contents
(
$CFG
->
libdir
.
'/dml/simpletest/randombinary'
);
$this
->
assertTrue
(
$id
=
$DB
->
insert_record
(
'testtable'
,
array
(
'description'
=>
$clob
,
'image'
=>
$blob
)));
$this
->
assertTrue
(
$record
=
$DB
->
get_record
(
'testtable'
,
array
(
'id'
=>
$id
)));
$this
->
assertEqual
(
$clob
,
$record
->
description
);
$this
->
assertEqual
(
$blob
,
$record
->
image
);
$this
->
assertEqual
(
$clob
,
$DB
->
get_field
(
'testtable'
,
'description'
,
'id'
,
$id
));
$this
->
assertEqual
(
$blob
,
$DB
->
get_field
(
'testtable'
,
'image'
,
'id'
,
$id
));
$this
->
assertEqual
(
$clob
,
$DB
->
get_field
(
'testtable'
,
'description'
,
array
(
'id'
=>
$id
))
)
;
$this
->
assertEqual
(
$blob
,
$DB
->
get_field
(
'testtable'
,
'image'
,
array
(
'id'
=>
$id
))
)
;
}
...
...
@@ -1109,8 +1109,8 @@ class dml_test extends UnitTestCase {
$record
=
$DB
->
get_record
(
'testtable'
,
array
(
'id'
=>
$id
));
$this
->
assertEqual
(
substr
(
$clob
,
0
,
500
),
$record
->
description
);
$this
->
assertEqual
(
substr
(
$blob
,
0
,
250
),
$record
->
image
);
$this
->
assertEqual
(
substr
(
$clob
,
0
,
500
),
$DB
->
get_field
(
'testtable'
,
'description'
,
'id'
,
$id
));
$this
->
assertEqual
(
substr
(
$blob
,
0
,
250
),
$DB
->
get_field
(
'testtable'
,
'image'
,
'id'
,
$id
));
$this
->
assertEqual
(
substr
(
$clob
,
0
,
500
),
$DB
->
get_field
(
'testtable'
,
'description'
,
array
(
'id'
=>
$id
))
)
;
$this
->
assertEqual
(
substr
(
$blob
,
0
,
250
),
$DB
->
get_field
(
'testtable'
,
'image'
,
array
(
'id'
=>
$id
))
)
;
}
...
...
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