Code Duplication    Length = 9-9 lines in 5 locations

tests/NestedSetsBehaviorTestCase.php 5 locations

@@ 236-244 (lines=9) @@
233
        $node->makeRoot()->save();
234
    }
235
236
    public function testMakeRootNoChange()
237
    {
238
        $node = MultipleTreeNode::findOne(1);
239
        $node->slug = 'root';
240
        $this->assertTrue($node->makeRoot()->save());
241
        $dataSet = $this->getConnection()->createDataSet(['tree', 'multiple_tree']);
242
        $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-make-root-no-change.php'));
243
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
244
    }
245
246
    public function testPrependToInsertInNoEmpty()
247
    {
@@ 311-319 (lines=9) @@
308
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
309
    }
310
311
    public function testPrependToUpdateAnotherTree()
312
    {
313
        $node = MultipleTreeNode::findOne(30);
314
        $this->assertTrue($node->prependTo(MultipleTreeNode::findOne(4))->save());
315
316
        $dataSet = $this->getConnection()->createDataSet(['tree', 'multiple_tree']);
317
        $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-prepend-to-update-another-tree.php'));
318
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
319
    }
320
321
    public function testPrependToUpdateSelf()
322
    {
@@ 435-443 (lines=9) @@
432
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
433
    }
434
435
    public function testAppendToUpdateAnotherTree()
436
    {
437
        $node = MultipleTreeNode::findOne(30);
438
        $this->assertTrue($node->appendTo(MultipleTreeNode::findOne(4))->save());
439
440
        $dataSet = $this->getConnection()->createDataSet(['tree', 'multiple_tree']);
441
        $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-append-to-update-another-tree.php'));
442
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
443
    }
444
445
    public function testAppendToUpdateSelf()
446
    {
@@ 559-567 (lines=9) @@
556
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
557
    }
558
559
    public function testInsertBeforeUpdateAnotherTree()
560
    {
561
        $node = MultipleTreeNode::findOne(26);
562
        $this->assertTrue($node->insertBefore(MultipleTreeNode::findOne(15))->save());
563
564
        $dataSet = $this->getConnection()->createDataSet(['tree', 'multiple_tree']);
565
        $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-insert-before-update-another-tree.php'));
566
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
567
    }
568
569
    /**
570
     * @expectedException \yii\base\Exception
@@ 671-679 (lines=9) @@
668
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
669
    }
670
671
    public function testInsertAfterUpdateAnotherTree()
672
    {
673
        $node = MultipleTreeNode::findOne(26);
674
        $this->assertTrue($node->insertAfter(MultipleTreeNode::findOne(21))->save());
675
676
        $dataSet = $this->getConnection()->createDataSet(['tree', 'multiple_tree']);
677
        $expectedDataSet = new ArrayDataSet(require(__DIR__ . '/data/test-insert-after-update-another-tree.php'));
678
        $this->assertDataSetsEqual($expectedDataSet, $dataSet);
679
    }
680
681
    /**
682
     * @expectedException \yii\base\Exception