Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
ce90ee57
Commit
ce90ee57
authored
Aug 20, 2007
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Doctrine_Node_NestedSet::getNumberChildren()
parent
6d4f7da2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
NestedSet.php
lib/Doctrine/Node/NestedSet.php
+1
-6
SingleRootTestCase.php
tests/NestedSet/SingleRootTestCase.php
+7
-0
No files found.
lib/Doctrine/Node/NestedSet.php
View file @
ce90ee57
...
...
@@ -318,12 +318,7 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
*/
public
function
getNumberChildren
()
{
$count
=
0
;
$children
=
$this
->
getChildren
();
while
(
$children
->
next
())
{
$count
++
;
}
return
$count
;
return
count
(
$this
->
getChildren
());
}
/**
...
...
tests/NestedSet/SingleRootTestCase.php
View file @
ce90ee57
...
...
@@ -72,6 +72,13 @@ class Doctrine_NestedSet_SingleRoot_TestCase extends Doctrine_UnitTestCase
$this
->
assertEqual
(
'node2'
,
$desc
[
0
][
'name'
]);
$this
->
assertEqual
(
1
,
$desc
[
0
][
'level'
]);
}
public
function
testGetNumberChildren
()
{
$treeMngr
=
$this
->
conn
->
getTable
(
'NestedSetTest_SingleRootNode'
)
->
getTree
();
$root
=
$treeMngr
->
fetchRoot
();
$this
->
assertEqual
(
1
,
$root
->
getNode
()
->
getNumberChildren
());
}
public
function
testGetAncestors
()
{
...
...
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