1
0
Fork 0
mirror of https://github.com/Oreolek/yii2-nested-sets.git synced 2024-05-18 16:58:17 +03:00

Added new cases to unit tests

This commit is contained in:
Alexander Kochetov 2015-01-03 18:10:05 +03:00
parent 590d8e38c3
commit 41e9b98903

View file

@ -9,6 +9,7 @@ namespace tests;
use tests\models\MultipleRootsTree;
use tests\models\Tree;
use yii\helpers\ArrayHelper;
/**
* NestedSetsBehaviorTest
@ -827,7 +828,14 @@ class NestedSetsBehaviorTest extends DatabaseTestCase
*/
public function testDescendants()
{
$this->markTestSkipped();
$dataSet = $this->createFlatXMLDataSet(__DIR__ . '/datasets/tree.xml');
$this->getDatabaseTester()->setDataSet($dataSet);
$this->getDatabaseTester()->onSetUp();
$node = Tree::findOne(9);
$models = $node->descendants()->all();
$dataSet = new ArrayDataSet(['tree' => ArrayHelper::toArray($models)]);
$expectedDataSet = $this->createFlatXMLDataSet(__DIR__ . '/datasets/tree-after-descendants.xml');
$this->assertDataSetsEqual($expectedDataSet, $dataSet);
}
/**