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
79859238
Commit
79859238
authored
Feb 25, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests for Dictionary
parent
411a1b84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
DictionaryTest.php
tests/unit/framework/base/DictionaryTest.php
+8
-0
No files found.
tests/unit/framework/base/DictionaryTest.php
View file @
79859238
...
@@ -62,6 +62,8 @@ class DictionaryTest extends \yiiunit\TestCase
...
@@ -62,6 +62,8 @@ class DictionaryTest extends \yiiunit\TestCase
$this
->
dictionary
->
add
(
'key3'
,
$this
->
item3
);
$this
->
dictionary
->
add
(
'key3'
,
$this
->
item3
);
$this
->
assertEquals
(
3
,
$this
->
dictionary
->
getCount
());
$this
->
assertEquals
(
3
,
$this
->
dictionary
->
getCount
());
$this
->
assertTrue
(
$this
->
dictionary
->
contains
(
'key3'
));
$this
->
assertTrue
(
$this
->
dictionary
->
contains
(
'key3'
));
$this
->
dictionary
[]
=
'test'
;
}
}
public
function
testRemove
()
public
function
testRemove
()
...
@@ -74,9 +76,15 @@ class DictionaryTest extends \yiiunit\TestCase
...
@@ -74,9 +76,15 @@ class DictionaryTest extends \yiiunit\TestCase
public
function
testClear
()
public
function
testClear
()
{
{
$this
->
dictionary
->
add
(
'key3'
,
$this
->
item3
);
$this
->
dictionary
->
clear
();
$this
->
dictionary
->
clear
();
$this
->
assertEquals
(
0
,
$this
->
dictionary
->
getCount
());
$this
->
assertEquals
(
0
,
$this
->
dictionary
->
getCount
());
$this
->
assertTrue
(
!
$this
->
dictionary
->
contains
(
'key1'
)
&&
!
$this
->
dictionary
->
contains
(
'key2'
));
$this
->
assertTrue
(
!
$this
->
dictionary
->
contains
(
'key1'
)
&&
!
$this
->
dictionary
->
contains
(
'key2'
));
$this
->
dictionary
->
add
(
'key3'
,
$this
->
item3
);
$this
->
dictionary
->
clear
(
true
);
$this
->
assertEquals
(
0
,
$this
->
dictionary
->
getCount
());
$this
->
assertTrue
(
!
$this
->
dictionary
->
contains
(
'key1'
)
&&
!
$this
->
dictionary
->
contains
(
'key2'
));
}
}
public
function
testContains
()
public
function
testContains
()
...
...
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