diff options
Diffstat (limited to 'lib/t/00_downloads.t')
-rw-r--r-- | lib/t/00_downloads.t | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/t/00_downloads.t b/lib/t/00_downloads.t new file mode 100644 index 000000000..f30f9bf51 --- /dev/null +++ b/lib/t/00_downloads.t @@ -0,0 +1,40 @@ +<?php + + +require realpath(__DIR__ . '/../testmore.php'); +require realpath(__DIR__ . '/../Downloads.php'); + +plan('no_plan'); + +diag('Testing prepare_download(). Countries/continents should match.'); + +$wsd = new Downloads(); + +$countries = array( + 'FR' => array('FR', 'EU'), + 'DE' => array('DE', 'EU'), + 'AU' => array('AU', 'OC') +); + +foreach ($countries as $k => $v) { + $one = $wsd->prepare_download(true, $k); + + //is($one['country'], $v[0], "countries match"); + is($one['continent'], $v[1], "continents match"); +} + +diag('Testing get_mirror(). Note, this depends on the actual mirrors list.'); + +$ccs = array( + array('FR', 'EU'), + array('DE', 'EU'), + array('CN', 'AS') +); + +foreach ($ccs as $cc) { + $mir = $wsd->get_mirror($cc[0], $cc[1]); + + //is($mir['country'], $cc[0], 'country match'); + is($mir['continent'], $cc[1], 'continents match'); +} + |