display cart information within li of cart menu item

The items in the $fragments array will replace the html contents of the element you specify as the key. In your example

$fragments['li.menu-item-type-woocommerce-cart'] = 'some html';

some html will be inserted in the DOM element <li class=”menu-item-type-woocommerce-cart”>

Here is the Javascript:

$( 'li.menu-item-type-woocommerce-cart' ).replaceWith( 'some html' );

Is there already such an element in your menu?