$quantity = $stockpile->quantity();
$quantity->set($stockpile->newId(), array());
$serial = lastElement($quantity->serials());
$quantity->set($serial, $props = range(1, 1200));
$res = stockpile($app, $user_id)->add($item_id, $quantity);
Tap::is($res, $quantity, 'after storing a large list of properties, result coming back still matches. db didn\'t truncate');
// this test doesn't quite work because of caching layer.
$item_id = uniqueNumber(1, 10000000);
$stockpile = stockpile($app, $user_id);
$q = $stockpile->quantity();
$q->set($stockpile->newId(), array());
$stockpile->add($item_id, $q);
$q = $stockpile->get($item_id);
Tap::is(lastElement($q->all()), array(), 'empty properties before callback validator is attached');
$stockpile = new QuantityInspector($stockpile, 'Gaia\\Stockpile\\sanitizeQuantity');
$q = $stockpile->get($item_id);
Tap::is(lastElement($q->all()), array('xp' => 1), 'callback function populated xp into read quantity object');
$stockpile = new QuantityInspector(stockpile($app, $user_id), 'Gaia\\Stockpile\\sanitizeQuantity');
$item_id = uniqueNumber(1, 10000000);
$q = $stockpile->quantity();
$q->set($stockpile->newId(), array());
$res = $stockpile->add($item_id, $q);
Tap::is(lastElement($res->all()), array('xp' => 1), 'callback function populated xp into the quantity on add');
$user_id = uniqueUserID();
$item_id = uniqueNumber(1, 10000000);
$stockpile = stockpile($app, $user_id);
$q = $stockpile->quantity();
$q->set($stockpile->newId(), array());
$q->set($stockpile->newId(), array());
$q->set($stockpile->newId(), array());
$total = $stockpile->add($item_id, $q);