Jarves\Tests\REST\BasicTest::testUpdating PHP Метод

testUpdating() публичный Метод

public testUpdating ( )
    public function testUpdating()
    {
        ItemQuery::create()->deleteAll();
        $item1 = new Item();
        $item1->setTitle('Item 1');
        $item1->save();
        $id = $item1->getId();
        $response = $this->restCall('/jarves/object/test/item/' . $id . '?fields=title');
        $this->assertEquals('Item 1', $response['data']['title']);
        $item = $this->getObjects()->get('test/item', $id);
        $response = $this->restCall('/jarves/object/test/item/' . $id, 'PUT', array('title' => 'Item 1 modified'));
        $this->assertEquals(200, $response['status']);
        $this->assertTrue($response['data']);
        //did we really store the new value?
        $response = $this->restCall('/jarves/object/test/item/' . $id);
        $this->assertEquals('Item 1 modified', $response['data']['title']);
    }