コード例 #1
0
DB\Transaction::reset();
DB\Connection::reset();
$listing = $souk->buy($listing->id);
Tap::is($listing->closed, 1, 'buy works fine, tho');
$souk = Souk($app, $seller_id);
$listing = $souk->auction(array('bid' => 0, 'item_id' => $item_id));
$souk = Souk($app, $buyer_id);
$e = NULL;
try {
    $listing = $souk->buy($listing->id);
} catch (Exception $e) {
    $e = $e->getMessage();
}
Tap::is($e, 'bid only', 'when buying bid-only, fails');
DB\Transaction::reset();
DB\Connection::reset();
$listing = $souk->bid($listing->id, 1);
Tap::is($listing->bid, 1, 'bid works fine, tho');
$listing = Souk($app, $seller_id)->auction(array('bid' => 0, 'reserve' => 5, 'item_id' => $item_id));
$listing = Souk($app, $buyer_id)->bid($listing->id, 5);
Tap::is($listing->bid, 5, 'without enable_proxy, bid is set, not stepped');
$listing = Souk($app)->close($listing->id);
Tap::is($listing->buyer, 0, 'when reserve isnt met, bidder doesnt win listing');
Tap::is($listing->closed, 1, 'even tho reserve wasnt met, closing still ends the bidding.');
unset($seller_id);
unset($buyer_id);
unset($item_id);
Time::offset(86400 * 30);
$id = 0;
$ct = 0;
while ($listings = Souk($app)->pending(0, 5, $id)) {