-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquick-test.php
More file actions
28 lines (25 loc) · 948 Bytes
/
quick-test.php
File metadata and controls
28 lines (25 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once __DIR__ . '/lib/TeamStorage.php';
require_once __DIR__ . '/lib/ListingManager.php';
$craftyEmail = 'test_mail1@stonybrook.edu';
$storage = new TeamStorage($craftyEmail);
$state = $storage->getState();
$ads = ListingManager::getListingsByChemical();
echo "=== CRAFTY OTTER STATUS ===\n\n";
echo "Chemical D:\n";
echo " Inventory: " . ($state['inventory']['D'] ?? 0) . " gallons\n";
echo " Buy Listings Available: " . count($ads['D']['buy'] ?? []) . "\n\n";
if (($state['inventory']['D'] ?? 0) > 0 && count($ads['D']['buy'] ?? []) > 0) {
echo "✓ Should see " . count($ads['D']['buy']) . " 'Sell to' offers\n\n";
foreach ($ads['D']['buy'] as $ad) {
echo " - Sell to: {$ad['teamName']}\n";
}
} else {
if (($state['inventory']['D'] ?? 0) <= 0) {
echo "✗ No inventory - can't sell\n";
}
if (count($ads['D']['buy'] ?? []) <= 0) {
echo "✗ No buy requests posted\n";
}
}
?>