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
411a1b84
Commit
411a1b84
authored
Feb 25, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests for Object
parent
4c7bd953
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
ObjectTest.php
tests/unit/framework/base/ObjectTest.php
+21
-0
No files found.
tests/unit/framework/base/ObjectTest.php
View file @
411a1b84
...
@@ -71,6 +71,12 @@ class ObjectTest extends TestCase
...
@@ -71,6 +71,12 @@ class ObjectTest extends TestCase
$this
->
object
->
NewMember
=
$value
;
$this
->
object
->
NewMember
=
$value
;
}
}
public
function
testSetReadOnlyProperty
()
{
$this
->
setExpectedException
(
'yii\base\InvalidCallException'
);
$this
->
object
->
object
=
'test'
;
}
public
function
testIsset
()
public
function
testIsset
()
{
{
$this
->
assertTrue
(
isset
(
$this
->
object
->
Text
));
$this
->
assertTrue
(
isset
(
$this
->
object
->
Text
));
...
@@ -83,6 +89,9 @@ class ObjectTest extends TestCase
...
@@ -83,6 +89,9 @@ class ObjectTest extends TestCase
$this
->
object
->
Text
=
null
;
$this
->
object
->
Text
=
null
;
$this
->
assertFalse
(
isset
(
$this
->
object
->
Text
));
$this
->
assertFalse
(
isset
(
$this
->
object
->
Text
));
$this
->
assertTrue
(
empty
(
$this
->
object
->
Text
));
$this
->
assertTrue
(
empty
(
$this
->
object
->
Text
));
$this
->
assertFalse
(
isset
(
$this
->
object
->
unknownProperty
));
$this
->
assertTrue
(
empty
(
$this
->
object
->
unknownProperty
));
}
}
public
function
testUnset
()
public
function
testUnset
()
...
@@ -92,6 +101,18 @@ class ObjectTest extends TestCase
...
@@ -92,6 +101,18 @@ class ObjectTest extends TestCase
$this
->
assertTrue
(
empty
(
$this
->
object
->
Text
));
$this
->
assertTrue
(
empty
(
$this
->
object
->
Text
));
}
}
public
function
testUnsetReadOnlyProperty
()
{
$this
->
setExpectedException
(
'yii\base\InvalidCallException'
);
unset
(
$this
->
object
->
object
);
}
public
function
testCallUnknownMethod
()
{
$this
->
setExpectedException
(
'yii\base\UnknownMethodException'
);
$this
->
object
->
unknownMethod
();
}
public
function
testArrayProperty
()
public
function
testArrayProperty
()
{
{
$this
->
assertEquals
(
array
(),
$this
->
object
->
items
);
$this
->
assertEquals
(
array
(),
$this
->
object
->
items
);
...
...
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