예제 #1
0
 function doTest()
 {
     $bbc = new BBC_Api('-', 1);
     self::assertEquals($bbc->getSuccess(), false);
     $bbc = new BBC_Api('a', 1);
     self::assertEquals($bbc->getSuccess(), true);
 }
예제 #2
0
<?php

// Set up class loading
spl_autoload_register(function ($classname) {
    include str_replace('_', '/', $classname) . '.php';
});
// Read GET variables determining the API parameters,
// using defaults if unavailable
$letter = isset($_GET['l']) ? $_GET['l'] : 'a';
$page = isset($_GET['p']) ? $_GET['p'] : 1;
// Start our API call
$bbc = new BBC_Api($letter, $page);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
	<head>
		<title>iPlayer Exercise</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" href="style.css" />
	</head>
	<body>
		<div id="nav">
			<ul>
				<li<?php 
if ("0-9" == $letter) {
    ?>
 class="sel"<?php 
}
?>
><a href="http://thomasc.co.uk/bbc/?l=0-9">0-9</a></li>
<?php