Phalcon\Test\Mvc\Model\Behavior\NestedSetTest::testShouldCatchExceptionWhenCreateARootNodeUsingOneTreePerTable PHP Method

testShouldCatchExceptionWhenCreateARootNodeUsingOneTreePerTable() public method

Creating more than one root by using one tree per table
Since: 2016-02-28
Author: Serghei Iakovlev ([email protected])
    public function testShouldCatchExceptionWhenCreateARootNodeUsingOneTreePerTable()
    {
        $this->specify('Test managed to create more than one root by using one tree per table', function () {
            $category = new CategoriesOneRoot();
            $category->name = 'Mobile Phones';
            $category->saveNode();
            $category = new CategoriesOneRoot();
            $category->name = 'Computers';
            $category->saveNode();
        }, ['throws' => ['Phalcon\\Mvc\\Model\\Exception', 'Cannot create more than one root in single root mode.']]);
    }