Tap::isa($listing, 'Gaia\\Souk\\Listing', 'create returns a souk listing object'); Tap::is($listing->price, 10, 'price returned is 10'); Tap::is($listing->step, 1, 'step is one if no step specified'); Tap::is($listing->bid, 0, 'opening bid is zero'); Tap::is($listing->seller, $seller_id, 'seller matches the user id we passed in'); Tap::is($listing->closed, 0, 'auction not closed yet'); Tap::is($listing->buyer, 0, 'no buyer yet'); Tap::is($listing->bidder, 0, 'no bidder either'); Tap::is($listing->touch, 0, 'auction hasnt been touched yet'); Tap::cmp_ok(abs($listing->created - Time::now()), '<', 2, 'created matches current time'); Tap::is($listing->expires - $listing->created, 86400 * 14, 'when no expires time set, defaults to 2 weeks'); Tap::is($listing, $souk->get($listing->id), 'get by id returns same item we got back from auction step'); Tap::is(array($listing->id => $listing), $souk->fetch(array($listing->id)), 'fetch by id returns same item we got back from auction step'); Time::offset(86400 * 15); $listing = $souk->close($listing->id); Tap::isa($listing, 'Gaia\\Souk\\Listing', 'close returns a souk listing object'); Tap::is($listing->closed, 1, 'the listing is now closed'); Tap::cmp_ok(abs($listing->touch - Time::now()), '<', 2, 'after closing, touch matches current time'); Tap::is($listing->buyer, 0, 'the buyer field is still zero'); Tap::is($listing->bid, 0, 'bid is also empty'); $souk = Souk($app, $seller_id); $listing = $souk->auction(array('price' => 10, 'bid' => 0, 'item_id' => $item_id)); $e = NULL; try { $listing = $souk->bid($listing->id, 4); } catch (Exception $e) { $e = $e->getMessage(); } Tap::is($e, 'invalid bidder', 'sellers cant bid on their their own items'); DB\Transaction::reset(); DB\Connection::reset();