Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
bce353bf
Commit
bce353bf
authored
Dec 06, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed test break.
parent
cb4a8c76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
12 deletions
+1
-12
FileValidatorTest.php
tests/unit/framework/validators/FileValidatorTest.php
+1
-12
No files found.
tests/unit/framework/validators/FileValidatorTest.php
View file @
bce353bf
...
@@ -215,8 +215,6 @@ class FileValidatorTest extends TestCase
...
@@ -215,8 +215,6 @@ class FileValidatorTest extends TestCase
$val
->
validateAttribute
(
$m
,
'attr_err_part'
);
$val
->
validateAttribute
(
$m
,
'attr_err_part'
);
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_part'
));
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_part'
));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_part'
)));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_part'
)));
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$this
->
assertSame
(
FileValidator
::
className
()
.
'::validateFile'
,
$log
[
'messages'
][
0
][
2
]);
}
}
public
function
testValidateAttributeType
()
public
function
testValidateAttributeType
()
...
@@ -261,8 +259,6 @@ class FileValidatorTest extends TestCase
...
@@ -261,8 +259,6 @@ class FileValidatorTest extends TestCase
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_part'
));
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_part'
));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_part'
)));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_part'
)));
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$this
->
assertSame
(
FileValidator
::
className
()
.
'::validateFile'
,
$log
[
'messages'
][
0
][
2
]);
$this
->
assertContains
(
'File was only'
,
$log
[
'messages'
][
0
][
0
]);
}
}
public
function
testValidateAttributeErrCantWrite
()
public
function
testValidateAttributeErrCantWrite
()
...
@@ -273,8 +269,6 @@ class FileValidatorTest extends TestCase
...
@@ -273,8 +269,6 @@ class FileValidatorTest extends TestCase
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_write'
));
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_write'
));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_write'
)));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_write'
)));
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$this
->
assertSame
(
FileValidator
::
className
()
.
'::validateFile'
,
$log
[
'messages'
][
0
][
2
]);
$this
->
assertContains
(
'Failed to write'
,
$log
[
'messages'
][
0
][
0
]);
}
}
public
function
testValidateAttributeErrExtension
()
public
function
testValidateAttributeErrExtension
()
...
@@ -285,8 +279,6 @@ class FileValidatorTest extends TestCase
...
@@ -285,8 +279,6 @@ class FileValidatorTest extends TestCase
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_ext'
));
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_ext'
));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_ext'
)));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_ext'
)));
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$this
->
assertSame
(
FileValidator
::
className
()
.
'::validateFile'
,
$log
[
'messages'
][
0
][
2
]);
$this
->
assertContains
(
'PHP extension'
,
$log
[
'messages'
][
0
][
0
]);
}
}
public
function
testValidateAttributeErrNoTmpDir
()
public
function
testValidateAttributeErrNoTmpDir
()
...
@@ -297,7 +289,5 @@ class FileValidatorTest extends TestCase
...
@@ -297,7 +289,5 @@ class FileValidatorTest extends TestCase
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_tmp'
));
$this
->
assertTrue
(
$m
->
hasErrors
(
'attr_err_tmp'
));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_tmp'
)));
$this
->
assertSame
(
Yii
::
t
(
'yii'
,
'File upload failed.'
),
current
(
$m
->
getErrors
(
'attr_err_tmp'
)));
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$log
=
Yii
::
$app
->
getLog
()
->
toArray
();
$this
->
assertSame
(
FileValidator
::
className
()
.
'::validateFile'
,
$log
[
'messages'
][
0
][
2
]);
$this
->
assertContains
(
'Missing the temporary folder'
,
$log
[
'messages'
][
0
][
0
]);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
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