Skip to content

Instantly share code, notes, and snippets.

@AD7six
Created August 11, 2015 07:11
Show Gist options
  • Save AD7six/2277936e429ae223aa8a to your computer and use it in GitHub Desktop.
Save AD7six/2277936e429ae223aa8a to your computer and use it in GitHub Desktop.
tree.diff
www-data @ dev [ /home/andy/repos/cakephp/cakephp ] (master *$%=)
-> git diff
diff --git tests/TestCase/ORM/Behavior/TreeBehaviorTest.php tests/TestCase/ORM/Behavior/TreeBehaviorTe
index 42a0bad..0955c25 100644
--- tests/TestCase/ORM/Behavior/TreeBehaviorTest.php
+++ tests/TestCase/ORM/Behavior/TreeBehaviorTest.php
@@ -51,6 +51,23 @@ class TreeBehaviorTest extends TestCase
TableRegistry::clear();
}
+ public function testSo()
+ {
+ $root = $this->table->deleteAll(['1=1']);
+ $root = $this->table->newEntity();
+ $root->name = 'Home';
+ $root->parent_id = null;
+ $root->lft = $this->table->newEntity([
+ 'name' => 'Category 1',
+ ]);
+ $root->rght = $this->table->newEntity([
+ 'name' => 'Category 2',
+ ]);
+ $this->table->save ($root) ;
+ debug($this->table->find()->toArray());
+ die;
+ }
+
/**
* Sanity test
*
www-data @ dev [ /home/andy/repos/cakephp/cakephp ] (master *$%=)
-> phpunit --stop-on-failure tests/TestCase/ORM/Behavior/TreeBehaviorTest.php
PHPUnit 4.3.4 by Sebastian Bergmann.
Configuration read from /home/andy/repos/cakephp/cakephp/phpunit.xml.dist
/tests/TestCase/ORM/Behavior/TreeBehaviorTest.php (line 67)
########## DEBUG ##########
[
(int) 0 => object(Cake\ORM\Entity) {
'id' => (int) 12,
'name' => 'Home',
'parent_id' => null,
'lft' => (int) 1,
'rght' => (int) 2,
'depth' => null,
'[new]' => false,
'[accessible]' => [
'*' => true
],
'[dirty]' => [],
'[original]' => [],
'[virtual]' => [],
'[errors]' => [],
'[repository]' => 'NumberTrees'
}
]
###########################
www-data @ dev [ /home/andy/repos/cakephp/cakephp ] (master *$%=)
->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment