Skip to content

Commit

Permalink
tests: add singel administration unit case
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kurowski committed Nov 28, 2023
1 parent cf10f8d commit fdf3072
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/administrative-unit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php declare(strict_types = 1);

use HnutiBrontosaurus\BisClient\BisClient;
use HnutiBrontosaurus\BisClient\NotFound;


/** @var BisClient $client */
$client = require_once __DIR__ . '/bootstrap.php';
?>

<h2>Administration unit</h2>
<form method="get">
ID: <input type="text" name="id" value="<?php echo $_GET['id'] ?>">
<input type="submit" value="Go">
</form>

<?php

if (empty($_GET['id'])) {
exit;
}

$id = (int) $_GET['id'];
$units = $client->getAdministrationUnits();
foreach ($units as $unit) {
if ($unit->getId() === $id) {
dump($unit);
exit;
}
}

echo 'not found';
1 change: 1 addition & 0 deletions tests/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<li><a href="events.php">events</a></li>
<li><a href="event.php">event</a></li>
<li><a href="administrative-units.php">administrative units</a></li>
<li><a href="administrative-unit.php">administrative unit</a></li>
<li><a href="opportunities.php">opportunities</a></li>
<li><a href="opportunity.php">opportunity</a></li>
</ul>

0 comments on commit fdf3072

Please sign in to comment.