Jarves\Tests\REST\NestedTest::testNestedMultipleAdd PHP Method

testNestedMultipleAdd() public method

    public function testNestedMultipleAdd()
    {
        $blog = NodeQuery::create()->findOneByTitle('Blog');
        $post = array('visible' => true, '_items' => [['title' => 'Rest Nested Test', 'type' => 0, 'urn' => 'nested-test', 'layout' => '@JarvesDemoThemeBundle.jarvesDemoTheme/layout_default.tpl']], '_multiple' => true, '_position' => 'next', '_pk' => ['id' => $blog->getId()], '_targetObjectKey' => 'jarves/node');
        $response = $this->restCall('/jarves/object/jarves/node/:multiple', 'POST', $post);
        $this->assertEquals(200, $response['status']);
        $this->assertGreaterThan(1, $response['data'][0]['id']);
        $id = $response['data'][0]['id'];
        $item = NodeQuery::create()->findPk($id);
        $this->assertGreaterThan(0, $item->getLft());
        $this->assertGreaterThan(0, $item->getRgt());
        $this->assertGreaterThan(0, $item->getLevel());
        $item->delete();
    }