public function testPutItem()
{
$instance = new CategoryHandler();
$mockItem = m::mock('Xpressengine\\Category\\Models\\CategoryItem');
$mockItem->shouldReceive('isDirty')->once()->with('parentId')->andReturn(true);
$mockItem->shouldReceive('getParentIdName')->andReturn('parentId');
$mockItem->shouldReceive('getOriginal')->with('parentId')->andReturn(1);
$mockItem->shouldReceive('setAttribute')->with('parentId', 1);
$mockItem->shouldReceive('save')->andReturnNull();
$item = $instance->putItem($mockItem);
$this->assertInstanceOf('Xpressengine\\Category\\Models\\CategoryItem', $item);
}